#科技# #运维#
Argo CD是Kubernetes的声明性GitOps连续交付工具。
1. Install Argo CD
完整版安装(包含后台管理 ui)
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
无 argocd ui 安装
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-c
2. 下载安装 Argo CD CLI
在可访问 k8s 的 linux 机器安装 cli
curl -sSL -o argocd-linux-amd64 https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64
sudo install -m 555 argocd-linux-amd64 /usr/local/bin/argocd
rm argocd-linux-amd64
3. 访问Argo CD API Server
kubectl patch svc argocd-server -n argocd -p '{"spec": {"type": "LoadBalancer"}}'
kubectl port-forward svc/argocd-server -n argocd 8080:443
前提必须安装 nginx ingress
ingress.yml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: argocd-server-ingress
namespace: argocd
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
nginx.ingress.kubernetes.io/ssl-passthrough: "true"
spec:
rules:
- host: argocd.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: argocd-server
port:
name: https
kubectl apply -f ingress.yml
4. 使用CLI 登录 argocd
$ argocd admin initial-password -n argocd
执行结果返回临时密码:
6Vv8LFxzid2RHsWo
$argocd login localhost:8080
WARNING: server certificate had error: x509: certificate is valid for localhost, argocd-server, argocd-server.argocd, argocd-server.argocd.svc, argocd-server.argocd.svc.cluster.local,Proceed insecurely (y/n)? y
Username: admin
Password:
'admin:login' logged in successfully
Context 'afa4387' updated
argocd account update-password
5. Register A Cluster To Deploy Apps To 注册 k8s 集群
获取集群
kubectl config get-contexts -o name
argocd cluster add 集群
安装完后,就可创建 app,关联 git
页面更新:2024-03-07
本站资料均由网友自行发布提供,仅用于学习交流。如有版权问题,请与我联系,QQ:4156828
© CopyRight 2020-2024 All Rights Reserved. Powered By 71396.com 闽ICP备11008920号-4
闽公网安备35020302034903号