Skip to main content

5.2.2.4. Service Account

In Kubernetes, ServiceAccount is a mechanism that allows applications within the cluster to authenticate when accessing the API server. The private key specified in kube-apiserver and kube-controller-manager is used for signing tokens of these accounts. This ensures secure and verifiable interaction between services and provides the ability for granular access control.

This section creates or connects the key used by Kubernetes to sign ServiceAccount tokens.

Creating ServiceAccount signing key

● Required

openssl genpkey \
-algorithm RSA \
-out /etc/kubernetes/pki/sa.key \
-pkeyopt rsa_keygen_bits:2048
openssl rsa \
-pubout \
-in /etc/kubernetes/pki/sa.key \
-out /etc/kubernetes/pki/sa.pub