A series

Kubernetes, the Platform Way

How a cluster comes to exist.

The Engineering Way runs apps on a cluster someone else built. This series builds the cluster. You start with the hard way: three EC2 instances, every certificate and config file by hand. Then you see what the tools do for you.

Before you start
  • Everything is on these pages. Each part has the full, commented scripts for its step. Copy them into one folder, ~/k8s-hard-way, and run them in order.
  • It costs about $0.08 an hour while it runs: three t3.small instances, disks and public IPs. One script deletes everything and proves it.
  • No inbound ports. The security group has no rule from the internet. You reach the machines, and the API server, through AWS Session Manager.
  • You need an AWS account, the AWS CLI, jq, openssl, kubectl and the Session Manager plugin.
What you build
VPC 10.240.0.0/24, no inbound from the internet
server 10.240.0.10
etcd
API server
controller manager
scheduler
node-0 Pods 10.200.0.0/24
containerd, kubelet, kube-proxy
node-1 Pods 10.200.1.0/24
containerd, kubelet, kube-proxy

The hard way

Six parts, in order. Each one: the commands, what they do, how to check, and the idea behind them.

  1. Network and machines VPC, security group, IAM role and three instances. No way in from the internet.
  2. Certificates and configs The CA, nine certificates, six kubeconfigs and the encryption key.
  3. etcd and the control plane etcd, the API server, the controller manager and the scheduler.
  4. Workers containerd, CNI, kubelet and kube-proxy on two workers.
  5. Routes, tunnel and DNS Routes between nodes, an SSM tunnel for kubectl, and CoreDNS.
  6. Check it, then tear it down Seven checks with evidence, then delete everything with proof.
Credits and license
  • This series is inspired by, and follows the order of, Kelsey Hightower's Kubernetes The Hard Way and Slawek Zachcial's AWS version, its AWS adaptation. Kelsey's guide is licensed CC BY-NC-SA 4.0.
  • The scripts and text on these pages are written independently, not copied. What differs: no jumpbox, access only through SSM, Amazon Linux, a DNS step, Kubernetes 1.37, and a teardown that proves nothing is left.
  • The text and scripts in this series are shared under CC BY-NC-SA 4.0: credit the author, no commercial use, and share adaptations the same way.

Then

  1. A cluster with kubeadmSoon The same cluster in a few commands, and what kubeadm does for you.
  2. Cluster APISoon Create and upgrade clusters by writing YAML.
  3. A highly available control planeSoon Three control plane nodes and a real etcd cluster.