<p>I have an environment with multiple ServiceAccounts, and pod with access to Kubernetes api using kubernetes python sdk. Which account does the function load_incluster_config() pick up. Is there any way I can specify an account to be picked?
I have seen my pod to always pick the &quot;default&quot; named ServiceAccount.</p>

<p>As per the code <a href="https://github.com/kubernetes-client/python-base/blob/master/config/incluster_config.py" rel="noreferrer">here</a> it picks up the token from <code>/var/run/secrets/kubernetes.io/serviceaccount/token</code> path inside the pod. So what you need to do is just have a different service account in the pod spec</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: my-pod
spec:
  serviceAccountName: build-robot
</code></pre>
<p>Then it will pick up the service account <code>build-robot</code>. Also note you need to configure role and rolebinding for this service account.</p>
