Add IAM Role to Kubernetes ConfigMap
When an AWS EKS Kubernetes cluster is created, only the original IAM entity user has system:masters permissions to the cluster. To grant additional IAM users with ability to interact with the cluster, the ConfigMap needs to be edited within the cluster.
- Make a note of the IAM role that will be used in adding the Kubernetes cluster.
- Go to Credential Store > IAM Role Platform, locate the IAM role from step 1, click on the more button and select View Detail to show IAM Role Detail. Make a note of the Role ARN for use later
- Log into to CLI with the IAM user that created the EKS Kubernetes cluster.
- Run the following command to edit the ConfigMap:
- In mapRoles, add new rolearn row with the IAM Role arn, the corresponding userName with IAM Role name, and groups with
system:masters
from step 2. - Save the file and make sure it is successfully edited.
kubectl edit configmap aws-auth -n kube-system
For example:
rolearn: arn:aws:iam::385279133003:role/xiem_eks_policy
username: xiem_eks_policy
groups: system:masters