Local Setup with Minikube
Minikube implements a local Kubernetes cluster on macOS, Linux, and Windows.
The primary goal of minikube is to make it simple to run Kubernetes locally, for day-to-day development workflows and learning purposes.
Following are the guiding principles for Minikube.
- Inclusive and community-driven
- Support all Kubernetes features
- High Performance
- Developer Focused
Here are some specific minikube features that align with our goal:
- Single command setup and teardown UX
- Support for local storage, networking, auto-scaling, load balancing, etc.
- Unified UX across operating systems
- Minimal dependencies on third party software
- Minimal resource overhead
Following are highlights on Minikube:
- Minikube is a tool that makes it easy to run Kubernetes locally.
- Minikube runs a single-node Kubernetes cluster inside a Linux VM.
- It’s aimed on users who want to just test it out or use it for development.
- It cannot spin-up a production cluster, it’s a one node machine with no high availability.
- It works on Windows, Linux, and MacOS
- You will need Virtualization Software installed to run Minikube. For example, you can use VirtualBox, as its free and downloaded from – https://www.virtualbox.org/wiki/Downloads
- You can download Minikube from – https://github.com/kubernetes/minikube/
Following are the steps to setup Minikube in local machine.
- Installing Minikube in Linux – https://minikube.sigs.k8s.io/docs/start/linux/
- Installing Minikube in MacOS – https://minikube.sigs.k8s.io/docs/start/macos/
- Installing Minikube in Windows – https://minikube.sigs.k8s.io/docs/start/windows/
After downloading the Minikube binary, run following commands.
Minikube in action
1. Start a cluster by running
$ minikube start
2. Access the Kubernetes Dashboard running within the minikube cluster:
$ minikube dashboard
3. Once started, you can interact with your cluster using kubectl, just like any other Kubernetes cluster. For instance, starting a server:
$ kubectl create deployment hello-minikube --image=k8s.gcr.io/echoserver:1.4
4. Exposing a service as a NodePort
$ kubectl expose deployment hello-minikube --type=NodePort --port=8080
5. minikube makes it easy to open this exposed endpoint in your browser:
$ minikube service hello-minikube
6. Start a second local cluster (note: This will not work if minikube is using the bare-metal/none driver):
$ minikube start -p cluster2
7. Stop your local cluster:
$ minikube stop
8. Delete your local cluster:
$ minikube delete
9. Delete all local clusters and profiles
$ minikube delete --all
In next article, you will see the demo of Minikube installation.
392 total views, 1 views today