<p>I want to add a new cluster in addition to the default cluster on ArgoCD but when I add it, I get an error:<br />
FATA[0001] rpc error: code = Unknown desc = REST config invalid: the server has asked for the client to provide credentials<br />
I use the command <code>argocd cluster add cluster-name</code><br />
I download config file k8s of Rancher.<br />
Thanks!</p>

quoc9x
<p>I solved my problem but welcome other solutions from everyone :D<br />
First, create a secret with the following content:</p>
<pre><code>apiVersion: v1
kind: Secret
metadata:
  namespace: argocd # same namespace of argocd-app
  name: mycluster-secret
  labels:
    argocd.argoproj.io/secret-type: cluster
type: Opaque
stringData:
  name: cluster-name # Get from clusters - name field in config k8s file.
  server: https://mycluster.com # Get from clusters - name - cluster - server field in config k8s file.
  config: |
    {
      &quot;bearerToken&quot;: &quot;&lt;authentication token&gt;&quot;,
      &quot;tlsClientConfig&quot;: {
        &quot;insecure&quot;: false,
        &quot;caData&quot;: &quot;&lt;base64 encoded certificate&gt;&quot; 
      }
    }
</code></pre>
<p><code>bearerToken</code> - Get from users - user - token field in config k8s file.<br />
<code>caData</code> -  Get from clusters - name - cluster - certificate-authority-data field in config k8s file.<br />
Then, apply this yaml file and the new cluster will be automatically added to ArgoCD.<br />
I found the solution on github:<br />
<a href="https://gist.github.com/janeczku/b16154194f7f03f772645303af8e9f80" rel="noreferrer">https://gist.github.com/janeczku/b16154194f7f03f772645303af8e9f80</a></p>
