murilo
murilo

Reputation: 41

kubectl get nodes time out in Kuebrnetes Google cloud Engine

I am learnig google kubernetes engine . I created a kubernetes cluster .

then I typed - kubectl get nodes ,

and it gave me an error of timeout - E0224 21:30:30.905852 1942 memcache.go:265] couldn't get current server API group list: Get "https://34.31.239.92/api?timeout=32s": dial tcp 34.31.239.92:443: i/o timeout E0224 21:31:00.906742 1942 memcache.go:265] couldn't get current server API group list: Get "https://34.31.239.92/api?timeout=32s": dial tcp 34.31.239.92:443: i/o timeout E0224 21:31:30.908240 1942 memcache.go:265] couldn't get current server API group list: Get "https://34.31.239.92/api?timeout=32s": dial tcp 34.31.239.92:443: i/o timeout E0224 21:32:00.908807 1942 memcache.go:265] couldn't get current server API group list: Get "https://34.31.239.92/api?timeout=32s": dial tcp 34.31.239.92:443: i/o timeout
E0224 21:32:30.909704    1942 memcache.go:265] couldn't get current server API group list: Get "https://34.31.239.92/api?timeout=32s": dial tcp 34.31.239.92:443: i/o timeout

Upvotes: 0

Views: 540

Answers (1)

Lherben G
Lherben G

Reputation: 373

This issue manifests when kubectl encounters difficulties in communicating with the cluster control plane.

To rectify this issue, confirm the context where the cluster is configured.

  1. Go to $HOME/.kube/config or run the command kubectl config view to verify the config file contains the cluster context and the external IP address of the control plane.

  2. Set the cluster credentials:

gcloud container clusters get-credentials CLUSTER_NAME \
    --location=COMPUTE_LOCATION \
    --project=PROJECT_ID

Replace the following:

  • CLUSTER_NAME: the name of your cluster.
  • COMPUTE_LOCATION: the Compute Engine location.
  • PROJECT_ID: ID of the project in which the GKE cluster was created.
  1. If the cluster is a private GKE cluster, then ensure that the outgoing IP of the machine you are attempting to connect from is included in the list of existing authorized networks. You can find your existing authorized networks in the console or by running the following command:
gcloud container clusters describe CLUSTER_NAME \
    --location=COMPUTE_LOCATION \
    --project=PROJECT_ID \
    --format "flattened(masterAuthorizedNetworksConfig.cidrBlocks[])"

You may also want to refer to this article addressing timeouts with the kubectl command.

Upvotes: 0

Related Questions