我正在尝试设置 aws EKS 集群并希望从我的本地 Windows 工作站连接该集群。无法连接。这是我执行的步骤;
Command:kubectl.exe get svc
output:
could not get token: NoCredentialProviders: no valid providers in chain. Deprecated.
For verbose messaging see aws.Config.CredentialsChainVerboseErrors
could not get token: NoCredentialProviders: no valid providers in chain. Deprecated.
For verbose messaging see aws.Config.CredentialsChainVerboseErrors
could not get token: NoCredentialProviders: no valid providers in chain. Deprecated.
For verbose messaging see aws.Config.CredentialsChainVerboseErrors
could not get token: NoCredentialProviders: no valid providers in chain. Deprecated.
For verbose messaging see aws.Config.CredentialsChainVerboseErrors
could not get token: NoCredentialProviders: no valid providers in chain. Deprecated.
For verbose messaging see aws.Config.CredentialsChainVerboseErrors
Unable to connect to the server: getting credentials: exec: exit status 1
不确定这里有什么错误的设置。有人可以帮忙吗?我知道有些地方说你必须使用相同的 aws 用户来连接集群 (EKS)。但是我怎样才能获得 aws 分配角色的访问 key 和 token (步骤#2:eks-role-1)?
最佳答案
对于参与其中的人,您可以为 eks 提供配置文件。
EKS 不会在 kubeconfig 中添加配置文件。
解决方法:
$ export AWS_ACCESS_KEY_ID=xxxxxxxxxxxxx
$ export AWS_SECRET_ACCESS_KEY=ssssssssss
$ export AWS_PROFILE=ppppp
users:
- name: eks # This depends on your config.
user:
exec:
apiVersion: client.authentication.k8s.io/v1alpha1
command: aws-iam-authenticator
args:
- "token"
- "-i"
- "general"
env:
- name: AWS_PROFILE
value: "<YOUR_PROFILE_HERE>" #
关于amazon-web-services - "kubectl"未从我的本地 Windows 工作站连接到 aws EKS 集群,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55005397/