Skip to content

Example of terraform setup for installing basic AWS EKS K8s cluster

Notifications You must be signed in to change notification settings

sbkg0002/aws-eks-terraform

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aws-eks-terraform

This is an example of a terraform setup for installing a basic AWS EKS (K8s) cluster with worker nodes.

Pre-requisites

  1. Heptio authenticator + go
  2. kubectl

heptio

go get -u -v github.com/heptio/authenticator/cmd/heptio-authenticator-aws

Install the cluster

Prepare your locals file

locals.tf:

# Configure your machine to access the k8s cluster
locals {
  workstation-external-cidr = "{your-ip}/32"
}

# Configure the AWS Secrets
variable "aws_access_key" {
  default = "blahblah"
}

variable "aws_secret_key" {
  default = "blahblah"
}

Bring up the infrastructure

Run the following:

terraform init
terraform plan
terraform apply

Getting access to the cluster

The output of terraform apply should give you a kubeconfig var. Alternatively, run terraform output kubeconfig

Throw that into a file and use it as your KUBECONFIG file (or one of). Switch to that context.

Enable the worker nodes to connect

The output of terraform apply should give you a config-map-aws-auth var. Alternatively run terraform output config-map-aws-auth.

Throw that into a file and kubectl apply it to the cluster

About

Example of terraform setup for installing basic AWS EKS K8s cluster

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HCL 100.0%