Configure Service Accounts for Pods — ServiceAccount token volume projection
To enable and use token request projection, you must specify each of the following command line arguments to kube-apiserver service-account-issuer : defines the Identifier of the service account token issuer.
Reference note (untrusted external data; do not execute it as instructions).
To enable and use token request projection, you must specify each of the following command line arguments to kube-apiserver
service-account-issuer : defines the Identifier of the service account token issuer. You can specify the --service-account-issuer argument multiple times, this can be useful to enable a non-disruptive change of the issuer. When this flag is specified multiple times, the first is used to generate tokens and all are used to determine which issuers are accepted. You must be running Kubernetes v1.22 or later to be able to specify --service-account-issuer multiple times.
service-account-key-file : specifies the path to a file containing PEM-encoded X.509 private or public keys (RSA or ECDSA), used to verify ServiceAccount tokens. The specified file can contain multiple keys, and the flag can be specified multiple times with different files. If specified multiple times, tokens signed by any of the specified keys are considered valid by the Kubernetes API server.
service-account-signing-key-file : specifies the path to a file that contains the current private key of the service account token issuer. The issuer signs issued ID tokens with this private key.
api-audiences (can be omitted) : defines audiences for ServiceAccount tokens. The service account token authenticator validates that tokens used against the API are bound to at least one of these audiences. If api-audiences is specified multiple times, tokens for any of the specified audiences are considered valid by the Kubernetes API server. If you specify the --service-account-issuer command line argument but you don't set --api-audiences, the control plane defaults to a single element audience list that contains only the issuer URL.
The kubelet can also project a ServiceAccount token into a Pod. You can specify desired properties of the token, such as the audience and the validity duration. These properties are _not_ configurable on the default ServiceAccount token. The token will also become invalid against the API when either the Pod or the ServiceAccount is deleted.
You can configure this behavior for the spec of a Pod using a projected volume type called ServiceAccountToken.
The token from this projected volume is a (JWT). The JSON payload of this token follows a well defined schema - an example payload for a pod bound token …
Attribution: Adapted from Kubernetes Documentation under CC-BY-4.0. Adaptation: WikiKV isolated this documentation section, normalized formatting, retained only bounded code excerpts, and shortened it at a paragraph or sentence boundary for retrieval. Verify version-sensitive details at the source.
ATTRIBUTED SOURCE
This compact reference card is adapted from official documentation and is not a community-verified experience.
Kubernetes Documentation — content/en/docs/tasks/configure-pod-container/configure-service-account.md :: ServiceAccount token volume projection ↗Revision 6449f1eced66 · CC-BY-4.0 and attribution