In this lab you will setup a Kubernetes Cluster from scratch, without any help from tools like kubeadm, kubeone or others.
You will create a Kubernetes Cluster with 3 ControlPlane Nodes and 3 Worker Nodes.
Create the Network and VMs. (Docker network and containers)
Create the network:
cd /workspaces/kubernetes-fundamentals-for-ops/labs/01_magicless-kubernetes
cat ./010_network.sh
./010_network.sh
Create the Containers for the HA Cluster
- 3 Containers for the ControlPlane
- 3 Containers for the Worker Nodes
cat ./020_instances.sh
./020_instances.sh
Create the CA and the certificates for encrypted communication between the Kubernetes Components.
cat ./030_pki.sh
./030_pki.sh
Make use of the certificates to create the kubeconfigs for encrypted communication between the Kubernetes Components.
cat ./040_kubeconfigs.sh
./040_kubeconfigs.sh
Create a Kubernetes EncryptionConfig which ensures encrypted secrets in etcd.
cat ./050_encryption.sh
./050_encryption.sh
Create the 3 ControlPlane Nodes.
Copy the needed configs and sensitive data to the 3 VM instances.
./100_master-files.sh
Make use of Tmux for making changes on the 3 VMs
./110_master-tmux.sh
Install and start the etcd cluster.
bash ./120_master-etcd.sh
Download ControlPlane binaries and install configs and certs to their proper location.
bash ./130_master-kube-services-preps.sh
Install and start the kube-apiserver.
bash ./140_master-kube-apiserver.sh
Update keepalived
configuration and restart the service.
bash ./145_master-keepalived.sh
Install and start the kube-controller-manager.
bash ./150_master-kube-controller-manager.sh
Install and start the kube-scheduler.
bash ./160_master-kube-scheduler.sh
Now you can exit tmux by typing
exit
twice
Configure Kubernetes for enabling communication from the api-server to the kubelets via RBAC.
cat ./170_master-kubelet-rbac.sh
./170_master-kubelet-rbac.sh
Prepare 3 the Worker Nodes.
Copy the needed configs and sensitive data to the 3 VM instances.
./200_worker-files.sh
Make use of Tmux for making changes on the 3 VMs
./210_worker-tmux.sh
Install and start the containerd.
bash ./220_worker_cre.sh
Install and start the kubelets.
bash ./230_worker_kubelet.sh
Install and start the kube-proxys.
bash ./240_worker_kube-proxy.sh
Install the bridge CNI plugin and install config files to the proper location.
bash ./250_worker_cni.sh
Now you can exit tmux by typing
exit
twice
Due to the use of the bridge CNI plugin we have to create routes between the worker nodes.
./300_routes.sh
Verify everything is working.
Test if workloads can be deployed and can be reached afterwards via curl.
./410_smoke-test-deployment.sh
Test if secrets are encrypted in etcd.
./420_smoke-test-secret.sh