Opinionated terraform way to deploy Kubernetes on AWS
HCL Makefile Shell
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
modules
scripts
.gitignore
Makefile
README.md
aws.tf
main.tf
outputs.tf
variables.tf

README.md

amazonetes

This repository provides an opinionated Terraform module to deploy a Kubernetes cluster on AWS using CoreOS.

It is a WORK IN PROGRESS, please use it on your own risk.

Index

Quick Start

It creates an etcd cluster and private docker registry with S3 storage backend, sets up a private Route53 DNS and then creates Kubernetes master and worker nodes. All internal traffic is encrypted using self signed certificates.

First, init terraform modules.

terraform get

Second , choose a public key of your ssh key. It will get uploaded to all instances so you can ssh via the bastion.

export TF_VAR_public_key='ssh-rsa...'

Next, use terraform plan command to preview infrastructure that will get created:

make plan DEPLOY_ENV=stage

Finally, if you are happy with planned changes, use terraform apply to deploy Kubernetes:

make apply DEPLOY_ENV=stage

You can delete the Kubernetes cluster using terraform destroy command:

make destroy DEPLOY_ENV=stage

Bastion

Once you run the apply command, Terraform will write nat_public_ip output to the console at the end of deployment.

In order to ssh to instances inside the VPC, run this script to create a local ssh.config file:

./scripts/render-ssh-config $NAT_PUBLIC_IP

Replace $NAT_PUBLIC_IP with the real value from Terraform outputs.

Then you will be able to ssh to instances like this:

ssh -F ssh.config 10.0.1.10