Important
Works only for macOS/ARM64
This repo is only for my personal use. I want to understand how Kubernetes works behind the hood by following the Kubernetes The Harder Way
I have stopped at the Installing Kubernetes Control Plane section.
An abstract numeric ID is assigned to VMs. This ID will come in handy in scripts when we want to differentiate between the VMs:
-
gateway
has ID 0 -
control
nodes have IDs 1 through 3 -
worker
nodes have IDs 4 through 6 -
Setup the vm
for vmid in $(seq 0 6); do ./vmsetup.sh $vmid done
-
Setup vm SSH
./vmssh.sh $vmid
-
Run a VM
sudo qemu-system-aarch64 \ -nographic \ -machine virt,accel=hvf,highmem=on \ -cpu host \ -smp 2 \ -m 2G \ -bios /opt/homebrew/share/qemu/edk2-aarch64-code.fd \ -nic vmnet-shared,start-address=192.168.1.1,end-address=192.168.1.20,subnet-mask=255.255.255.0,mac=52:52:52:00:00:00 \ -hda gateway/disk.img \ -drive file=gateway/cidata.iso,driver=raw,if=virtio
sudo ./vmlaunchall.sh kubenet-qemu
sudo tmux attach -t kubenet-qemu
sudo tmux kill-session -t kubenet-qemu
./vmsshall.sh kubenet-ssh
Ctrl
+Opt
+2
=> Switch to serial portCtrl
+Opt
+3
=> Switch to parallel portCtrl
+Opt
+2
=> Switch to monitor consoleCtrl
+Opt
+G
=> release mouse
Note
Run those commands in the auth
directory
- Generating certs & kubeconfigs:
./genauth.sh
- Generating cluster data encryption key:
./genenckey.sh
- Distributing certificates and keys:
./deployauth.sh
- Setting up local
kubeconfig
:./setuplocalkubeconfig.sh