3.2 ArgoCD部署
ArgoCD部署官网:https://argo-cd.readthedocs.io/en/stable/getting_started/
-
ArgoCD有两种部署方式:多租户部署和核心化部署:
-
多租户
-
常用于多个应用程序开发团队提供服务,并由平台团队维护的场景;
-
支持用户通过WEB UI或CLI访问;
-
支持集群级部署和名称空间级两种安装机制:
配置文件install.yaml:具有集群管理员访问权限的集群级安装;
配置文件namespace-install.yaml:仅需要名称空间级别的安装;
-
-
核心化部署
- 安装的组件较小更易于维护,不包含API Server和UI,且不提供高可用机制;
- 仅适用于独立使用ArgoCD且不需要多租户特性的集群管理员
- 用户要通过kubernetes的访问权限来管理ArgoCD
-
-
在kubernetes集群上部署ArgoCD
-
部署的环境说明
部署的是多租户集群级别的ArgoCD;
-
部署在ArgoCD名称空间
kubectl create namespace argocd kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
-
在管理节点上安装ArgoCD CLI
wget https://github.com/argoproj/argo-cd/releases/download/v2.5.6/argocd-linux-amd64 cp argocd-linux-amd64 /usr/local/bin/argocd chmod +x /usr/local/bin/argocd
-
将argocd的web UI利用istio的virtualservice暴露集群外
apiVersion: networking.istio.io/v1beta1 kind: Gateway metadata: name: argocd-dashboard-gateway namespace: istio-system spec: selector: app: istio-ingressgateway servers: - hosts: - "argocd.icloud2native.com" port: number: 80 name: http protocol: HTTP tls: httpsRedirect: true - hosts: - "argocd.icloud2native.com" port: number: 443 name: https protocol: HTTPS tls: mode: PASSTHROUGH --- apiVersion: networking.istio.io/v1beta1 kind: VirtualService metadata: name: argocd-dashboard-virtualservice namespace: argocd spec: hosts: - "argocd.icloud2native.com" gateways: - istio-system/argocd-dashboard-gateway tls: - match: - port: 443 sniHosts: - argocd.icloud2native.com route: - destination: host: argocd-server port: number: 443
浏览器访问argocd.icloud2native.com:
-
使用ArgoCD CLI 或Web UI完成登录
默认密码:
# kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d; echo bZ6SKRV66melE47t
登录:
argocd login argocd.icloud2native.com
修改密码(admin/adminadmin)
argocd account update-password
-