This page describes how to deploy a Helm chart from the remote Helm repository with modified or updated values.yaml file from the GitOps repository (GitLab or GitHub repository) using Argo CD.
- You want to deploy a Helm chart from the remote Helm repository.
- And you also want to overwrite the values with only the modified or updated
values.yamlfile from your GitOps repository.
Before Argo CD v2.6, the Helm chart and values files must be in the same GitOps repository.
In Argo CD v2.6, Multiple Sources was introduced as a beta feature that allows users to deploy an application using resources from various repositories, such as a Helm chart from a remote Helm repository and its values.yaml file from a Git repository.
Configure an Argo CD application using multiple sources.
For Example, this Argo CD Applicaion configuration deploys the Grafana Helm chart from the remote repository (https://grafana.github.io/helm-charts) and its modified values.yaml from your GitOps repository to overwrite the values.
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: grafana
spec:
destination:
namespace: infra
server: {{ .Values.spec.destination.server }}
sources:
# Grafana Helm Repository
# This installs Grafana with the modified values.yaml file.
- repoURL: "https://grafana.github.io/helm-charts"
chart: grafana
targetRevision: 10.1.0
helm:
valueFiles:
- $k8s-gitops/helm/grafana/values.yaml
# GitOps Source Repository that locates updated and modified local values.yaml file.
- repoURL: https://github.com/thezawzaw/k8s-gitops-example.git
targetRevision: infra
ref: k8s-gitops
project: default
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=trueDefine your GitOps repository URL, target revision, and ref name using sources.
Make sure you define "ref" as a variable name. In this example, ref name is k8s-gitops.
sources:
...
# GitOps Source Repository that locates updated and modified values.yaml file.
- repoURL: https://github.com/thezawzaw/k8s-gitops-example.git
targetRevision: infra
ref: k8s-gitopsThen, set the values.yaml file path from your GitOps repository by calling the ref name you defined.
sources:
# Grafana Helm Repository
# This installs Grafana with the modified values.yaml file.
- repoURL: "https://grafana.github.io/helm-charts"
chart: grafana
targetRevision: 10.1.0
helm:
valueFiles:
- $k8s-gitops/helm/grafana/values.yamlThen, Argo CD will deploy the Grafana Helm chart with the modified values.yaml file from your Git repository.