我一直在尝试遵循EKS的入门指南.当我试图调用kubectl获取服务时,我得到了消息:错误:您必须登录到服务器(未经授权)这是我做的:
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/******"
Run Code Online (Sandbox Code Playgroud)
当我运行heptio-authenticator-aws token -r arn时,我可以得到一个令牌:aws:iam ::**********:role/*********-i my-cluster -ame然而,当我尝试访问群集时,我一直收到错误:您必须登录到服务器(未经授权)
知道如何解决这个问题吗?