argocd auto sync policy - using selfHeal as an example

In my example, I am going to sync my git source code to kubernetes cluster. Whenever i push my changes, this trigger a deployment in 180s (3 minutes - default) This can be done via selfHeal as shown below:-

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: helm-guestbook
  namespace: argocd
spec:
  syncPolicy:
     automated:
       selfHeal: true
  project: default
  # directory:
  #     recurse: true
  source:
    repoURL: https://github.com/mitzenjeremywoo/argocd-example-apps.git
    path: helm-guestbook
    helm:
      releaseName: helm-guestbook
      valueFiles:
      - values-production.yaml     
  destination:
    server: "https://kubernetes.default.svc"
    namespace: default

To change the default sync you can edit argocd-cm in the argocd namespace. Refer to the link here for more information.

The sync operation can be slightly complicated but make sense to me. More about to sync or not to sync, please refer to this link here.




Comments

Popular posts from this blog

The specified initialization vector (IV) does not match the block size for this algorithm