Fortinet black logo

Online Help

Add IAM Role to Kubernetes Configmap

Copy Link
Copy Doc ID e4328cd7-f48b-11eb-97f7-00505692583a:698697

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.

  1. Make a note of the IAM role that will be used in adding the Kubernetes cluster.
  2. 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
  3. Log into to CLI with the IAM user that created the EKS Kubernetes cluster.
  4. Run the following command to edit the ConfigMap:
  5. kubectl edit configmap aws-auth -n kube-system

  6. 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.
  7. For example:

    rolearn: arn:aws:iam::385279133003:role/xiem_eks_policy

    username: xiem_eks_policy

    groups: system:masters

  8. Save the file and make sure it is successfully edited.

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.

  1. Make a note of the IAM role that will be used in adding the Kubernetes cluster.
  2. 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
  3. Log into to CLI with the IAM user that created the EKS Kubernetes cluster.
  4. Run the following command to edit the ConfigMap:
  5. kubectl edit configmap aws-auth -n kube-system

  6. 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.
  7. For example:

    rolearn: arn:aws:iam::385279133003:role/xiem_eks_policy

    username: xiem_eks_policy

    groups: system:masters

  8. Save the file and make sure it is successfully edited.