-
安装Argo CD
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
-
下载Argo CD CLI
wget https://github.com/argoproj/argo-cd/releases/download/v2.2.2/argocd-linux-amd64
chmod +x argocd-linux-amd64
sudo mv argocd-linux-amd64 /usr/local/bin/argocd
-
访问Argo CD API Server
kubectl patch svc argocd-server -n argocd -p '{"spec": {"type": "NodePort"}}'
kubectl get svc argocd-server -n argocd
-
使用CLI登录,用户名是admin
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d; echo
argocd login 192.168.31.16:32194
修改密码
argocd account update-password
-
注册一个Cluster,为发布应用使用
kubectl config get-contexts -o name
argocd cluster add kubernetes-admin@kubernetes
-
创建一个来自Github的应用(Application)
argocd app create guestbook --repo https://github.com/argoproj/argocd-example-apps.git --path guestbook --dest-server https://kubernetes.default.svc --dest-namespace default
-
同步(发布)应用(Application)
argocd app get guestbook
argocd app sync guestbook