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-iconeks-cluster-with-supporting-services
file-type-iconeks-fargate-cluster-with-irsa
file-type-iconREADME.md
file-type-icondependencies.tf
file-type-iconmain.tf
file-type-iconoutputs.tf
file-type-iconvariables.tf
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-iconeks-cluster-with-supporting-services
file-type-iconeks-fargate-cluster-with-irsa
file-type-iconREADME.md
file-type-icondependencies.tf
file-type-iconmain.tf
file-type-iconoutputs.tf
file-type-iconvariables.tf
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 IAM Role for Service Accounts (IRSA)

This folder shows an example of how to use the EKS modules to deploy an EKS cluster with support for IAM Roles for Service Accounts (IRSA). See the official docs for more information on IRSA.

Note that by default this example does not setup kubectl to be able to access the cluster. You can use kubergrunt or the AWS CLI to configure kubectl to authenticate to the deployed 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.

Assigning the IAM Role to a Pod

By default this example creates an IAM role with permissions to list EKS clusters that is configured to be assumed by Service Accounts in the default Namespace. You can exchange the Service Account token for any Service Account in the default Namespace for IAM credentials that correspond to the created IAM role. Refer to How do I associate IAM roles to the Pods? section of the eks-cluster-control-plane module README for more information on how to do that.

You can allow additional or different Namespaces by modifying the allowed_namespaces_for_iam_role input parameter. You can also restrict to specific Service Accounts by using the allowed_service_accounts_for_iam_role input parameter.

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?