Thursday, 5 December 2024

Essential Helm Commands for Kubernetes Applications

 Helm, the package manager for Kubernetes, simplifies application deployment and management. By using Helm charts, you can automate deployments, manage configuration, and streamline upgrades. Here are some of the most important Helm commands with simple explanations to help you manage Kubernetes applications efficiently.

1. helm repo add

Command:

helm repo add stable https://charts.helm.sh/stable

Adds a Helm repository to your system. This is where Helm looks for charts when installing applications.

2. helm repo update

Command:

helm repo update

Refreshes your local list of charts from the repositories you’ve added. Use this to ensure you’re working with the latest versions of the charts.

3. helm search repo

Command:

helm search repo nginx

Searches for charts in the added Helm repositories. Replace nginx with the application name you’re looking for.

4. helm install

Command:

helm install my-app stable/nginx

Installs a Helm chart in your Kubernetes cluster. The first argument (my-app) is the release name, and the second (stable/nginx) is the chart you want to deploy.

5. helm upgrade

Command:

helm upgrade my-app stable/nginx --set replicaCount=3

Upgrades an existing Helm release (my-app) with a new chart or updated configuration. You can pass configuration changes using --set.

6. helm rollback

Command:

helm rollback my-app 1

Reverts a Helm release (my-app) to a previous revision (e.g., revision 1). Use this if something goes wrong after an upgrade.

7. helm uninstall

Command:

helm uninstall my-app

Uninstalls a Helm release (my-app) from your Kubernetes cluster. The associated resources created by the chart will be removed.

8. helm list

Command:

helm list

Lists all Helm releases in your Kubernetes cluster. You can see details like the release name, status, and namespace.

9. helm status

Command:

helm status my-app

Displays the current status of a Helm release (my-app), including its resources and notes provided by the chart.

10. helm template

Command:

helm template my-app stable/nginx

Renders a Helm chart into Kubernetes manifests locally, without applying them to the cluster. This is helpful for reviewing or debugging the generated YAML files.

11. helm lint

Command:

helm lint ./my-chart

Validates a Helm chart for syntax or configuration errors. This ensures the chart is ready for deployment.

12. helm package

Command:

helm package ./my-chart

Packages a Helm chart into a .tgz archive. This is useful for sharing or uploading charts to a repository.

13. helm push

Command:

helm push my-chart.tgz my-repo

Pushes a packaged chart to a Helm repository. Replace my-repo with the name of your target repository.

14. helm repo remove

Command:

helm repo remove stable

Removes a Helm repository from your system. This is useful for cleaning up unused repositories.

15. helm show values

Command:

helm show values stable/nginx

Displays the default values of a Helm chart. These values can be overridden during installation or upgrades.

16. helm get manifest

Command:

helm get manifest my-app

Fetches the rendered Kubernetes manifest for a Helm release (my-app). Use this to debug deployment issues.

17. helm diff upgrade

Command:

helm diff upgrade my-app stable/nginx

Shows the differences between the currently deployed version of a Helm release and an updated chart. Useful for reviewing changes before applying them.

18. helm history

Command:

helm history my-app

Displays the revision history of a Helm release. Each revision corresponds to an install or upgrade operation.

19. helm test

Command:

helm test my-app

Runs the tests associated with a Helm release. This ensures that your deployment works as expected.

20. helm dependencies update

Command:

helm dependencies update ./my-chart

Updates the dependencies of a chart. Use this when your chart relies on other charts that have changed.

Helm simplifies the deployment and management of Kubernetes applications, enabling developers to focus more on building features rather than dealing with complex configurations. By mastering these essential commands, you can create and maintain scalable Kubernetes environments with ease.

Labels:

0 Comments:

Post a Comment

Note: only a member of this blog may post a comment.

<< Home