<p>I have the following mysql.yaml file:</p>

<pre><code>apiVersion: v1beta3
kind: Pod
metadata:
  name: mysql
  labels:
    name: mysql
spec:
  containers:
    - resources:
        limits :
          cpu: 1
      image: mysql
      name: mysql
      env:
        - name: MYSQL_ROOT_PASSWORD
          # change this
          value: yourpassword
      ports:
        - containerPort: 3306
          name: mysql
</code></pre>

<p>Running <code>kubectl create -f mysql.yaml gives the error</code>:</p>

<pre><code>Error from server: error when creating "mysql.yaml": Pod "Unknown" is forbidden: no API token found for service account default/default, retry after the token is automatically created and added to the service account
</code></pre>

<p>I have a master and a node both centos 7.1.</p>

<p>To get your setup working, you can do the same thing local-up-cluster.sh is doing:</p>

<ol>
<li>Generate a signing key: </li>
</ol>

<p><code>openssl genrsa -out /tmp/serviceaccount.key 2048</code></p>

<ol start="2">
<li>Update <code>/etc/kubernetes/apiserver</code>:</li>
</ol>

<p><code>KUBE_API_ARGS="--service_account_key_file=/tmp/serviceaccount.key"</code></p>

<ol start="3">
<li>Update <code>/etc/kubernetes/controller-manager</code>:</li>
</ol>

<p><code>KUBE_CONTROLLER_MANAGER_ARGS="--service_account_private_key_file=/tmp/serviceaccount.key"</code></p>

<p>From <a href="https://github.com/kubernetes/kubernetes/issues/11355#issuecomment-127378691" rel="nofollow">https://github.com/kubernetes/kubernetes/issues/11355#issuecomment-127378691</a></p>
