在LocalStack EKS中操作Kubernetes集群时出现EOF错误,端口是否为原因?
LocalStack中EKS集群kubectl连接失败问题排查
操作流程与问题现象
- 创建EKS集群:
awslocal eks create-cluster \ --name cluster1 \ --role-arn "arn:aws:iam::000000000000:role/eks-role" \ --resources-vpc-config "{}"
- 确认集群状态为ACTIVE,返回结果中集群端点为
https://localhost.localstack.cloud:4511:
awslocal eks describe-cluster --name cluster1 { "cluster": { "name": "cluster1", "arn": "arn:aws:eks:ap-northeast-1:000000000000:cluster/cluster1", "createdAt": "2024-05-22T13:52:00.327000+09:00", "version": "1.22", "endpoint": "https://localhost.localstack.cloud:4511", "roleArn": "arn:aws:iam::000000000000:role/eks-role", "resourcesVpcConfig": { "securityGroupIds": [], "endpointPublicAccess": true, "endpointPrivateAccess": false, "publicAccessCidrs": [ "0.0.0.0/0" ] }, "identity": { "oidc": { "issuer": "https://localhost.localstack.cloud/eks-oidc" } }, "status": "ACTIVE", .... }
- 配置Kubernetes上下文:
awslocal eks update-kubeconfig --name cluster1 && \ kubectl config use-context arn:aws:eks:ap-northeast-1:000000000000:cluster/cluster1
- 执行kubectl命令时触发错误:
kubectl get po I0522 14:04:44.688006 27587 versioner.go:58] Get "https://localhost.localstack.cloud:4511/version?timeout=5s": EOF E0522 14:04:55.119358 27587 memcache.go:265] couldn't get current server API group list: Get "https://localhost.localstack.cloud:4511/api?timeout=32s": EOF
疑问
注意到EKS集群的端点使用4511端口,但LocalStack的默认端口是4566,请问端口不一致是否是导致上述kubectl连接错误的原因?
内容的提问来源于stack exchange,提问作者Alpin Cleopatra
相关产品推荐
相关产品推荐

