Topic

Argo CD sync local K8S deployment with Github manifest

Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes applications. This is a post to show how enable Argo CD on local k8s and AWS EKS, deploy application and sync with github manifest

  • Argo CD install ingress controller ingress-nginx
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
  • Download and install Argo CD CLI
curl -sSL -o argocd-linux-amd64 https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64
sudo install -m 555 argocd-linux-amd64 /usr/local/bin/argocd
rm argocd-linux-amd64
  • configure Argo CD API Server and deploy zackweb

Change the argocd-server service type to NodePort, init admin passwd and deploy “zackweb” via argocd application manifests (argo-zackweb-application.yaml)

kubectl patch svc argocd-server -n argocd -p '{"spec": {"type": "NodePort"}}'
argocd admin initial-password -n argocd
kubectl create -f argo-zackweb-application.yaml

argo-zackweb-application.yaml

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: zackweb
  namespace: argocd
spec:
  destination:
    namespace: 'zackweb'
    server: 'https://kubernetes.default.svc'
  source:
    path: eks-deploy
    repoURL: 'https://github.com/ZackZhouHB/zack-gitops-project'
    targetRevision: editing
  project: default
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
    syncOptions:
    - CreateNamespace=true
  • access to argocd UI check for sync

image tooltip here