Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a bearer token for kubernetes

I have a Kubernetes Cluster on Azure and I need to connect it to an external tool, this tool needs the API server address and the Bearer token, I was able to get the url of the api, but the bearer token, I am not finding.

Does anyone know how to generate this token?


1 Answers

Bearer Tokens are just normal Tokens from ServiceAccounts.

Service account bearer tokens are perfectly valid to use outside the cluster and can be used to create identities for long standing jobs that wish to talk to the Kubernetes API.

You should def. create a new ServiceAccount with limit permissions (maybe the Tool has a documentation which permissions are needed).

Generally i would advise to never let any external Tool connect directly to the API Server, but this is up to you.

You can check about ServiceAccount Tokens here: https://kubernetes.io/docs/reference/access-authn-authz/authentication/#service-account-tokens

like image 178
Philip Welz Avatar answered Nov 04 '25 11:11

Philip Welz