<p>we need that each pod which use our binary will have the ability to read a specific <code>config map</code></p>

<p>we use for that  the Go API to read the config map.</p>

<p><a href="https://github.com/kubernetes/client-go" rel="nofollow noreferrer">https://github.com/kubernetes/client-go</a> </p>

<p>The tricky part here that some of the pods have the following config  <code>automountServiceAccountToken: false</code> (unfortunately we cannot change it :(  ) </p>

<p>Hence Im getting the following error:</p>

<pre><code> open /var/run/secrets/kubernetes.io/serviceaccount/token:no such file or directory
</code></pre>

<p>Any idea how to avoid this ? </p>

<p>is there is other solution how to provide specific env variable to be available on all the pods and all the namespace ? </p>

<p><a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#use-the-default-service-account-to-access-the-api-server" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#use-the-default-service-account-to-access-the-api-server</a></p>

Jenny M
<p>You'll need to create the token manually:</p>

<pre><code>apiVersion: v1
kind: Secret
metadata:
  name: build-robot-secret
  annotations:
    kubernetes.io/service-account.name: default # I assume you use the default service account
type: kubernetes.io/service-account-token
</code></pre>

<p>Then mount this secret as a file into the pod:</p>

<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: mypod
spec:
  containers:
  - name: mypod
    image: redis
    volumeMounts:
    - name: foo
      mountPath: "/var/run/secrets/kubernetes.io/serviceaccount"
  volumes:
  - name: foo
    secret:
      secretName: build-robot-secret
</code></pre>
