How do i create an aws eks cluster using the cli?



  • There are some pre-reqs that need to be done before creating a AWS EKS cluster.

    • Allow permissions for the user creating the cluster, either through a role (recommended) or adding AWS managed policies to the user account.
    • Create a VPC, with three subnets across three availability zones.
    • A security group for the cluster control plane, no inbound rules, but outbound rule for traffic to communicate with the worker nodes. Make this a dedicated security group.
    • aws configure API keys are in place.

    Note: AWS EKS is only available in two regions at the present time. us-west-2 and us-east-1

    Create a cluster after the pre-reqs have been put into place. All highlighted parts need to be changed to your values, from the pre-reqs.

    $ aws eks create-cluster --name trainingeks --role-arn arn:aws:iam::111122223333:role/eksServiceRole --resources-vpc-config subnetIds=subnet-a9189fe2,subnet-50432629,subnet-50432630,securityGroupIds=sg-f5c54184

    The command to verify the cluster is active.

    $ aws eks describe-cluster --name trainingeks --query cluster.status
    "ACTIVE"
    

Log in to reply
 

© Lightnetics 2024