Interview Prep/DevSecOps/Cloud identity: IRSA, Workload Identity and CI OIDC

A CI pipeline creates a ServiceAccount for deploys but `kubectl get secret` shows no token secret for it on Kubernetes 1.29

BeginnerTroubleshootingCloud identity: IRSA, Workload Identity and CI OIDC
Answer

Likely causes → Since 1.24, Kubernetes no longer auto-creates long-lived kubernetes.io/service-account-token Secrets. Tokens are short-lived and come from the TokenRequest API.

Diagnose → kubectl get sa deployer -o yaml shows no secrets: entry.

Fix → Prefer a short-lived token:

kubectl create token deployer -n ci --duration=1h

If you truly need a long-lived one, create a Secret of type kubernetes.io/service-account-token with the annotation kubernetes.io/service-account.name: deployer.

Prevent → Better still, authenticate CI through cloud identity (EKS access entries, GKE IAM) or GitOps pull, so no Kubernetes token is stored in CI at all.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Cloud identity: IRSA, Workload Identity and CI OIDC