This is an example of a terraform setup for installing a basic AWS EKS (K8s) cluster with worker nodes.
- Heptio authenticator + go
kubectl
go get -u -v github.com/heptio/authenticator/cmd/heptio-authenticator-aws
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"
}
Run the following:
terraform init
terraform plan
terraform apply
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.
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