Saniul Ahsan

#javascript, #python, #microservices, #automations, #blockchains, #devops

Helm Chart 101

Helm is a package manager for Kubernetes that simplifies the deployment and management of applications on a Kubernetes cluster. It helps in defining, installing, and upgrading even complex Kubernetes applications using configurations called Helm charts.

Here’s a basic rundown of Helm concepts:

  1. Chart: A Helm chart is a collection of files that describe a Kubernetes application. It contains YAML-formatted templates for Kubernetes manifest files and metadata. Charts can be customized through values files to suit specific deployment needs.
  2. Release: When you install a Helm chart onto a Kubernetes cluster, it creates an instance of that chart called a release. Releases are individual deployments of a chart.
  3. Repository: A Helm repository is a place where charts are stored and shared. Official Helm charts are often available in public repositories, but you can also create your private repositories to manage your charts.
  4. Values: Helm allows the customization of charts using values files. These files contain configurable parameters that are used to modify the default behavior of the chart.
  5. Template: Helm uses Go template language to generate Kubernetes manifest files from the chart’s templates. These templates can contain placeholders and logic to create dynamic configurations.

Helm Commands:

  • helm install: Installs a chart onto your Kubernetes cluster.
  • helm upgrade: Upgrades a release to a new version of a chart.
  • helm uninstall: Uninstalls a release from the cluster.
  • helm list: Lists all releases deployed on the cluster.
  • helm repo add: Adds a chart repository to Helm.
  • helm repo update: Updates local Helm repository cache.

Basic Workflow:

  1. Install Helm: Install Helm on your local machine and initialize it on your Kubernetes cluster.
  2. Explore Repositories: Discover available charts by exploring Helm repositories, including both official and community-maintained charts.
  3. Customize Values: Customize values in a chart’s values.yaml file or create your own my-values.yaml to override default configurations.
  4. Install/Upgrade: Use helm install to deploy a chart onto the cluster. Use helm upgrade to update a release with changes.
  5. Manage Releases: Use helm list to see the deployed releases and helm uninstall to remove a release when necessary.

Installation:

  1. Installing Helm:
    • Visit the Helm GitHub releases page or Helm’s official site.
    • Choose the appropriate installation method for your OS (Linux, macOS, or Windows).
    • Follow the installation instructions provided.
  2. Initialise Helm:
    • After installation, initialize Helm on your Kubernetes cluster by running: helm init.

Basic Commands:

  1. Adding Repositories:
    • To add a repository: helm repo add <repository_name> <repository_url>.
    • Example: helm repo add stable https://charts.helm.sh/stable.
  2. Updating Repositories:
    • Refresh local repository cache: helm repo update.
  3. Installing a Chart:
    • Use helm install to deploy a chart onto your cluster.
    • Example: helm install my-release stable/mysql.
  4. Customizing Values:
    • Customize values in a chart using --set flag or by creating a separate values file: helm install my-release -f values.yaml stable/mysql.
  5. Upgrading a Release:
    • To update a release: helm upgrade my-release stable/mysql.
    • If using a values file: helm upgrade my-release -f new-values.yaml stable/mysql.
  6. Listing Releases:
    • To list releases deployed on the cluster: helm list.
  7. Uninstalling a Release:
    • Remove a release: helm uninstall my-release.

Best Practices:

  • Version control your Helm charts and values files.
  • Use namespaces to organize your deployments.
  • Regularly update Helm and your Helm repositories for the latest features and security patches.
  • Be cautious while upgrading releases to avoid breaking changes.

Helm simplifies Kubernetes application management by providing a standardised way to package, configure, and deploy applications, ensuring scalability, repeatability, and maintainability within Kubernetes environments.