Skip to main content
Kubernetes can mount a short-lived, signed service account token into a pod. Reducto verifies the token against your cluster’s public keys and returns an access token. This guide covers self-managed clusters. For managed clusters, see the EKS, AKS and GKE sections. Use projected service account tokens. Legacy service account tokens stored in Secrets do not expire and have the wrong audience, so Reducto cannot use them.

Set up the cluster

Create a service account for the workload:
Get the cluster’s issuer and its public signing keys:
Many self-managed clusters use a private issuer such as https://kubernetes.default.svc or https://kubernetes.default.svc.cluster.local. Reducto cannot fetch discovery from a private issuer, so upload the JWKS for these clusters. Mount a projected token with the Reducto audience. The kubelet refreshes the file before it expires.

Inspect the token

sub has the form system:serviceaccount:<namespace>:<service account>.

Configure Reducto

In Studio, open Settings > Workload identity and create a provider with the Kubernetes preset: Add a mapping for the service account: To allow every service account in a namespace, use sub = system:serviceaccount:payments:*. To match on the nested namespace claim, add a transformation with attribute = reducto.namespace and claim = ["kubernetes.io", "namespace"], then match reducto.namespace = payments.

Call Reducto from the pod

The token provider reads the file on every exchange, so it always sends the token the kubelet wrote last. Instead of code, you can set REDUCTO_IDENTITY_TOKEN_FILE=/var/run/secrets/reducto/token next to REDUCTO_IDENTITY_PROVIDER_ID and create the client with no arguments.

Kubernetes best practices

  • Use a dedicated service account for Reducto. Do not reuse one that has other cloud or cluster permissions.
  • Match the full sub. Use a namespace wildcard only if everyone who can create service accounts in that namespace should have Reducto access.
  • Keep the issuer stable across cluster upgrades. A changed issuer breaks every exchange.
  • With an uploaded JWKS, update the provider before the cluster rotates its service account signing key. Upload both keys during the rotation.
  • Protect the service account signing key. Anyone who has it can mint tokens that Reducto accepts.