Twenty-Three Essential Commands for the best experience with your Minikube Installation
Minikube is the most popular method to train with or test Kubernetes on your local workstation(s). I detail the what and why of the extra but essential minikube commands.
What is Kubernetes?
When Kubernetes was conceptualized, it was started as a Cloud Distributed Operating System (CDOS) for microservices. A “pure” cloud of microservices where complex applications are composed of small independent processes which communicate with each other through APIs (Application Programming Interfaces) over a network.
After all, a cloud is a myriad of heterogeneous hardware, each with its own operating systems (bare-metal), that hosts your microservices, which you want to replicate (scale) and start up again if the microservice fails (fault tolerance).
Kubernetes orchestrates the cloud services, starting up and initializing services, restarting services if they become unreachable, replicating (scaling) services, and many other distributed operating system actions.
Note: I use service as a generic term for a microservice, application, package, network resource, storage service, or Application as a Service (AaaS == Saas).
You do not have to use Kubernetes to use the cloud. However, if you don’t use Kubernetes, you will end up writing a lot of code to detail the services, applications, and resources, where they run, and how they are connected with the network.
You write an additional gigantic amount of code if you want to replicate, load balance, and manage the failure of these various compute engines.
You end up writing your own version of a distributed operating system for the cloud. Now you get a sense of why Kubernetes is the defacto standard.
Finally, I hope the substantial ecosystem built up around Kubernetes adds additional weight to my premise.
What is Minikube?
I think of Kubernetes as a cloud PaaS (Platform as a Service).
Kubernetes is called Elastic Kubernetes Service (EKS) by Amazon, Azure Kubernetes Service (AKS) by Microsoft, and Google Kubernetes Engine (GKE) by Google.
Minikube is how you run look-and-feel-like Kubernetes on your local computer(s).
I think of Minikube as a program that I install on my local machine(s) for training with or testing Kubernetes.
As does Kubernetes. Minikube uses the client command-line tool kubectl. However, Minikube requires a separate command-line tool called minikube.
Using minikube, we supply extra control commands that are needed to run Kubernetes locally. Kubernetes does not need these commands when it is hosted on a cloud.
The minikube commands are:
minikube --help output => minikube provisions and manages local Kubernetes clusters optimized for development workflows. Basic Commands: start Starts a local Kubernetes cluster status Gets the status of a local Kubernetes cluster stop Stops a running local Kubernetes cluster delete Deletes a local Kubernetes cluster dashboard Access the Kubernetes dashboard running for the current minikube profile (cluster) pause pause Kubernetes unpause unpause Kubernetes Images Commands: docker-env Configure environment to use minikube's Docker daemon podman-env Configure environment to use minikube's Podman service cache Add, delete, or push a local image into minikube image Load a local image into minikube Configuration and Management Commands: addons Enable or disable a minikube addon config Modify persistent configuration values profile Get or list the current profiles (clusters) update-context Update kubeconfig in case of an IP or port change Networking and Connectivity Commands: service Returns a URL to connect to a service tunnel Connect to LoadBalancer services Advanced Commands: mount Mounts the specified directory into minikube ssh Log into the minikube environment (for debugging) kubectl Run a kubectl binary matching the cluster version node Add, remove, or list additional nodes Troubleshooting Commands: ssh-key Retrieve the ssh identity key path of the specified node ssh-host Retrieve the ssh host key of the specified node ip Retrieves the IP address of the specified node logs Returns logs to debug a local Kubernetes cluster update-check Print current and latest version number version Print the version of minikube Other Commands: completion Generate command completion for a shell Use "minikube <command> --help" for more information about a given command.
Note: You can use Kubernetes if you want to set up your own local cloud.
All minikube commands are specific to the local Minikube installation and set of running Minikube instances (also called profiles).
This blog article focuses on essential minikube commands and related kubectl commands.
Minikube Profiles
The kubectl command-line tool is how you control Kubernetes. The same kubectl is how you control Minikuber instances.
Kubernetes has contexts that are named clusters. By using the context name, kubectl points to what cluster to operate on.
I have seen Kubernetes' contexts named by the organization's application lifecycle stage, such as development, test, beta, alpha, and production.
Note: Kubernetes' namespaces are how you divide a cluster into named virtual clusters. Namespaces were introduced as a way to divide cluster resources between multiple users. I have only seen them partition different projects in a Kubernetes context (named cluster) in big enterprises. Use namespace sparingly, if at all.
Historically, and I guess, Minikube developers were confronted with trying to get Minikube to act identically to Kubernetes, which means clusters were controlled via kubectl.