我在Kubernetes集群上设置AWS集成时遇到问题。我已经在所有实例,子网,VPC和单个SG中设置了kubernetes.io/cluster/clustername =所有标签。我还已将--cloud-provider = aws标志传递给API服务器和 Controller 管理器,但 Controller 管理器无法启动。
Controller 管理器日志:
I0411 21:03:48.360194 1 aws.go:1026] Building AWS cloudprovider
I0411 21:03:48.360237 1 aws.go:988] Zone not specified in configuration file; querying AWS metadata service
F0411 21:03:48.363067 1 controllermanager.go:159] error building controller context: cloud provider could not be initialized: could not init cloud provider "aws": error finding instance i-0442e20b4a28b2274: "error listing AWS instances: \"NoCredentialProviders: no valid providers in chain. Deprecated.\\n\\tFor verbose messaging see aws.Config.CredentialsChainVerboseErrors\""
附加到主节点的策略是:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [ "ec2:*" ],
"Resource": [ "*" ]
},
{
"Effect": "Allow",
"Action": [ "elasticloadbalancing:*" ],
"Resource": [ "*" ]
},
{
"Effect": "Allow",
"Action": [ "route53:*" ],
"Resource": [ "*" ]
}
]
}
通过cURL从主服务器查询AWS Metadata Service返回正确的凭证
任何帮助都感激不尽!
附注:我没有使用Kops或类似的东西。我自己设置了控制组件平面。
最佳答案
我能够通过将 --cloud-provider = aws 标志传递给kubelet来解决此问题。我认为在Master节点上不需要。
谢谢!
关于amazon-web-services - Kubernetes上的AWS集成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49802306/