持续部署工具Argo CD - 安装

专心写bug

1.部署argocd服务

下载部署yaml文件

wget https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

修改部署文件,将内网搭建gitlab的地址绑定到deployment pod中

hostAliases:    
- ip: "34.92.55.211"
  hostnames:
    - "local.gitlab.com"

启动服务

kubectl create ns argocd
kubectl apply -n argocd -f ./install.yaml

2.暴露web端的入口

安装nginx-ingress-controller, 打开官方安装文档复制对应的安装命令,如Docker Desktop的命令

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.0.0/deploy/static/provider/cloud/deploy.yaml

安装完成查看暴露地址

$ kubectl get svc -n ingress-nginx
NAME                                 TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)                      AGE
ingress-nginx-controller             LoadBalancer   10.112.10.124   34.92.81.71   80:30885/TCP,443:30521/TCP   18m
ingress-nginx-controller-admission   ClusterIP      10.112.3.119    <none>        443/TCP                      18m

添加argocd ingress文件

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: argocd-server-ingress
  namespace: argocd
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt-prod
    kubernetes.io/ingress.class: nginx
    kubernetes.io/tls-acme: "true"
    nginx.ingress.kubernetes.io/ssl-passthrough: "true"
    # If you encounter a redirect loop or are getting a 307 response code
    # then you need to force the nginx ingress to connect to the backend using HTTPS.
    #
    nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
spec:
  rules:
  - host: argocd.local
    http:
      paths:
      - backend:
          serviceName: argocd-server
          servicePort: https
  tls:
  - hosts:
    - argocd.example.com
    secretName: argocd-secret # do not change, this is provided by Argo CD

一定注意服务商防火墙规则!!!!!晕了
修改本地hosts文件

34.92.81.71 argocd.local

通过访问 https://argocd.local 访问到UI控制台

3.安装argocd cil命令工具

查看安装文档
linux下如:

curl -sSL -o /usr/local/bin/argocd https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64
chmod +x /usr/local/bin/argocd

获得初始密码

kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d

登陆argocd服务

argocd login <ARGOCD_SERVER_HOST>

修改admin管理员密码

argocd account update-password

好了,下面你可以用更改后的密码去登陆web管理端了。

阅读 257
0 声望
0 粉丝
0 条评论
你知道吗?

0 声望
0 粉丝
宣传栏