我一直试图遵循 EKS 的入门指南。
当我尝试调用 kubectl get service 时,我收到了这样的消息: error: 必须登录到服务器(未经授权)
我是这么做的:
1. 创建 EKS 集群。
2. 创建配置文件如下:
apiVersion: v1
clusters:
- cluster:
server: https://*********.yl4.us-west-2.eks.amazonaws.com
certificate-authority-data: *********
name: *********
contexts:
- context:
cluster: *********
user: aws
name: aws
current-context: aws
kind: Config
preferences: {}
users:
- name: aws
user:
exec:
apiVersion: client.authentication.k8s.io/v1alpha1
command: heptio-authenticator-aws
args:
- "token"
- "-i"
- "*********"
- "-r"
- "arn:aws:iam::*****:role/******"
当我运行 heptio-enticator-aws 令牌-r arn: aws: iam: : * * * * * * * * * * * * * * * * * * * * * *-i my-cluster-ame 时,我可以得到一个令牌 但是,当我尝试访问集群时,我不断收到错误: 您必须登录到服务器(未授权)
有办法解决这个问题吗?