简体   繁体   English

尽管我的用户/角色 ARN 不是 aws-auth CM 的一部分,但我如何能够访问 EKS 集群?

[英]How i am able to access EKS Cluster, though my User/Role ARN is not part of aws-auth CM?

New to EKS, Learning. EKS 新手,学习。 I understand that Access can be provided to IAM Users/Roles by adding to the aws-auth config map, but when the cluster was created the first time, the AWS-auth has only one entry.我知道可以通过添加到 aws-auth 配置映射来向 IAM 用户/角色提供访问权限,但是当第一次创建集群时,AWS-auth 只有一个条目。

apiVersion: v1
data:
  mapRoles: |
    - "groups":
      - "system:bootstrappers"
      - "system:nodes"
      "rolearn": "arn:aws:iam::XXXXXXXXXXXXXXX:role/test-eks"
      "username": "system:node:{{EC2PrivateDNSName}}"
kind: ConfigMap
metadata:
  name: aws-auth
  namespace: kube-system

kubeconfig file kubeconfig 文件

apiVersion: v1
kind: Config
clusters:
- cluster:
    certificate-authority-data: XXXXXXXXXXX
    server: https://XXXXXXXXXXXXX.XXX.us-east-1.eks.amazonaws.com
  name: arn:aws:eks:us-east-1:XXXXXXXXXXXX:cluster/test-eks
contexts:
- context:
    cluster: arn:aws:eks:us-east-1:XXXXXXXXXXXX:cluster/test-eks
    user: arn:aws:eks:us-east-1:XXXXXXXXXXXX:cluster/test-eks
  name: arn:aws:eks:us-east-1:XXXXXXXXXXXX:cluster/test-eks
current-context: arn:aws:eks:us-east-1:XXXXXXXXXXXX:cluster/test-eks
users:
- name: arn:aws:eks:us-east-1:XXXXXXXXXXXX:cluster/test-eks
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1alpha1
      args:
      - --region
      - us-east-1
      - eks
      - get-token
      - --cluster-name
      - test-eks
      command: aws

Question: How I am able to access Cluster as Admin?问题:我如何能够以管理员身份访问集群? where it was defined in the cluster that I (IAM User) have cluster-admin access?在集群中定义我(IAM 用户)具有集群管理员访问权限的位置? Please help me in understanding.请帮助我理解。 Thank You in Advance!先感谢您!

https://docs.aws.amazon.com/eks/latest/userguide/add-user-role.html : https://docs.aws.amazon.com/eks/latest/userguide/add-user-role.html

When you create an Amazon EKS cluster, the IAM entity user or role... is automatically granted system:masters permissions in the cluster's RBAC configuration in the control plane.当您创建 Amazon EKS 集群时,IAM 实体用户或角色...在控制平面中集群的 RBAC 配置中被自动授予 system:masters 权限。

You are already the admin as you are the creator of the cluster.您已经是管理员,因为您是集群的创建者。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM