Customizing Helm Charts with helm install --set Command

Customizing Helm Charts with helm install --set Command

Introduction

Helm, the package manager for Kubernetes, provides powerful features for customizing deployments using Helm charts. The helm install --set command allows users to override default configuration values defined in Helm charts with custom values directly from the command line. In this article, we'll explore the helm install --set command, its functionality, and provide a step-by-step guide along with a practical example to demonstrate how to customize Helm charts effectively using Helm.

  1. Understanding helm install --set Command: The helm install --set command is used to override default configuration values defined in Helm charts with custom values directly from the command line. It enables users to customize deployments on-the-fly without modifying the original Helm chart files.

  2. Customizing Helm Charts: Let's customize a Helm chart named "my-chart" using the helm install --set command to specify custom values directly from the command line.

    Example:

     $ helm install my-release my-chart --set key1=value1,key2=value2
    

    Output:

     NAME: my-release
     LAST DEPLOYED: Mon Jan 24 15:04:12 2022
     NAMESPACE: default
     STATUS: deployed
     REVISION: 1
     TEST SUITE: None
     NOTES:
     1. Get the application URL by running:
        echo "http://$(kubectl get svc --namespace default my-release --template '{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}')"
    
    • The output confirms the successful deployment of the release "my-release" with customized values specified directly from the command line.

    • It provides instructions for accessing the deployed application, including the application URL.

  3. Interpreting the Output:

    • The output confirms that the deployment was successful using custom values specified with the --set flag.

    • It indicates that the release has been deployed with the specified custom values, ensuring the desired configuration for the application.

  4. Customization Best Practices:

    • Use the --set flag to specify individual key-value pairs for customizing Helm charts.

    • Ensure that the key-value pairs provided with the --set flag align with the expected structure and format defined in the Helm chart.

Conclusion

The helm install --set command provides a convenient way to customize Helm charts directly from the command line, enabling users to tailor deployments to specific requirements without modifying the original chart files. By understanding how to use this command and interpreting its output, users can efficiently customize Helm charts and streamline the deployment process in Kubernetes environments, enhancing deployment flexibility and efficiency.