A team wants to deploy a new microservice to AKS that reads a database password. How do you wire secrets?
BeginnerScenarioAKS and Containers
Answer
Situation read → Key Vault + CSI driver + workload identity; no secrets in git or plain Kubernetes Secrets.
What I'd do →
- Store the secret:
az keyvault secret set --vault-name kv-shop -n db-password --value ... - Create a user-assigned identity, grant
Key Vault Secrets Useron the vault, add a federated credential forsystem:serviceaccount:shop:orders-sa - Create the ServiceAccount with
azure.workload.identity/client-idannotation - Create a
SecretProviderClasswithclientID,keyvaultName,tenantIdand the object list - Mount it in the Deployment (
csivolume, driversecrets-store.csi.k8s.io), with pod labelazure.workload.identity/use: "true"
Why → One identity per workload, revocable in Azure, auditable in Key Vault logs.
Interview tip → Mention Entra auth to the DB itself to avoid the password entirely.
More on AKS and Containers
You're asked to build a production AKS cluster. Walk through your key decisions.IntermediateYou need to upgrade a production AKS cluster from 1.31 to 1.33. Plan it.AdvancedPods need to scale on Service Bus queue length, not CPU. How?AdvancedYou need to run a GPU workload on an existing AKS cluster. What do you do?IntermediateA noisy application keeps starving other workloads on shared nodes. How do you fix it?BeginnerYou must move an AKS workload from one cluster to a new cluster with zero downtime.Advanced