简体   繁体   English

AWS角色和用户没有任何策略,为什么我仍然可以访问K8s集群?

[英]AWS role and user have not any policy,why I still can access K8s cluster?

My question: I have not any permission,why I can access K8s我的问题:我没有任何权限,为什么我可以访问 K8s

[vagrant@localhost ~]$ kubectl get deployment --namespace=development
No resources found in development namespace.

Things below are my configuration.下面的东西是我的配置。

$ cat ~/.kube/config 
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: <my certificate-authority-data>
    server: https://2C1A77626A2087EBA1D1123EA9398DAF.gr7.ap-northeast-1.eks.amazonaws.com
  name: arn:aws:eks:ap-northeast-1:056844949861:cluster/eksworkshop-eksctl
contexts:
- context:
    cluster: arn:aws:eks:ap-northeast-1:056844949861:cluster/eksworkshop-eksctl
    user: arn:aws:eks:ap-northeast-1:056844949861:cluster/eksworkshop-eksctl
  name: arn:aws:eks:ap-northeast-1:056844949861:cluster/eksworkshop-eksctl
current-context: arn:aws:eks:ap-northeast-1:056844949861:cluster/eksworkshop-eksctl
kind: Config
preferences: {}
users:
- name: arn:aws:eks:ap-northeast-1:056844949861:cluster/eksworkshop-eksctl
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1alpha1
      args:
      - --region
      - ap-northeast-1
      - eks
      - get-token
      - --cluster-name
      - eksworkshop-eksctl
      - --role
      - arn:aws:iam::056844949861:role/k8sDev
      command: aws

Here are my role and, nothing in Permissions:这是我的角色,权限中没有任何内容: 在此处输入图像描述 在此处输入图像描述

Here is my user, just inline policy here:这是我的用户,这里只是内联策略: 在此处输入图像描述

here are my group and content of inline policy:这是我的组和内联策略的内容: 在此处输入图像描述

The reason you are able to access it is because the IAM user you are accessing the cluster is the same as the one used to create the cluster.您能够访问它的原因是您访问集群的 IAM 用户与用于创建集群的用户相同。 The documenation states:文档指出:

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.当您创建 Amazon EKS 集群时,IAM 实体用户或角色(例如创建集群的联合身份用户)会在集群的 RBAC 配置中自动获得 system:masters 权限。

In EKS, IAM users are used for authentication, but IAM roles do not control authorization.在 EKS 中,IAM 用户用于身份验证,但 IAM 角色不控制授权。 Authorization is still handled through the kubernetes RBAC system.授权仍通过 kubernetes RBAC 系统处理。

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

相关问题 如何访问部署在 k8s 集群外部的 statping 以监控 k8s 服务的正常运行时间? - How can I give access to statping deployed outside k8s cluster to monitor k8s services uptime? 为什么不能在AWS EC2的k8s集群上正确部署容器? - Why can't deploy containers on k8s cluster on AWS EC2 correctly? 审计 AWS 上的 k8s 集群事件 - Audit k8s cluster events on AWS 如何让k8s Pod(Jenkins生成)使用Service account IAM角色访问AWS资源 - How to make k8s Pod (generated by Jenkins) use Service account IAM role to access AWS resources 是否可以在本地 K8s 集群上拥有 AWS EBS 持久卷? - Is it possible to have AWS EBS persistent volumes on an on-prem K8s cluster? 如何最小化 AWS k8s 的 Kops 的 IAM 角色权限 - How to minimize IAM role permission for Kops of AWS k8s AWS Boto3 无凭证错误 IAM 角色 K8S - AWS Boto3 No Credential Error IAM role K8S 是否可以制作混合 K8S 集群 AWS / Raspberry PI - Is it possible to make a hybrid K8S cluster AWS / Raspberry PI 在中国设置代理到gcp或aws k8s集群 - setup proxy to gcp or aws k8s cluster in china 哪种监控工具更适合在AWS for k8s集群上使用? - Which monitoring tool is better to use on AWS for k8s cluster?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM