Interview Prep/Azure/AKS and ACR

How does the Key Vault Secrets Store CSI driver work on AKS?

AdvancedConceptAKS and ACR
Answer

The driver mounts Key Vault secrets, keys and certificates as files into pods through a SecretProviderClass. An identity (workload identity is preferred) authenticates to Key Vault.

apiVersion: secrets-store.csi.x-k8s.io/v1
kind: SecretProviderClass
metadata:
  name: kv-shop
spec:
  provider: azure
  parameters:
    clientID: "<uami-client-id>"
    keyvaultName: kv-shop-prod
    tenantId: "<tenant-id>"
    objects: |
      array:
        - |
          objectName: db-password
          objectType: secret

Secrets are fetched when the pod starts (the volume mount fails if the fetch fails). Enable rotation (--enable-secret-rotation, default poll 2 minutes) to refresh files. Use secretObjects to also sync into a Kubernetes Secret if you need env vars, which then also needs rotation-aware restarts.

Azure All Azure questions Roadmap: AKS & Azure DevOps

More on AKS and ACR