Skip to content

tsanghan/mcka

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mcka

More Commonly Known As

(Multipass Cloud-Config KinD) × And

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.

For Windows 10 Pro

  1. 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
  2. Install multipass. Please refer to https://canonical.com/multipass/install for instructions on your Operatting System.
  3. 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
  1. You will see the follwing messages,
Creating king
Configuring kind
Staring kind
Waiting for initialization to complete
Launched: kind
  1. 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
...
  1. Note down the first IP adderess XXX.XXX.XXX.XXX
  2. Open your favorite SSH application, Putty/MobaXterm/Etc.
  3. Connect to XXX.XXX.XXX.XXX
  4. Login as student with password as student
  5. In the VM, change directory to ~/Projects/kind
  6. Type the following command to stand up a multi node Kubernetes cluster.
kind create cluster --config kind.yaml
  1. Check your Kubernetes cluster
kubectl cluster-info --context kind-kind
  1. To destroy the VM type the following command in Powershell.
multipass stop kind
multipass delete kind
multipass purge
  1. For more information on multipass command, please do read the documentation at https://canonical.com/multipass/docs
  2. If you wan to customize the automation of this Hyper-V VM, git clone this repository, read Cloud-Init documentaiont at https://cloudinit.readthedocs.io/en/latest/index.html and start hacking.

For Windows 10

  1. If you are on Windows 10, you will not have access to Hyper-V. However, you still have WSL.
  2. Enable WSL with instructions from https://learn.microsoft.com/en-us/windows/wsl/install\
  3. 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.
  4. Create a new Folder on you Windows 10 file system.
  5. In Powershell, change directory to your new Folder.
  6. Download this file https://cloud-images.ubuntu.com/wsl/noble/current/ubuntu-noble-wsl-amd64-ubuntu.rootfs.tar.gz into your current Folder.
  7. Download this file https://github.com/tsanghan/mcka/releases/latest/download/cloud-config.yaml
  8. Copy the file cloud-config.yaml to $HOME\.cloud-init\kind.user-data
  9. If you are in CMD, the destination file will be %userprofile%\.cloud-init\kind.user-data
  10. Run the following command in Powershell,
wsl --import kind .\kind ubuntu-noble-wsl-amd64-ubuntu.rootfs.tar.gz
  1. You will see the messages show below.
Import in progress, this may take a few minutes.
The operation completed successfully.
  1. Next type the following command.
wsl -d kind
  1. You will be droped into a BASH shell as root.
  2. Wait till you are kick off the BASH shell and back into Powershell.
  3. Back at Powershell, type the following command.
wsl -d kind -u student --cd ~
  1. You are starting up your new WSL distribution and will be drop into a BASH session as student and will be place into student's HOME directory.
  2. In WSL, change directory to ~/Projects/kind
  3. Type the following command to stand up a multi node Kubernetes cluster.
kind create cluster --config kind.yaml
  1. Check your Kubernetes cluster
kubectl cluster-info --context kind-kind
  1. To exit BASH shell, type Ctrl-d to go back to Powershell
  2. To destroy your WSL distribution.
wsl --unregister kind
  1. If you wan to customize the automation of this WSL distribution, git clone this repository, read Cloud-Init documentaiont at https://cloudinit.readthedocs.io/en/latest/index.html and start hacking.

Utility installed

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages