<p>I want to install Helm in Gitlab's k8s integration with reference to <a href="https://docs.gitlab.com/ee/user/project/clusters/#adding-an-existing-kubernetes-cluster" rel="nofollow noreferrer">https://docs.gitlab.com/ee/user/project/clusters/#adding-an-existing-kubernetes-cluster</a></p>

<p>but responses is 401 when I clicked Helm Tiler's <code>Install</code> button.</p>

<p>My process is below.</p>

<ol>
<li>deploy k8s in gcp</li>
<li>to get <code>API_URL</code> run this </li>
</ol>

<pre><code>$ kubectl cluster-info | grep 'Kubernetes master' | awk '/http/ {print $NF}'
https://xx.xxx.xx.xx  // set this `API_URL` 
</code></pre>

<ol start="3">
<li>create gitlab's service account</li>
</ol>

<pre><code>$ kubectl create -f - &lt;&lt;EOF
   apiVersion: v1
   kind: ServiceAccount
   metadata:
     name: gitlab
     namespace: default
EOF

$ kubectl create -f - &lt;&lt;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
</code></pre>

<p>so, I choice <code>gitlab-token-xxxx</code>.</p>

<ol start="4">
<li>to get <code>CA Certificate</code> run this </li>
</ol>

<pre><code>$ kubectl get secret gitlab-token-xxxx -o jsonpath="{['data']['ca\.crt']}" | base64 --decode
-----BEGIN CERTIFICATE-----
MIIDDDCCAfSgAwIBAgIRAJ0S/Fsf1dDFRZP9TCnby60wDQYJKoZIhvcNAQELBQAw
......
.....
FZ1tsRI3EbTNuKsyKtvjwg==
-----END CERTIFICATE-----
</code></pre>

<p>I used this as <code>CA Certificate</code></p>

<ol start="5">
<li>to get <code>Token</code> run this </li>
</ol>

<pre><code>$ kubectl get secret &lt;secret name&gt; -o jsonpath="{['data']['token']}" | base64 --decode
eyJhbGciOi.........
</code></pre>

<p>I used this as <code>Token</code></p>

<ol start="6">
<li>I filled out in <a href="https://i.stack.imgur.com/2DTFw.png" rel="nofollow noreferrer">this page.</a></li>
</ol>

<p>Please teach me correct way!</p>

もりもりこちゃん
<p>Thank you for seeing this question.</p>

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

<pre><code>kubectl create clusterrolebinding gitlab-internal-cluster-rule --clusterrole=cluster-admin --serviceaccount=gitlab-managed-apps:default
</code></pre>
