<p>I have two clusters</p>
<pre><code>NAME                   LOCATION        MASTER_VERSION  MASTER_IP      MACHINE_TYPE   NODE_VERSION    NUM_NODES  STATUS
cassandra-cluster      europe-west4-a  1.14.10-gke.36  xx.90.xx.31    n1-standard-1  1.14.10-gke.36  3          RUNNING
codingjediweb-cluster  europe-west4-a  1.14.10-gke.36  uu.90.uu.182  n1-standard-1  1.14.10-gke.36  2          RUNNING
manuchadha25@cloudshell:~ (copper-frame-262317)$
</code></pre>
<p>I want to run the following command on cassandra-cluster. How do I make cassandra-cluster my current context?</p>
<p>I am getting error</p>
<pre><code>CASS_USER=$(kubectl --cluster gke_copper-frame-262317_europe-west4-a_cassandra-cluster get secret cluster1-superuser -o json | jq -r '.data.username' | base64 --decode)kubectl
Error from server (NotFound): secrets &quot;cluster1-superuser&quot; not found
</code></pre>
<p>I tried this but it failed.</p>
<pre><code>manuchadha25@cloudshell:~ (copper-frame-262317)$ kubectl config use-context cassandra-cluster 
error: no context exists with the name: &quot;cassandra-cluster&quot;
</code></pre>

<p>You can work with multiple cluster setting the correct context, as mentioned <a href="https://kubernetes.io/docs/reference/kubectl/cheatsheet/#kubectl-context-and-configuration" rel="nofollow noreferrer">here</a>:</p>
<pre class="lang-yaml prettyprint-override"><code>kubectl config get-contexts                          # display list of contexts 
kubectl config current-context                       # display the current-context
kubectl config use-context my-cluster-name           # set the default context to my-cluster-name
</code></pre>
<p>When working with multilples cluster, you always need to know in what cluster you are performing commands, to make it easy,you can use <a href="https://github.com/jonmosco/kube-ps1" rel="nofollow noreferrer">this bash script</a> to show in you <code>$PS1</code> the current context and namespace.</p>
