Browse the Repo

file-type-icon.circleci
file-type-icon_docs
file-type-iconexamples
file-type-iconeks-cluster-managed-workers
file-type-iconeks-cluster-with-iam-role-mappings
file-type-iconuser-data
file-type-iconREADME.md
file-type-icondependencies.tf
file-type-iconmain.tf
file-type-iconoutputs.tf
file-type-iconvariables.tf
file-type-iconeks-cluster-with-supporting-services
file-type-iconeks-fargate-cluster-with-irsa
file-type-iconeks-fargate-cluster-with-supporting-services
file-type-iconeks-fargate-cluster
file-type-iconREADME.md
file-type-iconmodules
file-type-iconrfc
file-type-icontest
file-type-icon.gitignore
file-type-icon.pre-commit-config.yaml
file-type-iconCODEOWNERS
file-type-iconCONTRIBUTING.md
file-type-iconGRUNTWORK_PHILOSOPHY.md
file-type-iconLICENSE.md
file-type-iconREADME.adoc
file-type-iconcore-concepts.md
file-type-iconsetup.cfg

Browse the Repo

file-type-icon.circleci
file-type-icon_docs
file-type-iconexamples
file-type-iconeks-cluster-managed-workers
file-type-iconeks-cluster-with-iam-role-mappings
file-type-iconuser-data
file-type-iconREADME.md
file-type-icondependencies.tf
file-type-iconmain.tf
file-type-iconoutputs.tf
file-type-iconvariables.tf
file-type-iconeks-cluster-with-supporting-services
file-type-iconeks-fargate-cluster-with-irsa
file-type-iconeks-fargate-cluster-with-supporting-services
file-type-iconeks-fargate-cluster
file-type-iconREADME.md
file-type-iconmodules
file-type-iconrfc
file-type-icontest
file-type-icon.gitignore
file-type-icon.pre-commit-config.yaml
file-type-iconCODEOWNERS
file-type-iconCONTRIBUTING.md
file-type-iconGRUNTWORK_PHILOSOPHY.md
file-type-iconLICENSE.md
file-type-iconREADME.adoc
file-type-iconcore-concepts.md
file-type-iconsetup.cfg
EC2 Kubernetes Service (EKS) Cluster

EC2 Kubernetes Service (EKS) Cluster

Deploy a Kubernetes cluster on top of Amazon EC2 Kubernetes Service (EKS).

Code Preview

Preview the Code

mobile file icon

README.md

down

EKS Cluster with Self Managed Workers and Additional IAM Roles

This folder shows an example of how to use the EKS modules to:

  • deploy an EKS cluster
  • deploy a self managed worker pool
  • setup kubectl to deploy applications on it using the Kubernetes interface
  • create a sample IAM role and bind a Kubernetes RBAC group to it

After this example, your kubectl binary should be configured to access the EKS cluster. See How do I authenticate kubectl to the EKS cluster? for more information.

How do you run this example?

To run this example, apply the Terraform templates:

  1. Install kubergrunt, minimum version: 0.5.3.
  2. Install Terraform, minimum version: 0.12.6.
  3. Open variables.tf, set the environment variables specified at the top of the file, and fill in any other variables that don't have a default.
  4. Run terraform init.
  5. Run terraform apply.

Known instabilities

  • EKS relies on the amazon-vpc-cni-k8s plugin to allocate IP addresses to the pods in the Kubernetes cluster. This plugin works by allocating secondary ENI devices to the underlying worker instances. Depending on timing, this plugin could interfere with destroying the cluster in this example. Specifically, terraform could shutdown the instances before the VPC CNI pod had a chance to cull the ENI devices. These devices are managed outside of terraform, so if they linger, it could interfere with destroying the VPC.
    • To workaround this limitation, you have to go into the console and delete the ENI associated with the VPC. Then, retry the destroy call.

Questions? Ask away.

We're here to talk about our services, answer any questions, give advice, or just to chat.

Ready to hand off the Gruntwork?