<p>I am trying to create a service account with a known, fixed token used by Jenkins to deploy stuff into kubernetes. I manage to create the token all right with the following yaml: </p>

<pre><code>apiVersion: v1
kind: Secret
metadata:
  name: integration-secret
  annotations:
    kubernetes.io/service-account.name: integration
type: kubernetes.io/service-account-token
data:
  token: YXNkCg== # yes this base64
</code></pre>

<p>Then I've attached the secret to 'integration' user and it's visible:</p>

<pre><code>-&gt; kubectl describe sa integration
Name:       integration
Namespace:  default
Labels:     &lt;none&gt;
Annotations:    &lt;none&gt;

Mountable secrets:  integration-secret
                    integration-token-283k9

Tokens:             integration-secret
                    integration-token-283k9

Image pull secrets: &lt;none&gt;
</code></pre>

<p>But the login fails. If i remove the data and data.token, the token get auto-created and login works. Is there something I'm missing? My goal is to have fixed token for CI so that I won't have to update it everywhere when creating a project (don't worry this is just dev environments). Is it possible for example to define username/password for service accounts for API access?</p>

<blockquote>
  <p>Is it possible for example to define username/password for service accounts for API access?</p>
</blockquote>

<p>No, the tokens must be valid JWTs, signed by the service account token signing key.</p>
