Score:0

Why am I getting 'Unable to connect to the server: context deadline exceeded' error when creating GKE job?

in flag

am trying to create a GKE job by following the instructions in the official documentation.

I am doing it though via Cloud Shell. I have created the yaml file, however when I run the command:

kubectl apply -f config.yaml

I am getting the following error:

Unable to connect to the server: context deadline exceeded

What is the problem and what exactly is a context deadline?

I have made sure to enable the GKE API.

I wondered whether I needed to create a cluster first before submitting the job, but the tutorial makes no mention of creating a cluster.

Fady avatar
bd flag
Yes you need to create a cluster and you need to use this [gcloud command](https://cloud.google.com/sdk/gcloud/reference/container/clusters/get-credentials) to have access to the control plane (will create the kubeconfig file that kubectl tool needs to reach the endpoint). Curious which tutorial you are implementing ?
2bon2b avatar
in flag
thanks @Fady it was from the gke documentation: https://cloud.google.com/kubernetes-engine/docs/how-to/jobs
Alex G avatar
ar flag
You might have missed it, but it was stated in the [Overview](https://cloud.google.com/kubernetes-engine/docs/how-to/deploying-workloads-overview) of the documentation ¨These controller objects represent the applications, daemons, and batch jobs running on your clusters.¨
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.