Skip to main content

Dev Environment for Docker and Kubernetes

Updated Jan 24, 2021 ·

Overview

This project provisions a small public AWS environment for practicing Docker and Kubernetes setup with Terraform.

  • Version 1 is the preconfigured bootstrap version. The EC2 nodes are created with user data that installs the container runtime and common Kubernetes tooling during launch.

  • Version 2 is the from-scratch bootstrap version. The EC2 nodes are created first, then you can install and configure the container runtime, Kubernetes packages, and cluster components yourself. See Version 2.

Version 1

Use this version when you want the instances to come up with the main tooling already installed:

  • containerd
  • kubeadm
  • kubelet
  • kubectl
  • Docker Compose
  • NodeJS
  • Go
  • tree

The Terraform configuration creates:

  • A VPC
  • A public subnet
  • An internet gateway
  • A route table and route table association
  • A security group restricted to your IP
  • One master EC2 instance
  • Three worker EC2 instances
  • SSH config entries generated through Terraform provisioners

Project Files

PathPurpose
version-1/mainTerraform provider, resources, data sources, and outputs
version-1/varsVariable definitions and example values
version-1/template-files/userdata.tplInstalls the runtime and Kubernetes tooling
version-1/template-files/ssh-linux.tplGenerates a Linux or WSL SSH config entry
version-1/template-files/ssh-windows.tplGenerates a Windows SSH config entry