Set up the cluster
Create a service account for the workload: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
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.