<p>I was performing a practical where i was deploying a containerised sample application using kubernetes.</p>

<p>i was trying to run container on google cloud platform using kubernetes engine.But while deploying container using "kubectl run" command using google cloud shell.</p>

<p>its showing an error "<strong><em>error: failed to discover supported resources: Get <a href="https://35.240.145.231/apis/extensions/v1beta1" rel="nofollow noreferrer">https://35.240.145.231/apis/extensions/v1beta1</a>: x509: certificate signed by unknown authority</em></strong>".</p>

<p>From Error, i can recollect that its because of "SSL Certificate" not authorised.</p>

<p>I even exported the config file resides at "<strong><em>$HOME/.kube/config</em></strong>". but still getting the same error.</p>

<p>please anyone help me understand the real issue behind this.</p>

<p>Best,</p>

<p>Swapnil Pawar</p>

Swapnil978
<p>You may try following steps,</p>

<ol>
<li><p>List all the available clusters,</p>

<pre><code>$ gcloud container clusters list
</code></pre></li>
<li><p>Depending upon how you have configured the cluster, if the cluster location is configured for a specific zone then,</p>

<pre><code>$ gcloud container clusters get-credentials &lt;cluster_name&gt; --ZONE &lt;location&gt;
</code></pre>

<p>or if the location is configured for a region then,</p>

<pre><code>$ gcloud container clusters get-credentials &lt;cluster_name&gt; --REGION &lt;location&gt;
</code></pre></li>
</ol>

<p>The above command will update your kubectl config file <strong>$HOME/.kube/config</strong></p>

<ol start="3">
<li>Now, the tricky part.
If you have more than one cluster that you have configured, then your <strong>$HOME/.kube/config</strong> will have two or more entries. You can verify it by doing a <strong>cat</strong> command on the config file.</li>
</ol>

<p>To select a particular context/cluster, you need to run the following commands</p>

<pre><code>$ kubectl config get-contexts -o=name // will give you a list of available contexts

$ kubectl config use-context &lt;CONTEXT_NAME&gt;

$ kubectl config set-context &lt;CONTEXT_NAME&gt;
</code></pre>

<p>Now, you may run the kubectl run.</p>
