Integration Kubernetes - The connection to the server localhost:8080 was refused

Hi,

since yesterday, i don’t sucess to call kubectl command in gitlab-ci.yml file. I have created my kubernetes cluster with GitLab. This is the pipeline description

  deploy on gke:
  stage: deploy_gke
  image: google/cloud-sdk
  script:
    - kubectl cluster-info dump
    - kubectl apply -f deployquarkusongkewithgitlab/target/kubernetes/kubernetes.yml

and the error is

$ kubectl cluster-info dump
The connection to the server localhost:8080 was refused - did you specify the right host or port? 

Do you have any idea ?

I already make this operation with no problem but this week i don’t know why i have this problem.

For information, problem resolved with the environment tag :slight_smile:

1 Like

Excellent, @JeanPhi.Baconnais! Thank you for coming back and updating us with a solution!

Let us know what else you need. :blush:

off course, the environment tag is like this

:whale2: deploy on gke:
stage: deploy_gke
image: google/cloud-sdk
environment: gke. < this line must be present

1 Like