1

I've been involved with Kubernetes, ArgoCD and Helm Charts for a few weeks now. I already have a running EKS cluster, ArgoCD and my first Whoami app running. I have already developed my own app as a Helm Chart. I am just asking myself how best to set up my multi-staging process. Currently I do it as follows.

Folder structure

dev-cluster-manifest
|-> WhoAmi-App
|--|--> templates
|--|--|--> deployment.yaml
|--|--|--> service.yaml
|--|--> Argocd-dev.yaml
|--|--> Argocd-test.yaml
|--|--> Chart.yaml
|--|--> dev-values.yaml
|--|--> test-values.yaml

The ArgoCD Files looks like with calling dev and test values.

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: whoami-dev
  namespace: argocd
spec:
  project: default
  source:
    repoURL: 'https://github.com/myrepo'
    path: dev-cluster-manifest/whoami-app
    helm:
      valueFiles:
        - dev-values.yaml
    targetRevision: HEAD
  destination:
    server: 'https://kubernetes.default.svc'
    namespace: whoami
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
    syncOptions:
      - CreateNamespace=true

My Problem: When I update deployment.yaml ArgoCD will deploy changes to dev and test in parallel --> Not what I wanted.

My second idea was to work with packed helm charts but argoCD cant extract them. If I do it manually I have dublicated code e.g.

dev-cluster-manifest
|-> WhoAmi-App-dev
|--|--> templates
|--|--|--> deployment.yaml
|--|--|--> service.yaml
|--|--> Argocd-dev.yaml
|--|--> Chart.yaml
|--|--> dev-values.yaml

dev-cluster-manifest
|-> WhoAmi-App-test
|--|--> templates
|--|--|--> deployment.yaml
|--|--|--> service.yaml
|--|--> Argocd-test.yaml
|--|--> Chart.yaml
|--|--> test-values.yaml

Is there any solution That I can develop my Whoami-Chart in dev-cluster-manifest/whoami-app-dev and create a versioned version with e.g. git-tags (I know it doesent work) or other mechanism?

How do you version your helm-charts with argocd and eks? Thank you very much.

read docs of helm/argocd

Stefan
  • 11
  • 2
  • What do you mean by ArgoCD cannot handle packed charts? – Gaël J Jul 12 '23 at 18:55
  • The pattern I've seen most of the time is to generate the Helm chart, publish it somewhere. And then, in another Gitops repo, create the ArgoCD apps with values files for each env. – Gaël J Jul 12 '23 at 18:58

1 Answers1

0

When I update deployment.yaml ArgoCD will deploy changes to dev and test in parallel

There are several options that could be used:

  • You can use ArgoCD sync-windows on higher stages (ie. test, prod) or even disable auto-sync, and sync explicitly from a CI/CD pipeline via command.
  • You could encode the deployment.yaml template's differences between stages to only apply to specific stages via Helm conditional blocks
  • You could use kustomize to create env. specific overlays for your stages.
thikade
  • 370
  • 2
  • 4