NavigationContentFooter
Jump toSuggest an edit

Kubernetes package management with Helm

Reviewed on 25 November 2024Published on 23 May 2024
  • kubernetes
  • helm
  • k8s

Helm is a package manager for Kubernetes that simplifies the deployment, management, and configuration of applications running on Kubernetes clusters, significantly enhancing Kubernetes’ native capabilities.

It organizes application resources into a single deployable unit called a Helm Chart, which can be versioned, shared, and reused. Helm charts can simplify the setup of common applications, such as databases, web servers, and monitoring tools, by providing a repository of well-maintained and tested configurations.

Helm provides a lot of advantages to Kubernetes infrastructures, such as:

  • Simplified application deployment: Helm allows you to deploy applications using pre-configured charts, reducing the complexity of manually writing Kubernetes manifests.
  • Version control: Helm charts version of your deployments, making it easy to roll back to previous versions if needed.
  • Reusability: Helm charts can be reused across different environments and clusters, promoting consistency and saving time.
  • Dependency management: Helm handles the dependencies between different Kubernetes resources, ensuring that they are deployed in the correct order.
  • Customizability: You can override default values in Helm charts to tailor the deployment to your specific requirements using values.yaml files.

However, it also comes with its own set of disadvantages, which include:

  • Learning curve: For beginners, there might be a learning curve to understand Helm’s templating system and chart structure.
  • Chart maintenance: Maintaining and updating Helm charts requires ongoing effort, especially for complex applications.
  • Overhead: Using Helm adds another layer of abstraction and tooling, which may introduce some overhead in terms of management and resource utilization.

For a complete overview of Helm and its basic concepts, refer to this Scaleway blog post.

Before you start

To complete the actions presented below, you must have:

  • A Scaleway account logged into the console
  • Owner status or IAM permissions allowing you to perform actions in the intended Organization
  • Created a Kapsule cluster
  • Set up kubectl on your machine

Installing Helm

Tip

Before installing Helm, ensure that kubectl is installed and configured on your system. You can verify this by running:

kubectl cluster-info

You will see cluster information if kubectl is installed and configured correctly. If not, make sure to deploy a Kubernetes Kapsule cluster first.

Installing Helm Client

  1. Download the latest Helm release for your operating system from the Helm releases page.

  2. Install Helm by following the installation instructions for your OS. For macOS:

    brew install helm

    For Linux:

    curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
    chmod 700 get_helm.sh
    ./get_helm.sh

    For Windows: Download the Windows installer from the releases page and run the installer.

  3. Verify the Helm installation by running the following command:

    helm version

    This should display the version of Helm installed.

Using Helm

Adding repositories

Helm Repositories are cloud storage locations where Helm charts are stored and distributed. They are collections of packaged charts that can be shared and retrieved using simple commands. Repositories are added to the Helm client, allowing users to search, install, and update charts.

To add a repository, use the helm repo add command:

helm repo add <repo-name> <repo-url>

For example, to add the official Helm stable repository:

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

Installing Helm charts

Helm Charts are packages of pre-configured Kubernetes resources. Each chart contains a set of YAML templates defining the Kubernetes objects required for a particular application or service and default configuration values. Charts enable reusable and repeatable deployments across different environments.

To install a chart, use the helm install command:

helm install <release-name> <chart-name>

For example, to install the nginx chart from the stable repository:

helm install my-nginx stable/nginx

Searching for Helm charts

Helm allows you to search for charts in the repositories you have added. Use the helm search command to find charts:

helm search repo <keyword>

For example, to search for all nginx-related charts:

helm search repo nginx
Tip

The Cloud Native Computing Foundation operates ArtifactHUB, a web-based application that enables finding, installing, and publishing Cloud Native packages and configurations. It allows you to search for Helm Charts and more using a web browser.

Creating Helm charts from templates

Creating Helm charts can be straightforward if you follow the template structure. Here is a brief overview of how to create a simple chart:

  1. Create a new Helm chart:

    helm create <chart-name>

    This command generates a boilerplate chart directory structure.

  2. Customize your templates: The generated chart directory includes several files and directories:

    • Chart.yaml: Metadata about the chart.
    • values.yaml: Default values for the chart’s variables.
    • templates/: Directory containing Kubernetes manifest templates.

    Modify these files to fit your application’s needs.

  3. After customizing, package your chart using:

    helm package <chart-name>
  4. Install your custom chart using the helm install command:

    helm install <release-name> <path-to-chart>

Helm ecosystem and community

For more information about Helm, including advanced usage, plugins, and community support, visit the official Helm website and the Helm GitHub repository. The community is active, and many resources are available for learning and troubleshooting.

After completing this tutorial, you now have a solid foundation for using Helm to manage your Kubernetes applications. The official Helm documentation is an excellent resource for further exploration.

Was this page helpful?
API DocsScaleway consoleDedibox consoleScaleway LearningScaleway.comPricingBlogCareers
© 2023-2024 – Scaleway