Generate argocd management user token

Log in to the dashboard, settings–>Accounts–>admin–>Generate New After generating, please record the token information, similar to the following:

1
fyJhbGciOiJ3UzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI2OWI0M2M0Mi01MmZiLTRlZmItODIxOC0yOWU3NGM5MWI0NDIiLCJpYXQiOjE1OTUzMTEx3zQsImlzcyI6ImFyZ29jZCIsIm5iZiI6MTU5NTMxMTE3NCwic3ViIjoib3duZXIifQ.9u4XzArEeaz7G2Q2TWusnTkakEmq9BYDAUHr3dC6wG5

Configure argocd config

For argocd with https authentication enabled, it is useless when adding a cluster. You need to log in to the server-side POD for configuration, as follows:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# cat ~/.argocd/config
contexts:
- name: argocd-server.argocd
server: qacd.test.cn
user: argocd-server.argocd
current-context: argocd-server.argocd
servers:
- grpc-web-root-path: ""
insecure: true
server: qacd.test.cn
users:
- auth-token: xxxxxx #Here is the first step to generate token information
name: argocd-server.argocd

Configure kubeconfig

The specific configuration is omitted here. Please refer to previous documents. The premise is that you can access the cluster and are a cluster administrator. Here, CONTEXT is configured as idc-bj-k8s

Add a cluster

1
# argocd --grpc-web cluster add idc-bj-k8s --kubeconfig ~/.kube/config INFO[0000] ServiceAccount "argocd-manager" already exists in namespace "kube-system" INFO[0000] ClusterRole "argocd-manager-role" updated INFO[0000] ClusterRoleBinding "argocd-manager-role-binding" updated Cluster ' https://172.16.16.250:8443' added # argocd --grpc-web cluster list SERVER NAME VERSION STATUS MESSAGE https://172.16.16.250:8443 idc-bj-k8s 1.14 Successful https://kubernetes.default.svc 1.14 Successful

At present, the Beijing IDC cluster has been added to argocd, and applications can be deployed to the cluster later

Delete cluster

1
2
3
4
# argocd --grpc-web cluster rm https://172.16.16.250:8443
# argocd --grpc-web cluster list
SERVER NAME VERSION STATUS MESSAGE
https://kubernetes.default.svc 1.14 Successful