If you are looking to get into kubernetes and test things out locally, I recommend you install minikube. Minikube will let you run a single node kubernetes cluster which is great for local development and testing.
To get started on OSX you should first install VirtualBox.
Install minikube using homebrew:
brew install minikube
Once you have minikube installed, you can start the service using:
minikube start --driver=virtualbox
If you do not pass the driver switch above, minikube will install hyperkit for you as an alternative to virtualbox but you will have to supply your root password as this seems to require elevated permissions as it will run:
$ sudo chown root:wheel /Users/snad/.minikube/bin/docker-machine-driver-hyperkit
$ sudo chmod u+s /Users/snad/.minikube/bin/docker-machine-driver-hyperkit
I chose to use Virtualbox, and starting minikube gives me the following output:
😄 minikube v1.11.0 on Darwin 10.15.4
✨ Using the virtualbox driver based on user configuration
💿 Downloading VM boot image ...
> minikube-v1.11.0.iso.sha256: 65 B / 65 B [-------------] 100.00% ? p/s 0s
> minikube-v1.11.0.iso: 174.99 MiB / 174.99 MiB  100.00% 50.84 MiB p/s 4s
👍 Starting control plane node minikube in cluster minikube
💾 Downloading Kubernetes v1.18.3 preload ...
> preloaded-images-k8s-v3-v1.18.3-docker-overlay2-amd64.tar.lz4: 526.01 MiB
🔥 Creating virtualbox VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...
🐳 Preparing Kubernetes v1.18.3 on Docker 19.03.8 ...
🔎 Verifying Kubernetes components...
🌟 Enabled addons: default-storageclass, storage-provisioner
🏄 Done! kubectl is now configured to use "minikube"
You can check the status of your minikube service using:
This will respond with:
Behind the scenes minikube created a kubectl config change that allows your kubectl command to interact with your local minikube cluster. You can see this by looking at your kubectl config:
kubectl config view
Once you start using other clusters you can view and select your cluster by using the get-clusters and set-cluster commands.
Enjoy hacking with K8s!