When creating the following service account using kubectl apply, either using --server-side=true or not, the amazon-eks-pod-identity-webhook does not mount the AWS environment variables in the pods that use said service account.
...then annotate it using kubectl annotate serviceaccount -n aws-lb-controller eks.amazon.com/role-arn: arn:aws:iam::XXXXXXXXXXXX:role/YYYYYY, then create a pod that uses the service account, the latter is then injected with the environment variables as expected.
What you expected to happen:
The pods that use the service account should have the AWS environment variables mounted regardless of how the SA's annotations were added (apply or annotate)
How to reproduce it (as minimally and precisely as possible):
Create an EKS cluster
Create a service account and matching role as per this AWS guide BUT, instead of annotating the service account using kubectl annotate, use kubectl apply.
Anything else we need to know?:
Environment:
AWS Region: us-west-2
EKS Platform version (if using EKS, run aws eks describe-cluster --name <name> --query cluster.platformVersion): eks.3
Kubernetes version (if using EKS, run aws eks describe-cluster --name <name> --query cluster.version): 1.28
What happened:
When creating the following service account using
kubectl apply
, either using--server-side=true
or not, the amazon-eks-pod-identity-webhook does not mount the AWS environment variables in the pods that use said service account.However, when I first create the service account as follows:
...then annotate it using
kubectl annotate serviceaccount -n aws-lb-controller eks.amazon.com/role-arn: arn:aws:iam::XXXXXXXXXXXX:role/YYYYYY
, then create a pod that uses the service account, the latter is then injected with the environment variables as expected.What you expected to happen:
The pods that use the service account should have the AWS environment variables mounted regardless of how the SA's annotations were added (
apply
orannotate
)How to reproduce it (as minimally and precisely as possible):
kubectl annotate
, usekubectl apply
.Anything else we need to know?:
Environment:
aws eks describe-cluster --name <name> --query cluster.platformVersion
): eks.3aws eks describe-cluster --name <name> --query cluster.version
): 1.28