gpt4 book ai didi

amazon-web-services - 加载命名空间时出错。未授权 : Verify you have access to the Kubernetes cluster

转载 作者:行者123 更新时间:2023-12-03 14:20:36 25 4
gpt4 key购买 nike

我已经使用命令行 eksctl 创建了一个 EKS 集群,并验证了该应用程序运行正常。
但是注意到一个奇怪的问题,当我尝试在 Web 浏览器中访问集群中的节点时,我看到以下错误

Error loading Namespaces
Unauthorized: Verify you have access to the Kubernetes cluster
enter image description here
我可以使用 kubectl get nodes 查看节点
我以管理员用户身份登录。关于如何解决这个问题的任何帮助都会非常好。谢谢。

最佳答案

您需要将您的 IAM 角色/用户添加到集群的 aws-auth 配置映射
遵循的基本步骤取自 https://docs.aws.amazon.com/eks/latest/userguide/add-user-role.html

kubectl edit -n kube-system configmap/aws-auth
# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: v1
data:
mapRoles: |
- rolearn: <arn:aws:iam::111122223333:role/eksctl-my-cluster-nodegroup-standard-wo-NodeInstanceRole-1WP3NUE3O6UCF>
username: <system:node:{{EC2PrivateDNSName}}>
groups:
- <system:bootstrappers>
- <system:nodes>
mapUsers: |
- userarn: <arn:aws:iam::111122223333:user/admin>
username: <admin>
groups:
- <system:masters>
- userarn: <arn:aws:iam::111122223333:user/ops-user>
username: <ops-user>
groups:
- <system:masters>

关于amazon-web-services - 加载命名空间时出错。未授权 : Verify you have access to the Kubernetes cluster,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65125600/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com