You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在LocalStack EKS中操作Kubernetes集群时出现EOF错误,端口是否为原因?

LocalStack中EKS集群kubectl连接失败问题排查

操作流程与问题现象

  1. 创建EKS集群:
awslocal eks create-cluster \
  --name cluster1 \
  --role-arn "arn:aws:iam::000000000000:role/eks-role" \
  --resources-vpc-config "{}"
  1. 确认集群状态为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",
....
}
  1. 配置Kubernetes上下文:
awslocal eks update-kubeconfig --name cluster1 && \
    kubectl config use-context arn:aws:eks:ap-northeast-1:000000000000:cluster/cluster1
  1. 执行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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.23 11:17:02