There was a problem authenticationg with your cluster. when i making gitlab and k8s cluster integration

6/24/2019

I create k8s cluster in aws by using kops

i wrote kubernetes cluster name : test.fuzes.io

api url : https://api.test.fuzes.io/api/v1

and i fill the CA Certificate field with result of

kubectl get secret {secrete_name} -o jsonpath="{['data']['ca\.crt']}" | base64 --decode

and finally i fill the Service Token field with result of

kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep gitlab-admin | awk '{print $1}')

but when i save changes, i got message

There was a problem authenticating with your cluster. Please ensure your CA Certificate and Token are valid.

and i can't install helm tiller with kubernetes error:404

I really don't know what i did wrong. please help me....

-- fuzes
gitlab-ci
kops
kubernetes

2 Answers

12/3/2019
kubectl cluster-info | \
    grep 'Kubernetes master' | \
    awk '/http/ {print $NF}' 

return https://control.pomazan.xyz/k8s/clusters/c-t7qr5

But use like https://80.211.195.192:6443 as API URL.

-- Богдан Помазан
Source: StackOverflow

6/25/2019

As @fuzes confirmed cluster re-creation can be a workaround for this issue.

This was also described on a GitLab Issues - Kubernetes authentication not consistent

In short: Using the same Kubernetes cluster integration configuration in multiple projects authenticates correctly on one but not the other.

Another suggestion to work around this by just setting CI Variables (KUBE_NAMESPACE and KUBECONFIG) instead of using our Kubernetes integration.

Hope this will be helpful for future references.

-- A_Suh
Source: StackOverflow