title: k8s - how to project service account token into pod
body: <p>I am trying to project the serviceAccount token into my pod as described in this k8s doc - <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#service-account-token-volume-projection" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#service-account-token-volume-projection</a>.</p>
  
  <p>I create a service account using below command</p>
  
  <pre><code>kubectl create sa acct
  </code></pre>
  
  <p>Then I create the pod</p>
  
  <pre><code>kind: Pod
  apiVersion: v1
  metadata:
    name: nginx
  spec:
    containers:
    - image: nginx
      name: nginx
      volumeMounts:
      - mountPath: /var/run/secrets/tokens
        name: vault-token
    serviceAccountName: acct
    volumes:
    - name: vault-token
      projected:
        sources:
        - serviceAccountToken:
            path: vault-token
            expirationSeconds: 7200
  </code></pre>
  
  <p>It fails due to - <code>MountVolume.SetUp failed for volume "vault-token" : failed to fetch token: the server could not find the requested resource</code></p>
  
  <pre><code>Events:
    Type     Reason       Age                   From               Message
    ----     ------       ----                  ----               -------
    Normal   Scheduled    5m15s                 default-scheduler  Successfully assigned default/nginx to minikube
    Warning  FailedMount  65s (x10 over 5m15s)  kubelet, minikube  MountVolume.SetUp failed for volume "vault-token" : failed to fetch token: the server could not find the requested resource
  </code></pre>
  
  <p>My minikube version: v0.33.1</p>
  
  <p>kubectl version : 1.13</p>
  
  <p><strong>Question:</strong></p>
  
  <ul>
  <li>What am i doing wrong here?</li>
  </ul>