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.
API_URL
run this$ kubectl cluster-info | grep 'Kubernetes master' | awk '/http/ {print $NF}'
https://xx.xxx.xx.xx // set this `API_URL`
$ 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
.
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
Token
run this$ kubectl get secret <secret name> -o jsonpath="{['data']['token']}" | base64 --decode
eyJhbGciOi.........
I used this as Token
Please teach me correct way!
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