Skip to content

nathanstill/K8S-MySQL-Template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Install VirtualBox

  1. Download and install Virtual box.
  2. Restart the mac holding down Command+R when the apple logo appears
  3. Login to your account and open up the terminal.
  4. Enable the following kernal extension provider (Oracle):
spctl kext-consent add VB5E2TV963
shutdown -r now
  1. After restarting, open VirtualBox and create the Ubuntu VM (including attaching the Ubuntu Server iso for installation)
  2. Install Ubuntu Server (default options)
  3. Start the VM and agree to any requested permissions.
  4. 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
  1. Continue from step 4 in the Multipass instructions.

Install KIND (Kubernetes in Docker)

  1. Install Docker Desktop
  2. Install brew (if you don't have it already)
  3. brew install kind
  4. kind create cluster

To check you did this right, run:

kubectl get all --all-namespaces
  1. Jump to step 7 in the instructions below to finish the install (you might not need to install kubectl)

Install KIND In Multipass (if the above method doesn't work)

  1. Install Multipass: https://multipass.run/docs/installing-on-macos
  2. Create a multipass VM: multipass launch --name mysql --mem 4G --disk 15G --cpus 2 bionic
  3. Login to the VM: multipass shell mysql
  4. Update Ubuntu:
sudo apt update
sudo apt upgrade
  1. 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
  1. 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
  1. Clone this repo
git clone https://github.com/nathanstill/K8S-MySQL-Template.git
  1. Install Kubectl
sudo snap install kubectl --classic
  1. 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
  1. Repeat the last command as necessary until all pods are ready
  2. 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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published