Feedback

Chat Icon

GitOps the Hard Way, with Argo CD

Build Real GitOps Pipelines From Empty Clusters to Automated Deploys

Argo CD With Helm: Charts, Values, and Versioned Releases
84%

Overriding the Helm Chart's Default Values

At this stage, our Application resource looks like this:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: todo-app
  namespace: argocd
spec:
  destination:
    namespace: default
    server: https://kubernetes.default.svc
  project: default
  source:
    chart: todo
    repoURL: $HELM_REPO_URL
    targetRevision: 0.2.0
    helm:
      valueFiles:
      - values.yaml
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
      allowEmpty: true

The only source we deploy from is the Helm repository. That is fine until we need to customize values. Right now the only values file in play is the one baked into the Helm package. To change the replica count (replicaCount) or the node port (service.port), we would edit values.yaml, repackage the chart, and push it back to the Helm repository. That works, but it is a slow loop for a one-line change.

There is a better way.

With plain Helm, you override chart defaults using --set:

helm upgrade --install \
  --set replicaCount=2 \
  --set service.port=5000 \
  todo $HOME/todo/app/manifests/helm/todo

Argo CD has the direct equivalent of --set: the .spec.source.helm.parameters field. Each entry maps to one --set name=value, so the name is the exact value key:

[..]
spec:
  source:
    helm:
      parameters:
      - name: key
        value: new-value

GitOps the Hard Way, with Argo CD

Build Real GitOps Pipelines From Empty Clusters to Automated Deploys

Enroll now to unlock all content and receive all future updates for free.