<aside> 💡 사전 준비: Azure Cluster에 ArgoCD가 설치되어있어야 함

</aside>

Local에 kubectl 연동

Azure portal → ArgoCD가 설치되어있는 cluster 선택 → Overview → Connect via Cloud Shell 를 클릭하면 아래와 같이 cli로 연동할 수 있는 명령어를 제공한다. local shell에 해당 명령어를 입력하여 context 전환을 해준다.

Untitled

Local에 EKS cluster 연동

자동으로 Kubeconfig 파일 생성하여 자동으로 cluster를 등록

aws eks update-kubeconfig --region ap-northeast-2 --name mlops-eks

추가할 argocd가 설치된 클러스터로 컨텍스트 변경

kubectl config use-context mlops_deploy

cluster 추가

로그인

argocd login <target argo cd url(http/https 빼고 입력)>

쿠버네티스 컨텍스트 확인

kubectl config get-contexts

cluster 추가

argocd cluster add <CONTEXT>

Test

argocd app create guestbook \
        --repo <https://github.com/argoproj/argocd-example-apps.git> \
        --path guestbook \
        --dest-server <cluster 이름> \
        --dest-namespace default \
				--project default