Skip to content

Deploying Applications with Helm

While the platform's primary workflow encourages creating your own application manifests, a common and powerful way to deploy third-party software (like databases, monitoring tools, or message queues) is by using Helm charts.

The platform's GitOps toolkit (FluxCD) provides a fully declarative, Git-based way to manage Helm chart releases. Instead of running helm commands manually, you will define two types of Kubernetes resources:

  1. HelmRepository: This resource tells Flux where to find Helm charts (the repository URL).
  2. HelmRelease: This resource tells Flux what chart to deploy from a repository, which version to use, and how to configure it (the values).

This guide will walk you through the process of deploying a Helm chart using this GitOps workflow.

Step 1: Add the Helm Repository

First, you need to add the Helm repository that contains the chart you want to deploy. You do this by creating a HelmRepository manifest. This is the equivalent of helm repo add.

The manifest below adds the official Grafana Helm chart repository and tells Flux to check it for updates every 30 minutes.

# helm-repository.yaml
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
  name: grafana-repo
  namespace: your-app-namespace # Deploy this in the same namespace as your HelmRelease
spec:
  # The interval at which to check the repository for new chart versions
  interval: 30m
  # The URL of the Helm chart repository
  url: https://grafana.github.io/helm-charts

Step 2: Create the Helm Release

Next, create a HelmRelease resource. This manifest is the equivalent of helm install or helm upgrade. It defines the release, which chart to use from which repository, and how to configure it.

# helm-release.yaml
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
  name: my-grafana-release
  namespace: your-app-namespace
spec:
  # The interval at which Flux will reconcile this release
  interval: 5m
  chart:
    spec:
      # The name of the chart in the repository
      chart: grafana
      # --- IMPORTANT ---
      # Always pin the chart to a specific version for predictable deployments
      version: "7.3.11"
      # Reference the HelmRepository you created in Step 1
      sourceRef:
        kind: HelmRepository
        name: grafana-repo
      # The interval for Flux to check for new versions of this specific chart
      interval: 1m
  # Configuration values to override the chart's defaults
  values:
    # Example: Override the default priority class for the deployment
    priorityClassName: "secure-cloud-stack-tenant-namespace-application-non-critical"
    # Example: Set a specific number of replicas
    replicas: 1

Finding Chart Versions and Values

  • Version: It is critical to pin the chart.spec.version. You can find available versions on a site like Artifact Hub. Using a floating version or omitting it can lead to unexpected, automatic upgrades.
  • Values: The spec.values block is where you configure the chart. To find all the available configuration options, look for the "Values" or "Configuration" section on the chart's documentation page, often on Artifact Hub.

Step 3: Commit and Deploy

Commit both the HelmRepository and HelmRelease manifests to your GitOps repository and push the changes. Flux will automatically:

  1. Detect the HelmRepository and begin tracking the Grafana chart repository.
  2. Detect the HelmRelease and deploy version 7.3.11 of the grafana chart using the configuration you provided in the values block.

If you later need to upgrade the chart or change its configuration, you simply update the version or values in your HelmRelease manifest and push the changes to Git. Flux will automatically apply the upgrade.