Unable to access kubernetes via google cloud platform console

9/22/2018

I am trying to access kubernetes by using the command 'kubectl get pods' on the google cloud platform console and it is throwing the following error,

Unable to connect to the server: dial tcp 35.224.148.100:443: i/o timeout

Please suggest a fix for the same !

-- Srishti Bhargava
google-kubernetes-engine

2 Answers

12/6/2018

Did you use the parameter --enable-private-nodes?

You must to specify authorized list of CIDR: --enable-master-authorized-networks --master-authorized-networks=NETWORK,[NETWORK,…]

Example that autorize all ips:

gcloud container clusters create [cluster-name] \
--zone us-central1-a \
--create-subnetwork name=[subnet-name] \
--enable-ip-alias \
--enable-private-nodes \
--master-ipv4-cidr 172.16.0.0/28 \
--enable-master-authorized-networks \
--master-authorized-networks 0.0.0.0/0
--enable-basic-auth \
--issue-client-certificate \
--machine-type=n1-standard-1 \
--num-nodes=1 \
--node-locations us-central1-a \
--enable-autoscaling \
--max-nodes=5
-- Fabio Silva Soares
Source: StackOverflow

9/23/2018

You will need to generate a kubeconfig file (prior running ‘kubectl get pods’) in your environment.by running the following command:

gcloud container clusters get-credentials [CLUSTER_NAME]

Similar error was resolved by using the above command

-- Ariv
Source: StackOverflow