eksctl create cluster

From wikieduonline
Revision as of 20:52, 28 November 2021 by Welcome (talk | contribs)
Jump to navigation Jump to search

https://eksctl.io/usage/creating-and-managing-clusters/

Examples

eksctl create cluster
eksctl create cluster 'your-sample-cluster' --spot --instance-types=t3.small
eksctl create cluster 'your-sample-cluster' --spot --instance-types=t3.nano
eksctl create cluster 'your-sample-cluster' --zones us-east-1a,us-east-1b,us-east-1c
eksctl create cluster -f cluster.yaml

It will create one managed nodegroup containing two m5.large nodes

eksctl create cluster --spot --instance-types=t3.nano
eksctl create cluster --spot --instance-types=c3.large,c4.large,c5.large


eksctl create cluster 'your-sample-cluster' --zones us-east-1a,us-east-1b,us-east-1c
(It will take approximately 20 minutes to finish)


Execution examples

eksctl create cluster --spot --instance-types=t3.nano
2021-11-28 19:14:45 [ℹ]  eksctl version 0.73.0
2021-11-28 19:14:45 [ℹ]  using region us-east-2
2021-11-28 19:14:46 [ℹ]  setting availability zones to [us-east-2c us-east-2b us-east-2a]
2021-11-28 19:14:46 [ℹ]  subnets for us-east-2c - public:192.168.0.0/19 private:192.168.96.0/19
2021-11-28 19:14:46 [ℹ]  subnets for us-east-2b - public:192.168.32.0/19 private:192.168.128.0/19
2021-11-28 19:14:46 [ℹ]  subnets for us-east-2a - public:192.168.64.0/19 private:192.168.160.0/19
2021-11-28 19:14:46 [ℹ]  nodegroup "ng-db89f916" will use "" [AmazonLinux2/1.21]
2021-11-28 19:14:46 [ℹ]  using Kubernetes version 1.21
2021-11-28 19:14:46 [ℹ]  creating EKS cluster "hilarious-painting-1638116084" in "us-east-2" region with managed nodes
2021-11-28 19:14:46 [ℹ]  will create 2 separate CloudFormation stacks for cluster itself and the initial managed nodegroup
2021-11-28 19:14:46 [ℹ]  if you encounter any issues, check CloudFormation console or try 'eksctl utils describe-stacks --region=us-east-2 --cluster=hilarious-painting-1638116084'
2021-11-28 19:14:46 [ℹ]  CloudWatch logging will not be enabled for cluster "hilarious-painting-1638116084" in "us-east-2"
2021-11-28 19:14:46 [ℹ]  you can enable it with 'eksctl utils update-cluster-logging --enable-types={SPECIFY-YOUR-LOG-TYPES-HERE (e.g. all)} --region=us-east-2 --cluster=hilarious-painting-1638116084'
2021-11-28 19:14:46 [ℹ]  Kubernetes API endpoint access will use default of {publicAccess=true, privateAccess=false} for cluster "hilarious-painting-1638116084" in "us-east-2"
2021-11-28 19:14:46 [ℹ]
2 sequential tasks: { create cluster control plane "hilarious-painting-1638116084",
    2 sequential sub-tasks: {
        wait for control plane to become ready,
        create managed nodegroup "ng-db89f916",
    }
}
2021-11-28 19:14:46 [ℹ]  building cluster stack "eksctl-hilarious-painting-1638116084-cluster"
2021-11-28 19:14:48 [ℹ]  deploying stack "eksctl-hilarious-painting-1638116084-cluster"
2021-11-28 19:15:18 [ℹ]  waiting for CloudFormation stack "eksctl-hilarious-painting-1638116084-cluster"
2021-11-28 19:15:49 [ℹ]  waiting for CloudFormation stack "eksctl-hilarious-painting-1638116084-cluster"
2021-11-28 19:16:50 [ℹ]  waiting for CloudFormation stack "eksctl-hilarious-painting-1638116084-cluster"
2021-11-28 19:17:51 [ℹ]  waiting for CloudFormation stack "eksctl-hilarious-painting-1638116084-cluster"
2021-11-28 19:18:51 [ℹ]  waiting for CloudFormation stack "eksctl-hilarious-painting-1638116084-cluster"
2021-11-28 19:19:52 [ℹ]  waiting for CloudFormation stack "eksctl-hilarious-painting-1638116084-cluster"
2021-11-28 19:20:53 [ℹ]  waiting for CloudFormation stack "eksctl-hilarious-painting-1638116084-cluster"
2021-11-28 19:21:54 [ℹ]  waiting for CloudFormation stack "eksctl-hilarious-painting-1638116084-cluster"
2021-11-28 19:22:55 [ℹ]  waiting for CloudFormation stack "eksctl-hilarious-painting-1638116084-cluster"
2021-11-28 19:23:56 [ℹ]  waiting for CloudFormation stack "eksctl-hilarious-painting-1638116084-cluster"
2021-11-28 19:24:57 [ℹ]  waiting for CloudFormation stack "eksctl-hilarious-painting-1638116084-cluster"
2021-11-28 19:26:45 [ℹ]  waiting for CloudFormation stack "eksctl-hilarious-painting-1638116084-cluster"
2021-11-28 19:27:46 [ℹ]  waiting for CloudFormation stack "eksctl-hilarious-painting-1638116084-cluster"
2021-11-28 19:29:53 [ℹ]  building managed nodegroup stack "eksctl-hilarious-painting-1638116084-nodegroup-ng-db89f916"
2021-11-28 19:29:54 [ℹ]  deploying stack "eksctl-hilarious-painting-1638116084-nodegroup-ng-db89f916"
2021-11-28 19:29:54 [ℹ]  waiting for CloudFormation stack "eksctl-hilarious-painting-1638116084-nodegroup-ng-db89f916"
2021-11-28 19:30:11 [ℹ]  waiting for CloudFormation stack "eksctl-hilarious-painting-1638116084-nodegroup-ng-db89f916"
2021-11-28 19:30:33 [ℹ]  waiting for CloudFormation stack "eksctl-hilarious-painting-1638116084-nodegroup-ng-db89f916"
2021-11-28 19:30:54 [ℹ]  waiting for CloudFormation stack "eksctl-hilarious-painting-1638116084-nodegroup-ng-db89f916"
2021-11-28 19:31:11 [ℹ]  waiting for CloudFormation stack "eksctl-hilarious-painting-1638116084-nodegroup-ng-db89f916"
2021-11-28 19:31:32 [ℹ]  waiting for CloudFormation stack "eksctl-hilarious-painting-1638116084-nodegroup-ng-db89f916"
2021-11-28 19:31:52 [ℹ]  waiting for CloudFormation stack "eksctl-hilarious-painting-1638116084-nodegroup-ng-db89f916"
2021-11-28 19:32:12 [ℹ]  waiting for CloudFormation stack "eksctl-hilarious-painting-1638116084-nodegroup-ng-db89f916"
2021-11-28 19:32:29 [ℹ]  waiting for CloudFormation stack "eksctl-hilarious-painting-1638116084-nodegroup-ng-db89f916"
2021-11-28 19:32:48 [ℹ]  waiting for CloudFormation stack "eksctl-hilarious-painting-1638116084-nodegroup-ng-db89f916"
2021-11-28 19:33:05 [ℹ]  waiting for CloudFormation stack "eksctl-hilarious-painting-1638116084-nodegroup-ng-db89f916"
2021-11-28 19:33:07 [ℹ]  waiting for the control plane availability...
2021-11-28 19:33:07 [✔]  saved kubeconfig as "/Users/your_user/.kube/config"
2021-11-28 19:33:07 [ℹ]  no tasks
2021-11-28 19:33:07 [✔]  all EKS cluster resources for "hilarious-painting-1638116084" have been created
2021-11-28 19:33:08 [ℹ]  nodegroup "ng-db89f916" has 2 node(s)
2021-11-28 19:33:08 [ℹ]  node "ip-192-168-0-208.us-east-2.compute.internal" is ready
2021-11-28 19:33:08 [ℹ]  node "ip-192-168-54-235.us-east-2.compute.internal" is ready
2021-11-28 19:33:08 [ℹ]  waiting for at least 2 node(s) to become ready in "ng-db89f916"
2021-11-28 19:33:08 [ℹ]  nodegroup "ng-db89f916" has 2 node(s)
2021-11-28 19:33:08 [ℹ]  node "ip-192-168-0-208.us-east-2.compute.internal" is ready
2021-11-28 19:33:08 [ℹ]  node "ip-192-168-54-235.us-east-2.compute.internal" is ready
2021-11-28 19:33:10 [ℹ]  kubectl command should work with "/Users/your_user/.kube/config", try 'kubectl get nodes'
2021-11-28 19:33:10 [✔]  EKS cluster "hilarious-painting-1638116084" in "us-east-2" region is ready

Output with errors

eksctl create cluster
2021-11-12 20:43:10 [ℹ]  eksctl version 0.73.0
2021-11-12 20:43:10 [ℹ]  using region us-east-1
2021-11-12 20:43:11 [ℹ]  setting availability zones to [us-east-1e us-east-1f]
2021-11-12 20:43:11 [ℹ]  subnets for us-east-1e - public:192.168.0.0/19 private:192.168.64.0/19
2021-11-12 20:43:11 [ℹ]  subnets for us-east-1f - public:192.168.32.0/19 private:192.168.96.0/19
2021-11-12 20:43:11 [ℹ]  nodegroup "ng-a832f99e" will use "" [AmazonLinux2/1.21]
2021-11-12 20:43:11 [ℹ]  using Kubernetes version 1.21
2021-11-12 20:43:11 [ℹ]  creating EKS cluster "wonderful-sheepdog-1636746186" in "us-east-1" region with managed nodes
2021-11-12 20:43:11 [ℹ]  will create 2 separate CloudFormation stacks for cluster itself and the initial managed nodegroup
2021-11-12 20:43:11 [ℹ]  if you encounter any issues, check CloudFormation console or try 'eksctl utils describe-stacks --region=us-east-1 --cluster=wonderful-sheepdog-1636746186'
2021-11-12 20:43:11 [ℹ]  CloudWatch logging will not be enabled for cluster "wonderful-sheepdog-1636746186" in "us-east-1"
2021-11-12 20:43:11 [ℹ]  you can enable it with 'eksctl utils update-cluster-logging --enable-types={SPECIFY-YOUR-LOG-TYPES-HERE (e.g. all)} --region=us-east-1 --cluster=wonderful-sheepdog-1636746186'
2021-11-12 20:43:11 [ℹ]  Kubernetes API endpoint access will use default of {publicAccess=true, privateAccess=false} for cluster "wonderful-sheepdog-1636746186" in "us-east-1"
2021-11-12 20:43:11 [ℹ]
2 sequential tasks: { create cluster control plane "wonderful-sheepdog-1636746186",
    2 sequential sub-tasks: {
        wait for control plane to become ready,
        create managed nodegroup "ng-a832f99e",
    }
}
2021-11-12 20:43:11 [ℹ]  building cluster stack "eksctl-wonderful-sheepdog-1636746186-cluster"
2021-11-12 20:43:12 [ℹ]  deploying stack "eksctl-wonderful-sheepdog-1636746186-cluster"
2021-11-12 20:43:42 [ℹ]  waiting for CloudFormation stack "eksctl-wonderful-sheepdog-1636746186-cluster"
2021-11-12 20:44:13 [ℹ]  waiting for CloudFormation stack "eksctl-wonderful-sheepdog-1636746186-cluster"
2021-11-12 20:44:14 [✖]  unexpected status "ROLLBACK_IN_PROGRESS" while waiting for CloudFormation stack "eksctl-wonderful-sheepdog-1636746186-cluster"
2021-11-12 20:44:14 [ℹ]  fetching stack events in attempt to troubleshoot the root cause of the failure
2021-11-12 20:44:14 [✖]  AWS::EC2::SubnetRouteTableAssociation/RouteTableAssociationPrivateUSEAST1E: CREATE_FAILED – "Resource creation cancelled"
2021-11-12 20:44:14 [✖]  AWS::EC2::NatGateway/NATGateway: CREATE_FAILED – "Resource creation cancelled"
2021-11-12 20:44:14 [✖]  AWS::EC2::SubnetRouteTableAssociation/RouteTableAssociationPublicUSEAST1F: CREATE_FAILED – "Resource creation cancelled"
2021-11-12 20:44:14 [✖]  AWS::EC2::SubnetRouteTableAssociation/RouteTableAssociationPrivateUSEAST1F: CREATE_FAILED – "Resource creation cancelled"
2021-11-12 20:44:14 [✖]  AWS::EC2::Route/PublicSubnetRoute: CREATE_FAILED – "Resource creation cancelled"
2021-11-12 20:44:14 [✖]  AWS::EC2::SubnetRouteTableAssociation/RouteTableAssociationPublicUSEAST1E: CREATE_FAILED – "Resource creation cancelled"
2021-11-12 20:44:14 [✖]  AWS::EKS::Cluster/ControlPlane: CREATE_FAILED – "Resource handler returned message: \"Cannot create cluster 'wonderful-sheepdog- 
1636746186' because us-east-1e, the targeted availability zone, does not currently have sufficient capacity to support the cluster. Retry and choose from these 
availability zones: us-east-1a, us-east-1b, us-east-1c, us-east-1d, us-east-1f (Service: Eks, Status Code: 400, Request ID: 0a041b95-8225-4e1e-a637- 
c8fbf6ecedf3, Extended Request ID: null)\" (RequestToken: xxxxecbbd-b6de-xxx-e1d5-c0e5a40b2569, HandlerErrorCode: InvalidRequest)"
2021-11-12 20:44:14 [!]  1 error(s) occurred and cluster hasn't been created properly, you may wish to check CloudFormation console
2021-11-12 20:44:14 [ℹ]  to cleanup resources, run 'eksctl delete cluster --region=us-east-1 --name=wonderful-sheepdog-1636746186'
2021-11-12 20:44:14 [✖]  ResourceNotReady: failed waiting for successful resource state
Error: failed to create cluster "wonderful-sheepdog-1636746186"

Related

See also

Advertising: