BlueXIII's Blog

热爱技术,持续学习

0%

ArgoCD部署

官网

https://argo-cd.readthedocs.io/en/stable/getting_started/

镜像清单

1
2
3
quay.io/argoproj/argocd:v2.7.6
ghcr.io/dexidp/dex:v2.36.0
redis:7.0.11-alpine

部署

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 安装
wget https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
kubectl create namespace argocd
kubectl apply -n argocd -f install.yaml

# 安装cli
brew install argocd

# cli方式获取实始密码
argocd admin initial-password -n argocd
admin/yourpass

# kubectl方式获取初始密码(可选)
kubectl get secret -n argocd argocd-initial-admin-secret -o yaml
echo yourpassbase64== | base64 -d

# WEB方式登录
https://10.193.36.51:30010

http://10.193.36.252:30010

禁用https跳转

修改configmap的方式实测无效,转而通过修改devops-argocd-server的pod启动参数实现

1
2
3
4
5
command:
- argocd-server
- '--staticassets'
- /shared/app
- '--insecure'

启用webhook

地址: http://10.193.36.41:30010/api/webhook
设置密码:

1
2
3
4
5
kubectl edit secret argocd-secret -n argocd

# 明文填写
stringData:
webhook.gogs.secret: dubhe123

配置开发、测试环境

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# CLI方式登录
argocd login 10.193.36.41:30010 # admin/yourpass

# Git仓库监权
argocd repo add http://10.193.36.33:3000/dubhe/dubhe-charts --username dubhe --password yourpass

# 创建开发应用,自动同步
argocd app create dubhe-app-dev \
--sync-policy automated \
--repo http://10.193.36.33:3000/dubhe/dubhe-charts \
--revision develop \
--path dubhe-app \
--dest-namespace dubhe-dev \
--dest-server https://kubernetes.default.svc

# 创建测试应用,手动同步
argocd app create dubhe-app-test \
--sync-policy none \
--repo http://10.193.36.33:3000/dubhe/dubhe-charts \
--revision test \
--path dubhe-app \
--dest-namespace dubhe-test \
--dest-server https://kubernetes.default.svc

配置仿真环境

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# CLI方式登录
argocd login 10.193.36.51:30010 # admin/yourpass

# Git仓库监权
argocd repo add http://10.193.36.50:3000/dubhe/dubhe-charts --username dubhe --password yourpass

# 创建仿真应用,手动同步
argocd app create dubhe-app \
--sync-policy none \
--repo http://10.193.36.50:3000/dubhe/dubhe-charts \
--revision master \
--path dubhe-app \
--dest-namespace dubhe \
--dest-server https://kubernetes.default.svc