我尝试运行以下代码,并使用eksctl、创建aws-eks-kubernetes集群
$ eksctl create cluster
--version 1.14
--region us-west-2
--node-type t3.medium
--nodes 3
--nodes-min 1
--nodes-max 4
--name my-demo
--kubeconfig=$HOME/kubeconfigs/demo-cluster-config.yaml
as a result I got below errors,
[ℹ] eksctl version 0.35.0
[ℹ] using region us-west-2
[ℹ] setting availability zones to [us-west-2b us-west-2a us-west-2c]
[ℹ] subnets for us-west-2b - public:192.168.0.0/19 private:192.168.96.0/19
[ℹ] subnets for us-west-2a - public:192.168.32.0/19 private:192.168.128.0/19
[ℹ] subnets for us-west-2c - public:192.168.64.0/19 private:192.168.160.0/19
[ℹ] nodegroup "ng-6c4aa136" will use "ami-0f9f033f2355ab1f8" [AmazonLinux2/1.18]
[ℹ] using Kubernetes version 1.18
[ℹ] creating EKS cluster "my-demo" in "us-west-2" region with un-managed nodes
[ℹ] will create 2 separate CloudFormation stacks for cluster itself and the initial nodegroup
[ℹ] if you encounter any issues, check CloudFormation console or try 'eksctl utils describe-stacks --region=us-west-2 --cluster=my-demo'
[ℹ] CloudWatch logging will not be enabled for cluster "my-demo" in "us-west-2"
[ℹ] you can enable it with 'eksctl utils update-cluster-logging --enable-types={SPECIFY-YOUR-LOG-TYPES-HERE (e.g. all)} --region=us-west-2 --cluster=my-demo'
[ℹ] Kubernetes API endpoint access will use default of {publicAccess=true, privateAccess=false} for cluster "my-demo" in "us-west-2"
[ℹ] 2 sequential tasks: { create cluster control plane "my-demo", 3 sequential sub-tasks: { no tasks, create addons, create nodegroup "ng-6c4aa136" } }
[ℹ] building cluster stack "eksctl-my-demo-cluster"
[ℹ] deploying stack "eksctl-my-demo-cluster"
[✖] unexpected status "ROLLBACK_IN_PROGRESS" while waiting for CloudFormation stack "eksctl-my-demo-cluster"
[ℹ] fetching stack events in attempt to troubleshoot the root cause of the failure
[✖] AWS::IAM::Role/ServiceRole: CREATE_FAILED – "Resource creation cancelled"
[✖] AWS::EC2::InternetGateway/InternetGateway: CREATE_FAILED – "The maximum number of internet gateways
has been reached. (Service: AmazonEC2; Status Code: 400; Error Code: InternetGatewayLimitExceeded;
Request ID: e53b2d09-6d4a-4eef-b8ed-b52c1104bb89; Proxy: null)"
[✖] AWS::EC2::VPC/VPC: CREATE_FAILED – "The maximum number of VPCs has been reached. (Service: AmazonEC2; Status Code: 400; Error Code: VpcLimitExceeded; Request ID: e1dca3e9-6134-41d9-92a3-4bf44c0c375f; Proxy: null)"
[✖] AWS::EC2::EIP/NATIP: CREATE_FAILED – "The maximum number of addresses has been reached. (Service: AmazonEC2; Status Code: 400; Error Code: AddressLimitExceeded; Request ID: 50f1e75a-404f-40ff-820a-13a18a3d2f3f; Proxy: null)"
[!] 1 error(s) occurred and cluster hasn't been created properly, you may wish to check CloudFormation console
[ℹ] to cleanup resources, run 'eksctl delete cluster --region=us-west-2 --name=my-demo'
[✖] waiting for CloudFormation stack "eksctl-my-demo-cluster": ResourceNotReady: failed waiting for successful resource state
请帮我解决这个问题
默认情况下,创建一个新集群会创建一个VPC。由于每个区域都有VPC配额,因此尝试创建新的VPC可能会超过配额限制,导致创建集群失败。有几个解决方案:
1.请求增加配额
-
使用检查您当前的配额(确保使用正确的区域(
aws service-quotas get-service-quota --service-code vpc --quota-code L-F678F1CE --region us-east-1
-
响应应该是这样的(在这种情况下,配额是
5
(:
"Quota": {
"ServiceCode": "vpc",
"ServiceName": "Amazon Virtual Private Cloud (Amazon VPC)",
"QuotaArn": "arn:aws:servicequotas:us-east-1:570398916848:vpc/L-F678F1CE",
"QuotaCode": "L-F678F1CE",
"QuotaName": "VPCs per Region",
"Value": 5.0,
"Unit": "None",
"Adjustable": true,
"GlobalQuota": false
}
}
使用以下方法请求配额增加(在这种情况下,请求针对
10
(:aws service-quotas request-service-quota-increase --service-code vpc --quota-code L-F678F1CE --region us-east-1 --desired-value 10
一旦请求获得批准,您就可以创建集群
2.在现有VPC上创建集群
您需要从VPC中列出至少2个子网(至少2个公用或2个专用(
例如,对于公用子网,使用
--vpc-public-subnets
在你的情况下,命令应该是这样的(我已经升级了k8s版本(
eksctl create cluster --version 1.21 --region us-west-2 --node-type t3.medium --nodes 3 --nodes-min 1 --nodes-max 4 --name my-demo --kubeconfig=$HOME/kubeconfigs/demo-cluster-config.yaml --vpc-public-subnets=subnet-0153e560b3129a696,subnet-0cc9c5aebe75083fd```
您已达到VPC配额
通过与AWS支持创建票证或删除帐户中的其他VPC来提高配额。
从这些错误
[✖]AWS::EC2::VPC/VPC:CREATE_FAILED–"已达到VPC的最大数量。(服务:AmazonEC2;状态代码:400;错误代码:VpcLimitExceeded;请求ID:e1dca3e9-6134-41d9-92a3-4bf44c0c375f;代理:null(">
[✖]AWS::EC2::EIP/NATIP:CREATE_FAILED–";已达到地址的最大数目。(服务:AmazonEC2;状态代码:400;错误代码:AddressLimitExceeded;请求ID:50f1e75a-404f-40ff-820a-13a18a3d2f3f;代理:null(">
[✖]AWS::EC2::InternetGateway/InternetGateway:CREATE_FAILED–";已达到internet网关的最大数量。(服务:AmazonEC2;状态代码:400;错误代码:InternetGatewayLimitExceeded;请求ID:e53b2d09-6d4a-eef-b8ed-b52c1104b89;代理:null(">
我想指出的另一件事是,您正试图创建一个版本为1.14的集群,但这是不受支持的。然而,这并不是你所经历的失败的原因@sam蹒跚学步的孩子的答案是正确的。