Srishti Bhargava
Srishti Bhargava

Reputation: 1

Unable to access kubernetes via google cloud platform console

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 !

Upvotes: 0

Views: 1332

Answers (3)

Ashikur Rahman Rashid
Ashikur Rahman Rashid

Reputation: 182

Use below command,, hope it will work 100%.

gcloud container clusters get-credentials [cluster name] --zone [zone]

Upvotes: 0

Fabio Silva Soares
Fabio Silva Soares

Reputation: 121

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

Upvotes: 2

Ariv
Ariv

Reputation: 183

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

Upvotes: 1

Related Questions