Interview Prep/Kubernetes/EKS-specific issues

New EBS-backed PVCs fail with `could not create volume in EC2: UnauthorizedOperation` only after the security team enabled default EBS encryption with a customer-managed KMS key.

AdvancedTroubleshootingEKS-specific issues
Answer

Likely causes → Account-level default encryption now uses a CMK, and the EBS CSI controller role is not allowed to use it (kms:CreateGrant, kms:GenerateDataKeyWithoutPlaintext, kms:Decrypt). The key policy may also not delegate to IAM.

Diagnose →

aws ec2 get-ebs-default-kms-key-id
aws kms get-key-policy --key-id <key-id> --policy-name default
kubectl logs -n kube-system deploy/ebs-csi-controller -c ebs-plugin | grep -i kms

Fix → Allow the CSI role in the KMS key policy or IAM policy (with kms:GrantIsForAWSResource condition on CreateGrant), and set kmsKeyId in the StorageClass if a specific key is required. Nodes launched from encrypted AMIs or with encrypted root volumes need the same for the Auto Scaling service-linked role.

Prevent → Coordinate KMS changes with the platform team and test PVC creation in staging first.

All Kubernetes questions

More on EKS-specific issues