<p>I have provisioned a kuberenetes cluster using this saltstack repo:</p>

<p><a href="https://github.com/valentin2105/Kubernetes-Saltstack" rel="nofollow noreferrer">https://github.com/valentin2105/Kubernetes-Saltstack</a></p>

<p>Now, I am not able to configure my kubectl CLI to access the cluster.
Is there a way to reset the credentials?
Is there a way to get configure properly the .kube/config with the right context, user, credentials and cluster name retrieving the info from the servers?</p>

<p>I am new to kubernetes, so maybe I am missing something here.</p>

bvcelari
<p>To be able to set your cluster you can do as follow:</p>

<pre><code>kubectl config set-cluster k8s-cluster --server=${CLUSTER} [--insecure-skip-tls-verify=true] 
</code></pre>

<ul>
<li>--server=${CLUSTER} where ${CLUSTER} is your cluster adress</li>
<li>--insecure-skip-tls-verify=true is used if you are using http over https</li>
</ul>

<p>Then you need to set your context ( depending on your kubernetes configuration </p>

<pre><code>kubectl config set-context k8s-context --cluster=k8s-cluster --namespace=${NS}
</code></pre>

<ul>
<li>--namespace=${NS} to specify the default namespace ( which skips the -n while typing kubectl commands for that namespace )</li>
</ul>

<p>If you are using a RBAC, you might need to specify your user and pass your connection token or your login password:</p>

<p>For this advanced usage you can see the docs <a href="https://kubernetes.io/docs/reference/kubectl/cheatsheet/#kubectl-context-and-configuration" rel="nofollow noreferrer">https://kubernetes.io/docs/reference/kubectl/cheatsheet/#kubectl-context-and-configuration</a></p>

<p>Now and finally to use your context you only have to:</p>

<pre><code>kubectl config use-context ${USER}
</code></pre>
