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 "default" named ServiceAccount.
How can I specify ServiceAccount to be picked up by config.load_incluster_config() from kubernetes python sdk
1.4k views Asked by Rugved Mahamune At
1
There are 1 answers
Related Questions in KUBERNETES
- How to know a Pod's own IP address from inside a container in the Pod?
- Who will decide the "specified number of pods" for replication controller in kubernetes?
- Access other containers of a pod in Kubernetes
- Kubernetes cluster using Vagrant not working after restart
- kubectl not installed with gcloud SDK
- How do I access the Kubernetes api from within a pod container?
- Exposing several services with Vagrant and Kubernetes on my own server
- Does Kubernetes provision new VMs for pods on my cloud platform?
- Any suggestion for running Aerospike on Kubernetes on CoreOS on GCE?
- Kubernetes - kubectl exec bash - session drop and line width
- Google Container Engine (GKE): "Hello Wordpress" tutorial not working (ERR_CONNECTION_REFUSED)
- Kubernetes Pod Creation Speed
- How can i set max count of pods for replication-controller per node?
- Is there a way to tell kubernetes to update your containers?
- Postgres with Kubernetes and persistentDisk
Related Questions in OPENSHIFT
- OpenShift Pyramid logging to file
- com.mongodb.MongoException: not authorized for insert on myworld.Users
- Openshift context path
- error while establishing connection with node.js server OpenShift
- Cannot port forward for app
- OpenShift - Tomcat 7 (JBoss EWS 2.0) + PostgreSQL 9.2 + Hibernate 4.3.5
- running node.js sails app on openshift
- Can't get Pandas to install with OpenShift
- Cartridge Python2.7 on OPenshift
- OpenShift Requirements.txt Pip error
- OpenShift PHP Image Asset Giving 500 Error
- Codeigniter on OpenShift is redirecting to 404 error page
- Why mongodb is reset after push to openshift
- Openshift - trigger Jenkins build on git push
- Openshift redirect to https using flask-base example
Related Questions in KUBECTL
- How to create users/groups restricted to namespace in Kubernetes using RBAC API?
- NodePort services not working as expected on AWS, possibly due to IAM ELB permissions
- How to authenticate kubectl using environment variables?
- kubectl jsonpath expression for named path
- kubectl behind a proxy
- Finding the reason for pods being killed by Minikube
- How to configure kubernetes to allow for long running interactive sessions?
- Can I get or delete a pod/resource by UID?
- Define size for /dev/shm on container engine
- What is the jsonpath for Kubernetes POD status?
- Restart container within pod
- Sharing a persistent volume between pods in Kubernetes
- Does HPA(Horizontal pod autoscaling) considers the mean of CPU utilization of multiple containers(in a pod) to scale the pods?
- Flannel fails in kubernetes cluster due to failure of subnet manager
- Kubernetes create Service in deployment+rbd mode, also same configured to succeed in default namespace, fail under non default namespace?
Related Questions in KUBERNETES-POD
- Kubernetes Service not able to loadbalance requests
- Spark Submit: You have not specified a krb5.conf file locally or via a ConfigMap
- Rook and ceph on kubernetes
- `mkdir` returns successfully but doesn't work in kubernetes (minikube) shared volume
- Back-off restarting failed container kubernetes
- Kubernetes node’s condition based scheduling using helm chart
- How to get a heap dump from Kubernetes k8s pod?
- AKS : Kubernetes coreDNS fails to resolve headless services
- EKS LoadBalancer service not returning response outside from EKS
- Kops - unable to bound to storage class using pvc
- How to Access rest api (deployed in k8 cluster) via service name
- Azure AKS: Kubernetes pod keeps showing CrashLoopBackOff status after assigning static IP
- are kubernetes horizontal pod autoscaling a reactive approach or proactive approach?
- can VPA and HPA(Auto Scaling) in kubernetes used together?
- Kubernetes service account to access all the namespaces
Related Questions in KUBERNETES-PYTHON-CLIENT
- How to get all daemonset info from EKS cluster using kubernetes-python client?
- is there Python client API for 'kubectl auth can-i --list'
- How can I dynamically allocate resources to each pod?
- How to bind local ports to Kubernetes pods for port forwarding using Kubernetes Python client?
- Python Docker SDK Inside Kubernetes
- How to create a job with postStart and preStop handlers by python kubernetes
- Pycharm lack of Intelisense for nested class properties
- How to get custom objects like VirtualMachine using kubernetes python client?
- How to make kubernetes.client.api.batch_v1_api.BatchV1Api.delete_namespaced_job wait till deletion is complete
- Unable to connect GKE autopilot cluster from kubernetes python client
- Docker Can't find kubernetes Config File
- how to pass patch type in patch_namespaced_deployment function in python kubernetes client?
- How can I specify ServiceAccount to be picked up by config.load_incluster_config() from kubernetes python sdk
- Remove volume from deployment using patch_namespaced_deployment not working
- Managing Openshift cluster with Python
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
As per the code here it picks up the token from
/var/run/secrets/kubernetes.io/serviceaccount/tokenpath inside the pod. So what you need to do is just have a different service account in the pod specThen it will pick up the service account
build-robot. Also note you need to configure role and rolebinding for this service account.