Service Accounts

Service accounts are used to access kubernetes services through APIs by other software programs. For example, a prometheus service to watch the resources matrices etc.

To access the kubernetes we following things

  1. service account with right set of permissions
  2. token for that service account

Token will then can be used in application to access kubernetes.

Create a sa

kubectl create sa dashboard-sa

Or

kubectl create serviceaccount dashboard-sa

To use it, we need to generate the token for that service account.

kubectl create token dashboard-sa

(It is assumed that permissions have been assigned to a service account.)