0

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?

RTC EG
  • 13
  • 3

1 Answers1

1

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.

  • Thank you, i saw that part in the docs too. But im a bit confusing about the gitops framework. if we straightup using argocd to install application via helm, do we still later need to sync the manifest in the current state back to the git repo? If we dont, arent we follow the gitops model? – RTC EG Mar 13 '23 at 23:59
  • We don't need to sync manifest to `git` repo. In my example we have `ArgoCD` manifest of `Application` kind. This is in `git` repo and base on that `ArgoCD` is syncing state to the cluster. Please note that we have `repoURL` which is pointing us to repository with `helm charts`. We have `path` to tell `argo` where it should look for `chart`. We have also `targetRevision` that is telling which commit should be apply to cluster. All those information are store in `git` repo so to be able to change anything we need to do it via `git`. – Michał Lewndowski Mar 14 '23 at 07:12
  • oh okay, I get it. So now the "manifest" that changes frequently is the values.yaml file instead of the normal plain manifest files. Thank you. – RTC EG Mar 14 '23 at 09:01
  • Yes. If you want to change values is more automated way I would recommend [yq](https://github.com/mikefarah/yq) – Michał Lewndowski Mar 14 '23 at 21:14