Currently I am manually adding the cluster to ArgoCD server using admin credentials with ArgoCD CLI which is a bit risky as there are chances of exposing admin credentials. So want to simplify and automate this task by using ArgoCD API. I want to add a cluster to ArgoCD using ArgoCD API. Created a user with only view and create cluster permissions and planning to use the same user with API also.
Kindly throw some light on how to achieve this.
My main goal is to automate this process using a Jenkins pipeline.
Any help appreciated.
Thanks