Kubernetes
ezoidc has built-in support to validate Kubernetes service account tokens.
k8s
issuer
If the ezoidc server detects that is is running in a Kubernetes cluster, the OIDC configuration of the API server will be fetched and stored as the k8s
issuer.
This issuer can then be used to authenticate service account tokens issued by the same cluster.
This behavior can be disabled by setting automountServiceAccountToken: false
in the server pod.
Service Account Tokens
Users that are authorized to create serviceaccounts/token
resources can use the kubectl create token
command to generate tokens that can authenticate with ezoidc.
Mount the token as a projected volume
A service account token can be mounted as a projected volume in a pod, with the audience set to the ezoidc server.
This allows the pod to authenticate with ezoidc using its service account without granting the pod the ability to create serviceaccounts/token
resources.
The ezoidc client can make use of the token using the --token-path
option.
Install using Helm
-
Install the Helm chart.
-
To validate the server is working propertly, forward the port to your local machine.
-
Create a service account token for the
default
service account. -
Read the variables from the server.
-
The default configuration should grant you access to the
success
variable.
To customize the server’s configuration using Helm, refer to the chart’s values.yaml file.