[Book] [OK!] GitOps Cookbook: 07. Argo CD: 7.2 Automatic Synchronization


Делаю:
2024.03.09


$ cat << 'EOF' | kubectl create -f -
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: bgd-app
  namespace: argocd
spec:
  destination:
    namespace: bgd
    server: https://kubernetes.default.svc
  project: default
  source:
    repoURL: https://github.com/wildmakaka/gitops-cookbook-sc.git
    path: ch07/bgd
    targetRevision: main
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
EOF


$ minikube --profile ${PROFILE} ip
192.168.49.2


$ kubectl patch svc bgd -n bgd -p '{"spec": {"type": "NodePort"}}'


$ kubectl get services -n bgd
NAME   TYPE       CLUSTER-IP    EXTERNAL-IP   PORT(S)          AGE
bgd    NodePort   10.100.45.5   <none>        8080:30411/TCP   5m39s


// [OK!]
http://192.168.49.2:31739


$ kubectl -n bgd patch deploy/bgd \
--type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/env/0/value", "value":"red"}]'


// [OK!]
http://192.168.49.2:31739


$ argocd app delete bgd-app