kubernetesargocdgitops

ArgoCD together after helm upgrade application?


I am new to GitOps, I have watched some tutorials about ArgoCD, but the applications are mostly deployed by syncing from the GitRepo manifest.

I know that by running the cmd "argocd sync", it will do a pull from a git repo and perform like a kubectl apply -f $FILE.yml

So I'm a bit of lost, My question is that if my old way is to deploy the application via helm upgrade, now I should get rid of helm upgrade cmd to install new app right? Can I still stick to helm and perform some kind of helm upgrade but only generate the manifests and then push them to the git repo that stores the manifest so that ArgoCD can sync the manifest?


Solution

  • If I understand you issue correctly there is no need to create yaml manifest from helm chart and then use it with ArgoCD.

    ArgoCD support few template engines (raw yaml, helm, jsonnet and kustomize) and you can directly pass your helm values.

    Here is some example manifest:

    apiVersion: argoproj.io/v1alpha1
    kind: Application
    metadata:
      name: gitea
      namespace: argocd
      finalizers:
      - resources-finalizer.argocd.argoproj.io
    spec:
      destination:
        namespace: 'gitea'
        server: 'https://kubernetes.default.svc'
      project: apps
      syncPolicy:
        automated:
          prune: true
          selfHeal: true
        syncOptions:
        - CreateNamespace=true
        - ApplyOutOfSyncOnly=true
        - PruneLast=true
      source:
        path: gitea
        repoURL: https://github.com/test/helm-charts.git
        targetRevision: HEAD
        helm:
          values: |-
    # Here you can pass all values to overwrite default chart values
            ingress:
              enabled: true
              annotations:
                kubernetes.io/ingress.class: nginx
              hosts:
                - host: gitea.test.com
                  paths:
                    - path: /
                      pathType: Prefix
              tls:
              - hosts:
                - gitea.test.com
                secretName: tls-wildcard-test-com
            resources:
              limits:
                cpu: 600m
                memory: 600Mi
              requests:
                cpu: 500m
                memory: 500Mi
    

    Here is also documentation describing more ways how to integrate ArgoCD with helm.