Helm is a package manager for Kubernetes that simplifies the deployment and management of applications. It allows you to define, install, and upgrade even the most complex Kubernetes applications with ease. Helm uses a packaging format called charts, which are collections of pre-configured Kubernetes resource
Base concepts:
- Charts: Charts are packages of pre-configured Kubernetes resources. They contain templates, values, and metadata required to deploy an application.
- Values: Helm uses values to parameterize chart configurations. Values are specified in a
values.yaml
file and can be overridden during installation. - Templates: Helm charts use Go templating to generate Kubernetes manifest files dynamically.
- Create a chart: Use the helm create command to generate a basic chart structure. This includes directories for charts, templates, and values create mychart
**Create a Chart:
Use the helm create command to generate a basic chart structure. This includes directories for charts, templates, and values.
helm create mychart
**Customize the Chart:
Modify the chart files according to your application's requirements, especially the values.yaml file to set default configurations.
** Install a Chart:
Install a Helm chart onto your Kubernetes cluster using the helm install command.
helm install my-release ./mychart
Upgrade a Release:
Update your application by modifying the chart or values and then using the helm upgrade command.
helm upgrade my-release ./mychart
**Rollback a Release:
If an upgrade causes issues, you can roll back to a previous release version using the helm rollback command.
helm rollback my-release 1
**Search and Use Helm Charts:
Helm Hub is a public repository for Helm charts. You can search for existing charts and use them directly in your deployments.
helm search hub <chart-name>
Command | Description | Example |
---|---|---|
helm install | Install a chart onto your Kubernetes cluster. | helm install my-release stable/mysql |
helm upgrade | Upgrade a deployed release to a new version of a chart. | helm upgrade my-release stable/mysql |
helm rollback | Roll back a release to a previous revision. | helm rollback my-release 1 |
helm uninstall | Uninstall a deployed release from your Kubernetes cluster. | helm uninstall my-release |
helm list | List releases deployed on the cluster. | helm list |
helm show | Show information about a chart. | helm show stable/mysql |
helm repo add | Add a new Helm chart repository. | helm repo add my-repo https://charts.example.com |
helm repo update | Update the local repository index. | helm repo update |
helm repo remove | Remove a Helm chart repository. | helm repo remove my-repo |
helm repo list | List all added Helm chart repositories. | helm repo list |
helm package | Package a chart directory into a chart archive file (.tgz). | helm package my-chart/ |
helm lint | Check a chart for errors. | helm lint my-chart/ |
helm template | Render chart templates locally. | helm template my-chart/ |
helm pull | Download a chart to your local machine. | helm pull stable/mysql |
Command | Description | Example |
---|---|---|
completion | Generate autocompletion scripts for the specified shell. | helm completion bash |
create | Create a new chart with the given name. | helm create mychart |
dependency | Manage a chart's dependencies. | helm dependency update mychart/ |
env | Helm client environment information. | helm env |
get | Download extended information of a named release. | helm get values my-release |
help | Help about any command. | helm help install |
history | Fetch release history. | helm history my-release |
install | Install a chart. | helm install my-release stable/mysql |
lint | Examine a chart for possible issues. | helm lint mychart/ |
list | List releases. | helm list |
package | Package a chart directory into a chart archive. | helm package mychart/ |
plugin | Install, list, or uninstall Helm plugins. | helm plugin list |
pull | Download a chart from a repository and unpack it locally. | helm pull stable/mysql |
push | Push a chart to remote. | helm push mychart/ myrepo/ |
registry | Login to or logout from a registry. | helm registry login myregistry.com |
repo | Add, list, remove, update, and index chart repositories. | helm repo add myrepo https://charts.example.com |
rollback | Roll back a release to a previous revision. | helm rollback my-release 1 |
search | Search for a keyword in charts. | helm search repo keyword |
show | Show information of a chart. | helm show all stable/mysql |
status | Display the status of the named release. | helm status my-release |
template | Locally render templates. | helm template my-release stable/mysql |
test | Run tests for a release. | helm test my-release |
uninstall | Uninstall a release. | helm uninstall my-release |
upgrade | Upgrade a release. | helm upgrade my-release stable/mysql |
verify | Verify that a chart at the given path is valid. | helm verify mychart-0.1.0.tgz |
version |
Scenario | Command |
---|---|
Pull a chart and save it with a specific name and version, extracting it into a directory | helm pull nginx-ingress --version 1.2.3 --untar --untardir ./charts/nginx-ingress |
Pull a chart and save it without extracting the archive | helm pull redis --version 7.2.1 --untar=false |
Pull a chart from a specific repository using a custom configuration file and save it | helm --kubeconfig=/path/to/kubeconfig.yaml --repository-config=/path/to/repo.yaml pull mariadb --untar |
Pull a private chart from a repository using credentials | helm pull private-chart --repo https://example.com/charts --username myuser --password mypassword |
0 Comments