Skip to content

Latest commit

 

History

History
61 lines (38 loc) · 1.19 KB

README.md

File metadata and controls

61 lines (38 loc) · 1.19 KB

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