- Download and install Virtual box.
- Restart the mac holding down Command+R when the apple logo appears
- Login to your account and open up the terminal.
- Enable the following kernal extension provider (Oracle):
spctl kext-consent add VB5E2TV963
shutdown -r now
- After restarting, open VirtualBox and create the Ubuntu VM (including attaching the Ubuntu Server iso for installation)
- Install Ubuntu Server (default options)
- Start the VM and agree to any requested permissions.
- Install the Virtual Box software by mounting the Guest Additions CD (under Devices).
blkid
sudo mkdir /mnt/cdrom
sudo mount /dev/sr0 /mnt/cdrom
cd /mnt/cdrom
sudo sh ./VBoxLinuxAdditions.run
- Continue from step 4 in the Multipass instructions.
- Install Docker Desktop
- Install brew (if you don't have it already)
brew install kindkind create cluster
To check you did this right, run:
kubectl get all --all-namespaces
- Jump to step 7 in the instructions below to finish the install (you might not need to install kubectl)
- Install Multipass: https://multipass.run/docs/installing-on-macos
- Create a multipass VM:
multipass launch --name mysql --mem 4G --disk 15G --cpus 2 bionic - Login to the VM:
multipass shell mysql - Update Ubuntu:
sudo apt update
sudo apt upgrade
- Install Docker:
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
- Clone Kind:
git clone https://github.com/kubernetes-sigs/kind.git
sudo apt install make
cd kind
make install
sudo /home/ubuntu/go/bin/kind create cluster
- Clone this repo
git clone https://github.com/nathanstill/K8S-MySQL-Template.git
- Install Kubectl
sudo snap install kubectl --classic
- Apply the YAML file (modify password beforehand)
cd K8S-MySQL-Template/
sudo kubectl apply -f ./k8s-mysql-deploy.yaml
sudo kubectl get all --all-namespaces
- Repeat the last command as necessary until all pods are ready
- Run the following command to expose your mysql database to the local machine (outside the multipass VM)
sudo kubectl get service
ip addr show
sudo kubectl port-forward --address 0.0.0.0 service/mysql 3306:3306
sudo kubectl port-forward --address 0.0.0.0 service/adminer 8080:8080