<p>I'm getting <code>Unable to connect to the server: dial tcp &lt;IP&gt; i/o timeout</code> when trying to run <code>kubectl get pods</code> when connected to my cluster in google shell. This  started out of the blue without me doing any changes to my cluster setup. </p>

<pre><code>gcloud beta container clusters create tia-test-cluster \
    --create-subnetwork name=my-cluster\
    --enable-ip-alias \
    --enable-private-nodes \
    --master-ipv4-cidr &lt;IP&gt; \
    --enable-master-authorized-networks \
    --master-authorized-networks &lt;IP&gt; \
    --no-enable-basic-auth \
    --no-issue-client-certificate \
    --cluster-version=1.11.2-gke.18 \
    --region=europe-north1 \
    --metadata disable-legacy-endpoints=true \
    --enable-stackdriver-kubernetes \
    --enable-autoupgrade
</code></pre>

<p>This is the current cluster-config. 
I've run <code>gcloud container clusters get-credentials my-cluster --zone europe-north1-a --project &lt;my project&gt;</code> before doing this aswell.</p>

<p>I also noticed that my compute instances have lost their external IPs. In our staging environment, everything works as it should based on the same config.</p>

<p>Any pointers would be greatly appreciated.</p>

Coss
<p>From what I can see of what you've posted you've turned on master authorized networks for the network <code>&lt;IP&gt;</code>.</p>

<p>If the IP address of the Google Cloud Shell ever changes that is the exact error that you would expect.</p>

<p>As per <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/private-clusters#cloud_shell" rel="nofollow noreferrer">https://cloud.google.com/kubernetes-engine/docs/how-to/private-clusters#cloud_shell</a>: you need to update the allowed IP address.</p>

<pre><code>gcloud container clusters update tia-test-cluster \
    --region europe-north1 \
    --enable-master-authorized-networks \
    --master-authorized-networks [EXISTING_AUTH_NETS],[SHELL_IP]/32
</code></pre>
