Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the purpose of Kubernetes ServiceAccount

Tags:

kubernetes

I've read documentation, I've seen exemples, but I don't know why would I add a serviceAccount in my pods ?

The 'elasticsearch' exemple from Kubernetes (https://github.com/kubernetes/kubernetes/tree/master/examples/elasticsearch) has a service account 'elasticsearch', what does it grant ?

Thank you.

like image 269
ant31 Avatar asked Oct 05 '15 11:10

ant31


1 Answers

The service accounts inject authentication credentials into the pod to talk to the Kubernetes service (e.g. the apiserver).

This is important if you are building an application that needs to inspect the pods/services/controllers that are running in the cluster to have correct behavior. For example, the kube2sky container watches services and endpoints to provide DNS within the cluster by connecting to the Kubernetes service.

like image 181
Robert Bailey Avatar answered Sep 29 '22 05:09

Robert Bailey