kubernetes-the-hard-way-on-docker
kubernetes-the-hard-way-on-docker copied to clipboard
Another Kubernetes the hard way, but purely on Docker within your laptop!
Kubernetes The Hard Way on Docker
It's a must-have skill along the CKA journey by using not just kubectl
, but administrator tools like kubeadm
to build Kubernetes cluster from scratch.
While reviewing the Kubernetes the Kubeadmin Way
I compiled last year, during my CKA preparation, well, I feel that it's quite costly on any of cloud providers and I won't suggest you to do so just for practice purposes.
There are a lot of great tools which can help you craft a Kubernetes cluster within minutes on Docker, like:
But, we want the hard way instead of automated way so we can learn more.
That's the motivation of this repo and I'll guide you through to:
- build a set of workable Docker images;
- spin up the Kubernetes nodes by Docker containers;
- bootstrap and eventually build a "fully-fledged" multi-node Kubernetes, on Docker, within exactly your laptop!
Target Audience
The target audience for this tutorial is someone planning to build highly available OSS Kubernetes clusters by purely using the official tooling Kubeadm
, simply on your laptop's Docker, without any real $$$ cost like what we do on cloud providers!
OS, Tools, Components and Versions
- Working Laptop: MacBook Pro with macOS Catalina, but I believe it should work wherever Docker runs
- Docker Desktop with Engine v19.03.8
- kubeadm v1.18.5, as of writing
- kubernetes v1.8.5, as of writing
- containerd v1.3.4
- runc v1.0.0-rc90
- Any of the CNIs, like:
Labs
This tutorial assumes you have Docker installed.
- 01-build-images
- 02-spinup-containers-as-nodes
- 03-prepare-all-nodes
- 04-bootstrap-control-plane
- 05-join-nodes
- 06-install-cni-plugin
- 07-access-it-from-laptop
- 08-clean-up
Materials / References
-
/images
: the images I use to spin up the cluster, withDockerfile
s inside -
/config
: the folder structure and files I use to configure and bootstrap the Kubernetes -
/docs
: the step-by-step labs
Furture Works
- To do more research to rebuild the core k8s-ready image with bare minimum components pre-installed;
- To spin up the containers by using footloose instead of bash scripts