Argo CD 目前市面上唯一具有完整 UI 的 GitOps 工具,簡單又直覺的操作以及完整的文件,很值得花幾個小時去玩看看。


Get Started
https://argoproj.github.io/argo-cd/getting_started/
kubectl create namespace argocd |

安裝 Argo CLI
brew tap argoproj/tap |
預設的 argo service 不會 expose,先改成 LoadBalancer
,方便 Debug。
kubectl patch svc argocd-server -n argocd -p '{"spec": {"type": "LoadBalancer"}}' |
取得 admin 密碼
kubectl get pods -n argocd -l app.kubernetes.io/name=argocd-server -o name | cut -d'/' -f 2 |
# password: rammus |
Clean
刪除 namespace 就會自動 cascade 底下所有資源了。
kubectl delete ns argocd |
行為
auto-sync 不能 rollback

Argo CD polls Git repositories every three minutes to detect changes to the manifests.
(source)
最好使用不變的路徑. (source)
✅ github.com/argoproj/argo-cd//manifests/cluster-install?ref=v0.11.1 |
Blue/Green Deploy
kubectl create namespace argo-rollouts |
namespace/argo-rollouts created |
https://github.com/RammusXu/argo-demo/blob/master/bg/demo.yaml
Create:

Update image:

preview-service 會連結到新的 pods:

確認無誤後,繼續 rollout:

rollout 成功後,preview-service 的 pod 也會跟著清掉:

如果想要 rollback,可以參考:

Ref:
- https://argoproj.github.io/argo-rollouts/
- https://blog.argoproj.io/introducing-argo-rollouts-59dd0fad476c