fuzes
fuzes

Reputation: 2057

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

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....

Upvotes: 4

Views: 5457

Answers (4)

sri Badam
sri Badam

Reputation: 11

  1. Adjust the api URL to https://api.test.fuzes.io:6443 (6443 is the default port kube master listens on for the api-server , if you have it edited then use the custom one ) use this command to validate the port "kubectl cluster-info | grep 'Kubernetes master' | awk '/http/ {print $NF}' "

This command will print the api-server url , you can add it directly in the asked column

  1. Next , for your CA certificate ensure you copy all the command output along with BEGIN CERTIFICATE and END CERTIFICATE

with this you will be able to add the cluster

Upvotes: 1

StevenXue
StevenXue

Reputation: 21

  {"kind": "Status",
  "apiVersion": "v1",
  "metadata": {

  },
  "status": "Failure",
  "message": "forbidden: User \"system:anonymous\" cannot get path \"/\"",
  "reason": "Forbidden",
  "details": {

  },
  "code": 403
}

This question is appeared in many people's environment, finally can be resolved!!!

Upvotes: -3

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.

Upvotes: 0

A_Suh
A_Suh

Reputation: 3946

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.

Upvotes: 6

Related Questions