Gitlab auto deploy job fails with i/o timeout to cluster api endpoint

1/10/2018

automatic deploy of my gitlab hello-world app fails with a timeout. It seems it cannot connect to cluster api endpoint. Full console output is available here

Using KUBE_CA_PEM...
Cluster "gitlab-deploy" set.
User "gitlab-deploy" set.
Context "gitlab-deploy" created.
Switched to context "gitlab-deploy".

Unable to connect to the server: dial tcp xxx.xxx.xx.xxx:80: i/o timeout
ERROR: Job failed: exit code 1

Any idea? thanks!

-- btb84
gitlab-ci-runner
google-cloud-platform
google-kubernetes-engine

1 Answer

1/17/2018

Please run gcloud config list to ensure you are using the correct cluster.

Use the following commands shown below to ensure that you set the correct context before deploying your application. You can find further information in the documentation link.

$ gcloud config set container/cluster <your-cluster-name> $ gcloud container clusters get-credentials <your-cluster-name>
$ gcloud config set compute/zone <cluster-zone>
$ gcloud container clusters get-credentials
$ gcloud auth application-default login

If above commands give you errors please post the output to help troubleshoot further. Ensure you don't include any security sensitive information.

I would also like to ask you to provide the steps/commands you are using to create the deployment. The console link that you provide is not available.

-- JMD
Source: StackOverflow