Kubernetes Workload Identity
Kubernetes can mount a short-lived, automatically rotated ServiceAccount JWT into a Pod. Mixlayer verifies that JWT through the cluster’s OIDC issuer and exchanges it for a short-lived Mixlayer access token.
Use projected ServiceAccount tokens rather than legacy Secret-backed tokens.
1. Inspect the cluster issuer
Get the cluster’s OIDC discovery document:
Record its issuer value. Mixlayer must be able to reach the issuer and its jwks_uri over public HTTPS to use OIDC discovery.
For a private issuer, download the cluster’s public JWKS and upload it as a static JWKS when configuring the provider:
When using a static JWKS, add a new signing key to the Mixlayer provider before the cluster starts issuing tokens with it.
2. Configure the Mixlayer provider
Create an OIDC provider in Workload Identity with these values:
Map the ServiceAccount subject:
Kubernetes subjects use this format:
Admit only the dedicated ServiceAccount:
Use true as the final authorization rule and grant only the permissions the Pod needs, such as inference.
3. Project a ServiceAccount token
The following manifest creates a dedicated ServiceAccount and mounts its token at /var/run/secrets/mixlayer/token:
Apply it with:
Do not mount the projected token using subPath; Kubernetes cannot rotate that mount.
4. Exchange the projected token
Read the token file each time you exchange so your application picks up rotations:
Use MIXLAYER_ACCESS_TOKEN as a bearer token with the Mixlayer APIs. Cache it in memory until shortly before it expires, then reread the projected token and exchange again.
Troubleshooting
- Decode a sample token locally and compare its
iss,aud,sub,iat, andexpclaims with the provider. Decoding does not verify its signature. - If discovery fails, confirm the issuer and JWKS endpoints are publicly reachable. Otherwise use a static JWKS.
- If exchange breaks after cluster signing-key rotation, update the provider’s static JWKS.
- If the ServiceAccount, namespace, or cluster changes, update the admission policy or create a separate provider for the new trust boundary.
Amazon EKS and Google Kubernetes Engine can use this same projected-token flow with their cluster-specific issuer URLs.