<p>I've followed <a href="https://kubernetes.io/docs/getting-started-guides/kops/" rel="nofollow noreferrer">these instructions for setting up a kubernetes cluster on AWS using kops.</a> </p>

<p>I've then been able to run <code>kubectl create -f ...</code> commands to get an application running. </p>

<p>I can access (what I presume is) the API at <code>https://api.useast1.dev.example.com/</code>, in my browser. </p>

<p>This prompts for authentication, the credentials of which I get by running </p>

<pre><code>kubectl config view --minify
</code></pre>

<p>as per <a href="https://github.com/kubernetes/kops/blob/master/docs/addons.md" rel="nofollow noreferrer">these instructions from the kops github</a>. </p>

<p>The API then shows: </p>

<pre><code>{
  "paths": [
    "/apis",
    "/apis/",
    "/apis/apiextensions.k8s.io",
    "/apis/apiextensions.k8s.io/v1beta1",
    "/healthz",
    "/healthz/etcd",
    "/healthz/ping",
    "/healthz/poststarthook/generic-apiserver-start-informers",
    "/healthz/poststarthook/start-apiextensions-controllers",
    "/healthz/poststarthook/start-apiextensions-informers",
    "/metrics",
    "/swagger-2.0.0.json",
    "/swagger-2.0.0.pb-v1",
    "/swagger-2.0.0.pb-v1.gz",
    "/swagger.json",
    "/swaggerapi",
    "/version"
  ]
}
</code></pre>

<p>Now I'm trying to setup GitLab CI, which requests an API endpoint and a Service Token. </p>

<p>I created a service token using <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/" rel="nofollow noreferrer">these instructions from kubernetes</a>, though I haven't done the imagePullSecret part. </p>

<p>However, when I try to anything on the kubernetes cluster (Install Helm Tiller for example), it gives me: <code>Kubernetes error: Unauthorized</code>. I assume this is because I haven't given it any credentials to access that API. </p>

<p>How do I set up kubernetes cluster such that Gitlab doesn't require those credentials to access the API? </p>

<p>Ok, there was a bit of confusion about what the token is. </p>

<p>Best way to retrieve the token is: </p>

<pre><code>kubectl get secrets
</code></pre>

<p>To list the secrets</p>

<p>Then</p>

<pre><code>kubectl describe secret SECRET_NAME
</code></pre>

<p>To retrieve the token. </p>
