Bootstrap FreeKB - ArgoCD - List trusted certificates using the CLI
ArgoCD - List trusted certificates using the CLI

Updated:   |  ArgoCD articles

This assumes:

The argocd cert list command can be used to list the certificates that ArgoCD has been configured to trust.

~]$ argocd cert list
HOSTNAME                    TYPE   SUBTYPE              INFO
[ssh.github.com]:443        ssh    ecdsa-sha2-nistp256  SHA256:p2QAMXNICABCDFzIOttrVc98/R1BUFWu3/LiyKgUfQM
[ssh.github.com]:443        ssh    ssh-ed25519          SHA256:+DiY3wvvV6CABCDFzZisF/zLDA0zPMSvHdkr4UvCOqU
[ssh.github.com]:443        ssh    ssh-rsa              SHA256:uNiVztksCABCDFz0u9e8BujQXVUpKZIDTMczCvj3tDs
github.com                  ssh    ssh-rsa              SHA256:uNiVztksCCABCDFz0u9e8BujQXVUpKZIDTMczCvjD2s
github.com                  ssh    ssh-ed25519          SHA256:+DiY3wvvV6TCABCDFzisF/zLDA0zPMSvHdkr4UvCOqU
github.com                  ssh    ecdsa-sha2-nistp256  SHA256:p2QAMXNICCABCDFzOttrVc98/R1BUFWu3/LiyKgUfQM
gitlab.com                  ssh    ecdsa-sha2-nistp256  SHA256:HbW3g8zUjNCABCDFz2Bq1x8xdGUrliXFzSnUwsdfsad
gitlab.com                  ssh    ssh-ed25519          SHA256:eUXGGm1YGsMCABCDFz6JOJdOGHPem5gQp4taiCfCLB8
gitlab.com                  ssh    ssh-rsa              SHA256:ROQFvPThCABCDFzWLoL9tq9I9zJ42fK4XywyRtbOz/Q

 

Or on the Kubernetes or OpenShift cluster that ArgoCD is in the kubectl (Kubernetes) or oc (OpenShift) exec command can be used to run the argocd cluster list command in the ArgoCD server pod. It is noteworthy that to get this working I had to update the server deployment removing the security context constraints and then create a service account with the privileged security context constraint and updating the server deployment to run using the privileged service account. It's important to include the --config /home/argocd/.config option because if you do not include this option you'll probably get mkdir ./config: permission denied because the user in the pod does not have permission to create files or directories in the / (root) directory.

~]$ oc get pods --namespace openshift-gitops
NAME                                                          READY   STATUS    RESTARTS         AGE
openshift-gitops-server-7dddf67589-g5nzq                      1/1     Running   0                6d8h

~]$ oc exec openshift-gitops-server-7dddf67589-g5nzq -- argocd login --username admin --password ***** openshift-gitops-server-openshift-gitops.apps.openshift.example.com:443 --insecure --grpc-web --config /home/argocd/.config
'admin:login' logged in successfully

~]$ oc exec openshift-gitops-server-7dddf67589-g5nzq -- argocd cert list --server openshift-gitops-server-openshift-gitops.apps.openshift.example.com:443 --insecure --grpc-web --config /home/argocd/.config
HOSTNAME                    TYPE   SUBTYPE              INFO
[ssh.github.com]:443        ssh    ecdsa-sha2-nistp256  SHA256:p2QAMXNICABCDFzIOttrVc98/R1BUFWu3/LiyKgUfQM
[ssh.github.com]:443        ssh    ssh-ed25519          SHA256:+DiY3wvvV6CABCDFzZisF/zLDA0zPMSvHdkr4UvCOqU
[ssh.github.com]:443        ssh    ssh-rsa              SHA256:uNiVztksCABCDFz0u9e8BujQXVUpKZIDTMczCvj3tDs
github.com                  ssh    ssh-rsa              SHA256:uNiVztksCCABCDFz0u9e8BujQXVUpKZIDTMczCvjD2s
github.com                  ssh    ssh-ed25519          SHA256:+DiY3wvvV6TCABCDFzisF/zLDA0zPMSvHdkr4UvCOqU
github.com                  ssh    ecdsa-sha2-nistp256  SHA256:p2QAMXNICCABCDFzOttrVc98/R1BUFWu3/LiyKgUfQM
gitlab.com                  ssh    ecdsa-sha2-nistp256  SHA256:HbW3g8zUjNCABCDFz2Bq1x8xdGUrliXFzSnUwsdfsad
gitlab.com                  ssh    ssh-ed25519          SHA256:eUXGGm1YGsMCABCDFz6JOJdOGHPem5gQp4taiCfCLB8
gitlab.com                  ssh    ssh-rsa              SHA256:ROQFvPThCABCDFzWLoL9tq9I9zJ42fK4XywyRtbOz/Q

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 502683 in the box below so that we can be sure you are a human.