AWS supports IAM Roles for Service Accounts (IRSA) that allows cluster operators to map AWS IAM Roles to Kubernetes Service Accounts.
To do so, one has to create an iamserviceaccount in an EKS cluster:
eksctl create iamserviceaccount \
--name <AUTOSCALER_NAME> \
--namespace kube-system \
--cluster <CLUSTER_NAME> \
--attach-policy-arn <POLICY_ARN> \
--approve \
--override-existing-serviceaccounts
The problem is that I don't want to use the above eksctl
command because I want to declare my infrastructure using terraform
.
Does eksctl command do anything other than creating a service account? If it only creates a service account, what is the YAML
representation of it?
After Vasili Angapov
's helps, now I can answer the question:
Yes It does more than just creating a service account. It does three things:
Now It's easy to declare the above steps using kubernetes and aws providers in terraform.