This repo contains a few scripts and YAML files to quickly bootstrap a Minikube lab environment in a semi-production quality fashion
for the purpose of rapid development of Kubernetes resources without having to spin up a full development cluster.
This repo is really meant for my personal use but I'm open sourcing it for those who may find it useful.
Assuming a Mac workstation you will need to do the following to get started:
- Install Homebrew
brew cask install minikube vmware-fusion docker
(Note: Installing VMware Fusion outside of brew may cause vmrun errors)brew install docker-machine-driver-vmware docker
- Run the customStart.sh to start Minikube using some custom parameters
The lab environment I use runs Minikube with a few custom parameters:
- Use VMware as the provider instead of VirtualBox
- 4 vCPUs
- 4GB RAM
- Setting the VMware Fusion subnet as an insecure registries subnet (This permits running a registry inside Minikube)
Once Minikube is up you should verify the IP it was assigned is in the range inside the code in this repo. If it is not
then you will need to edit customStart.sh, and the
MetalLB yml file to point to the correct IP range Minikube
uses on your machine and then run minikube delete
followed re-running the customStart.sh script.
After any IP changes are sorted out to build the lab out to a minimum standard do the following:
- Set your local docker environment to use the IP of the registry found in
kubectl get svc -n registry
- Pull
ahrenstein/debugging:latest
from Docker Hub, tag it as `{YOUR REGISTRY IP:PORT}/ahrenstein/debugging:latest and push it - Edit 01-test-site.yml to point to the newly pushed container
kubectl apply -f SourceCode/pods/01-test-site.yml
- Get the svc address of the test site from the
kube-public
namespace and visit it to verify it works - Develop whatever it is you needed to develop!
The Kubernetes Dashboard file is provided by "The Kubernetes Authors"
under the Apache 2.0 license and is their original work.
You can access the dashboard URL
using the admin-token secret with kubectl proxy
.
There are a few small caveats that come with this lab:
- The code in this repo assumes the IP range
172.16.148.0/24
as that is what Minikube is using via VMware Fusion on my workstation. This may be different on your machine, so you may need to adjust some code to get things working. - The registry's PV stores files in /data on the Minikube VM so deleting Minikube will result in data loss