Helm

Helm is a package manager for Kubernetes. It allows developers to package, share, and manage Kubernetes applications. Helm provides the following key benefits:

  • Easy installation and upgrades: Define your application configuration as a Helm chart and install or upgrade it with a single command.
  • Simplified application management: Manage complex deployments with a single resource, simplifying the overall process.
  • Versioning: Track changes made to your application and easily rollback to previous versions.
  • Reusability: Create and share Helm charts to easily deploy your applications on multiple clusters.

Configuration

Helm is configured using HelmRelease custom resources, which define the application’s name, namespace, chart version, and configuration values.

For example, in the apps/production/podinfo-values.yaml file, the HelmRelease resource defines the podinfo application with the following configuration:

apiVersion: helm.toolkit.fluxcd.io/v2
          kind: HelmRelease
          metadata:
            name: podinfo
            namespace: podinfo
          spec:
            chart:
              spec:
                version: ">=1.0.0"
            values:
              ingress:
                hosts:
                  - host: podinfo.production
                    paths:
                      - path: /
                        pathType: ImplementationSpecific
          

Key Options

  • version: Specifies the version of the Helm chart to install or upgrade. You can specify a specific version, a range, or a wildcard.
  • values: A dictionary of values that are passed to the Helm chart during installation.
  • test: A boolean flag that enables or disables automated testing after an installation or upgrade.
  • interval: Specifies how often Flux should check for updates to the chart.

Examples

  • Installing the podinfo chart with the latest stable version:

    version: ">=1.0.0"
              
  • Installing the podinfo chart with the latest alpha, beta, and pre-release versions:

    version: ">=1.0.0-alpha"
              
  • Disabling automated testing:

    test:
                enable: false
              
  • Setting the ingress host to podinfo.staging:

    values:
                ingress:
                  hosts:
                    - host: podinfo.staging
                      paths:
                        - path: /
                          pathType: ImplementationSpecific
              

Integration with Flux

Flux automates the management of Helm deployments, including updates and rollbacks. Flux watches the Helm repository and updates the Helm releases automatically based on the configured interval and version settings.

Source: https://github.com/fluxcd/flux2-kustomize-helm-example

Top-Level Directory Explanations

apps/ - This directory contains the application definitions and configurations. It includes base, production, staging directories.

apps/base/ - This directory contains the base application configurations. It includes podinfo directory.

apps/production/ - This directory contains the production application configurations.

apps/staging/ - This directory contains the staging application configurations.

clusters/ - This directory contains the Kubernetes cluster configurations. It includes production and staging directories.

clusters/production/ - This directory contains the production Kubernetes cluster configurations. It includes flux-system directory.

clusters/staging/ - This directory contains the staging Kubernetes cluster configurations. It includes flux-system directory.

infrastructure/ - This directory contains the infrastructure configurations and scripts.

infrastructure/configs/ - This directory contains the configuration files for the infrastructure.

infrastructure/controllers/ - This directory contains the Kubernetes controllers for managing the infrastructure.

scripts/ - This directory contains the scripts used for automating tasks.