User types in Kubernetes
Kubernetes clusters have several categories of users:- Administrators — manage the cluster
- Developers — deploy or test applications
- End-users — access applications running in the cluster
- Third-party applications or bots — interact with the cluster for integration purposes
Authentication mechanisms
All user access is managed by thekube-apiserver. It authenticates every incoming request before processing it.
Supported authentication methods:
Client certificates
The most common and recommended method for authenticating users and components.
Static password file
(Deprecated) A CSV file containing usernames and passwords passed to the kube-apiserver.
Static token file
A CSV file containing usernames and tokens passed to the kube-apiserver.
Identity provider (third-party)
External identity systems like LDAP or Kerberos.
Service account tokens
Used by processes and applications running inside pods.
Static password file (deprecated)
Create a CSV file with password, username, and user ID. Pass it to thekube-apiserver via --basic-auth-file. The configuration file is at /etc/kubernetes/manifests/kube-apiserver.yaml.
passwords.csv
Static token file
Create a CSV file with token, username, and user ID. Pass it to thekube-apiserver via --token-auth-file.
tokens.csv
Authenticate using kubeconfig
Refer to KubeConfig for more information.Authenticate using kubectl proxy
Bootstrap token authentication
Bootstrap tokens authenticate with thekube-apiserver when creating a new cluster or joining a new node. They are valid for 24 hours by default.
Once a node has joined the cluster using a bootstrap token, the token expiration does not affect the node’s cluster membership. The node switches to client certificate authentication after joining. Bootstrap tokens are only used for the initial join process.
Create a bootstrap token
Two options are available:Using kubeadm (run on a node with Manually: the bootstrap token format must match
kubeadm installed):^[a-z0-9]{6}\.[a-z0-9]{16}$.Store the bootstrap token as a Kubernetes Secret
The secret must exist in the
kube-system namespace.bootstrap-token-07401b.yaml
| Field | Description |
|---|---|
usage-bootstrap-authentication | Token can authenticate to kube-apiserver as a bearer token |
usage-bootstrap-signing | Token may sign the cluster-info ConfigMap |
system:bootstrappers:worker | Permissions for worker nodes joining the cluster |
system:bootstrappers:ingress | Permissions for ingress-specific nodes |
system:bootstrappers:kubeadm:default-node-token | Default kubeadm node join permissions |
Join the worker node to the cluster
On the worker node (or via SSH), run the join command. Ensure
kubeadm, kubelet, and kubectl are installed on the worker node.