Installing and using minikube
Command Summary`
Command | Description |
---|---|
minikube start | Start minikube |
minikube dashboard | Start the Kubernetes Dashboard |
minikube addons enable metrics-server | Enable Metrics Services (Required for some dashboard features) |
minikube stop | Stop minikube |
minikube delete | Delete minikube - when error occur restarting |
minikube tunnel | Connect to LoadBalancer services |
kubectl get deployments | Get the kubernetes deployments |
kubectl get pods | Get the kubernetes pods |
kubectl get events | View the cluster events |
kubectl logs hello-node-55fdcd95bf-sqxd7 | View the logs from a Service |
kubectl expose deployment hello-node –type=LoadBalancer –port=8080 | Expose the service outside the Virtual Network |
kubectl create deployment hello-node –image=registry.k8s.io/e2e-test-images/agnhost:2.39 – /agnhost netexec –http-port=8080 | Create the e2e-test-image |
kubectl get services | Get the running services |
minikube service hello-node | Connect to the URL of a Service |
What is minikube?
Minikube is a tool that allows you to run a local Kubernetes cluster on your machine. It’s commonly used for development and testing purposes, providing a way to explore and develop applications for Kubernetes without needing a full-scale cloud or production environment. This a cost of effective solution for local proof of concepts and development.
Getting Started with Minikube
First thing first lets getting the minikube cli tool install, in a previous guide I talke about how we can install asdf for managing binaries and program language versions. If you want to get started with asdf please see the following link: Installing and using asdf
After a little bit of reaserch I found out that there is a asdf plugin for minikube which I’m going to leverage for this guide. In the past I would have used homebrew but I’m trying out asdf more as it seem to be a little more flexible than homebrew for my needs.
Commands - Install the minikube plugin
Firstly we will search for the minikube plugin in asdf
Next add the minikube plugin for asdf and check its installed locally
Now that the plugin is installed let’s check what versions are available to us
In this case, I’ll in the latest version of minikube
Let’s setting the binary to use globally
Let’s ensure that minikube binary that we’ve installed is working correctly
Commands - Start the minikube server
Now that the minikube binary is installed we start the minkube cluster, note minikube requires that docker is installed as this is a fundamental requirement
At this point it looks like minikube is up and running but let’s deploy a simple hello world
service or in
Create a demo service
Lets create a demo service to test with