How to use the resources provided here to spin up a single local VM and stand up a multi node Kubernetes cluster for your self upskilling in 40 seconds.
- If you have Windows 10 Pro, enable Hyper-V. Follow instructions at https://learn.microsoft.com/en-us/windows-server/virtualization/hyper-v/get-started/Install-Hyper-V?pivots=windows
- Install
multipass. Please refer to https://canonical.com/multipass/install for instructions on your Operatting System. - Run the following command in Powershell.
$Url = 'https://github.com/tsanghan/mcka/releases/latest/download/cloud-config.yaml' $Name = 'kind' multipass launch --cpus 2 --memory 4G --disk 20G --name $Name 24.04 --timeout 1200 --cloud-init $Url
- You will see the follwing messages,
Creating king Configuring kind Staring kind Waiting for initialization to complete Launched: kind
- To get information on your new Hyper-V VM.
multipass info kind
Output:
Name: kind
State: Running
Snapshots: 0
IPv4: XXX.XXX.XXX.XXX
172.17.0.1
10.254.254.1
...
- Note down the first IP adderess XXX.XXX.XXX.XXX
- Open your favorite SSH application, Putty/MobaXterm/Etc.
- Connect to XXX.XXX.XXX.XXX
- Login as
studentwith password asstudent - In the VM, change directory to
~/Projects/kind - Type the following command to stand up a multi node Kubernetes cluster.
kind create cluster --config kind.yaml
- Check your Kubernetes cluster
kubectl cluster-info --context kind-kind
- To destroy the VM type the following command in Powershell.
multipass stop kind multipass delete kind multipass purge
- For more information on
multipasscommand, please do read the documentation at https://canonical.com/multipass/docs - If you wan to customize the automation of this Hyper-V VM,
git clonethis repository, read Cloud-Init documentaiont at https://cloudinit.readthedocs.io/en/latest/index.html and start hacking.
- If you are on Windows 10, you will not have access to Hyper-V. However, you still have WSL.
- Enable WSL with instructions from https://learn.microsoft.com/en-us/windows/wsl/install\
- It is highly recommanded for you to do the following steps in Windows Terminal Powershell. Follow the instruction at https://learn.microsoft.com/en-us/windows/terminal/install to instal Windows Terminal.
- Create a new Folder on you Windows 10 file system.
- In Powershell, change directory to your new Folder.
- Download this file https://cloud-images.ubuntu.com/wsl/noble/current/ubuntu-noble-wsl-amd64-ubuntu.rootfs.tar.gz into your current Folder.
- Download this file https://github.com/tsanghan/mcka/releases/latest/download/cloud-config.yaml
- Copy the file
cloud-config.yamlto$HOME\.cloud-init\kind.user-data - If you are in CMD, the destination file will be
%userprofile%\.cloud-init\kind.user-data - Run the following command in Powershell,
wsl --import kind .\kind ubuntu-noble-wsl-amd64-ubuntu.rootfs.tar.gz
- You will see the messages show below.
Import in progress, this may take a few minutes. The operation completed successfully.
- Next type the following command.
wsl -d kind
- You will be droped into a
BASH shellasroot. - Wait till you are kick off the
BASH shelland back intoPowershell. - Back at Powershell, type the following command.
wsl -d kind -u student --cd ~
- You are starting up your new WSL distribution and will be drop into a
BASHsession asstudentand will be place intostudent's HOME directory. - In WSL, change directory to
~/Projects/kind - Type the following command to stand up a multi node Kubernetes cluster.
kind create cluster --config kind.yaml
- Check your Kubernetes cluster
kubectl cluster-info --context kind-kind
- To exit BASH shell, type
Ctrl-dto go back toPowershell - To destroy your WSL distribution.
wsl --unregister kind
- If you wan to customize the automation of this WSL distribution,
git clonethis repository, read Cloud-Init documentaiont at https://cloudinit.readthedocs.io/en/latest/index.html and start hacking.
1. kubectl 2. kind 3. Helm 4. docker 5. containerd 6. jq 7. genisoimage 8. k9s 9. minikube 10. cmctl 11. yq 12. cilium_cli 13. govc 14. PowerShell 15. pyenv 16. pipenv 17. xh 18. gh
