helm installation in GitLab integration responses 401

1/25/2019

I want to install Helm in Gitlab's k8s integration with reference to https://docs.gitlab.com/ee/user/project/clusters/#adding-an-existing-kubernetes-cluster

but responses is 401 when I clicked Helm Tiler's Install button.

My process is below.

  1. deploy k8s in gcp
  2. to get API_URL run this
$ kubectl cluster-info | grep 'Kubernetes master' | awk '/http/ {print $NF}'
https://xx.xxx.xx.xx  // set this `API_URL` 
  1. create gitlab's service account
$ kubectl create -f - <<EOF
   apiVersion: v1
   kind: ServiceAccount
   metadata:
     name: gitlab
     namespace: default
EOF

$ kubectl create -f - <<EOF
 kind: ClusterRoleBinding
 apiVersion: rbac.authorization.k8s.io/v1
 metadata:
   name: gitlab-cluster-admin
 subjects:
 - kind: ServiceAccount
   name: gitlab
   namespace: default
 roleRef:
   kind: ClusterRole
   name: cluster-admin
   apiGroup: rbac.authorization.k8s.io
EOF

$ kubectl get secrets
default-token-xxxx   kubernetes.io/service-account-token   3      25d
gitlab-token-xxxx    kubernetes.io/service-account-token   3      21h
tls-sample            kubernetes.io/tls                     2      24d

so, I choice gitlab-token-xxxx.

  1. to get CA Certificate run this
$ kubectl get secret gitlab-token-xxxx -o jsonpath="{['data']['ca\.crt']}" | base64 --decode
-----BEGIN CERTIFICATE-----
MIIDDDCCAfSgAwIBAgIRAJ0S/Fsf1dDFRZP9TCnby60wDQYJKoZIhvcNAQELBQAw
......
.....
FZ1tsRI3EbTNuKsyKtvjwg==
-----END CERTIFICATE-----

I used this as CA Certificate

  1. to get Token run this
$ kubectl get secret <secret name> -o jsonpath="{['data']['token']}" | base64 --decode
eyJhbGciOi.........

I used this as Token

  1. I filled out in this page.

Please teach me correct way!

-- もりもりこちゃん
gitlab
kubernetes

1 Answer

1/28/2019

Thank you for seeing this question.

I installed it without displaying an error by the following method! Thank you very much!

kubectl create clusterrolebinding gitlab-internal-cluster-rule --clusterrole=cluster-admin --serviceaccount=gitlab-managed-apps:default
-- もりもりこちゃん
Source: StackOverflow