Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Create an Amazon EKS Cluster Using Terraform

Use this procedure to create an Amazon EKS cluster using Terraform blueprints.

To simplify Amazon EKS cluster creation, we provide a Terraform blueprint that peforms the following:

  • creates a new sample VPC, 3 private subnets, and 3 public subnets using the default VPC CNI

  • creates Internet gateway for public subnets and NAT gateway for private subnets

  • creates an EKS Cluster called cn2cluster with one managed node group (desired nodes set to 3)

  • creates a role called cn2cluster-managed-ondemand that the managed nodes use

  1. Clone the Juniper Networks AWS Integration and Automation repository. This is where we store our Terraform EKS blueprints for creating an EKS cluster.
  2. Enable AWS account permissions for running Terraform. See https://developer.hashicorp.com/terraform/tutorials/aws-get-started/aws-build.
    The policy resource set in terraform-aws-eks-blueprints/examples/eks-cluster-with-cn2/min-iam-policy.json allows all resources. We recommend you change this in a real deployment.
  3. Run terraform init. This command initializes a working directory containing Terraform configuration files.
  4. Run terraform plan. This command creates an execution plan, which lets you preview the changes that Terraform plans to make to your infrastructure.
    Verify the resources created by this execution.
  5. Run terraform apply. This command executes the Terraform plan you just created.
    Enter yes to apply and create the cluster.
  6. Obtain the cluster name and other details of your new Amazon EKS cluster from the Terraform output or from the AWS Console.
  7. Copy the kubeconfig onto your local computer.
  8. Check over your new cluster.
    List your worker nodes:List all the pods:
  9. If you run into problems, clean up the cluster and try the installation again.
    To clean up the cluster, run the following Terraform commands to destroy the Kubernetes addons, the Amazon EKS cluster, and the VPC. You must run these commands from the examples/eks-cluster-with-cn2 directory.Then destroy any remaining resources:
Note:

Before installing CN2, disable transmit checksum offload on all your nodes. Disable the offload in a persistent manner (that survives reboots).

You've successfully created an Amazon EKS cluster. You're now ready to install CN2 on this cluster.