When I create an EKS cluster with LocalStack:
awslocal eks create-cluster
--name cluster1
--role-arn "arn:aws:iam::000000000000:role/eks-role"
--resources-vpc-config "{}"
Confirm:
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:4510",
"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",
....
}
Set kubernetes context:
awslocal eks update-kubeconfig --name cluster1 &&
kubectl config use-context arn:aws:eks:ap-northeast-1:000000000000:cluster/cluster1
Why got error when run kubectl command?
kubectl get po
I0522 14:04:44.688006 27587 versioner.go:58] Get "https://localhost.localstack.cloud:4510/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:4510/api?timeout=32s": EOF
The EKS’ endpoint is using 4510. The LocalStack’s default endpoint is 4566.
Is the port a reason?