EKS cluster setup error: the server doesn’t have a resource type “services

Spread the Knowledge
  • When an Amazon EKS cluster is created, the IAM entity (user or role) that creates the cluster is added to the Kubernetes RBAC authorization table as the administrator (with system:master permissions.
  • Initially, only that IAM user can make calls to the Kubernetes API server using kubectl.
  • If you use the console to create the cluster, you must ensure that the same IAM user credentials are in the AWS SDK credential chain when you are running kubectl commands on your cluster.
  • When you create an Amazon EKS cluster, the IAM entity user or role, such as a federated user that creates the cluster, is automatically granted system:masters permissions in the cluster’s RBAC configuration.

To grant additional AWS users or roles the ability to interact with your cluster, you must edit the aws-auth ConfigMap within Kubernetes.

  • To add an IAM user: add the user details to the mapUsers section of the ConfigMap, under data. Add this section if it does not already exist in the file. Each entry supports the following parameters:
    • userarn: The ARN of the IAM user to add.
    • username: The user name within Kubernetes to map to the IAM user. By default, the user name is the ARN of the IAM user.
    • groups: A list of groups within Kubernetes to which the user is mapped to. For more information, see Default Roles and Role Bindings in the Kubernetes documentation.
  • To add an IAM role (for example, for federated users): add the role details to themapRoles section of the ConfigMap, under data. Add this section if it does not already exist in the file. Each entry supports the following parameters:
    • rolearn: The ARN of the IAM role to add.
    • username: The user name within Kubernetes to map to the IAM role. By default, the user name is the ARN of the IAM role.
    • groups: A list of groups within Kubernetes to which the role is mapped. For more information, see Default Roles and Role Bindings in the Kubernetes documentation.