liveBook · Manning

Minikube

As explained in Google Anthos in Action

minikube is an open-source tool that runs a local Kubernetes cluster for developing and testing applications.

Minikube runs a local Kubernetes cluster on a developer laptop, providing a low-cost preview environment for applications before code is pushed to a repository or deployed to Anthos. It supports Windows, Linux, and macOS and can be operated with kubectl like a regular cluster. section 12.3 section 12.3.1

Use Minikube when you need to:

  • Preview application changes locally instead of deploying every revision to an Anthos cluster. section 12.3
  • Test Kubernetes features on a laptop while avoiding development-cluster time and cost. section 12.3.1
  • Connect an IDE workflow through Cloud Code, which integrates Minikube with kubectl, Skaffold, and Google Cloud SDK. section 12.3.3

Deploy and preview a service

Start the cluster with `minikube start`. Create a `hello-minikube` Deployment using `echoserver:1.4`, expose it through a NodePort service, verify the service, and forward it to localhost:8080. Open `http://localhost:8080` to view the response. The workflow can use `kubectl` throughout. section 12.3.1

A usable laptop needs at least 2 CPUs, 2 GB of free memory, 20 GB of free disk space, internet connectivity, and virtualization software such as VirtualBox. Minikube is intended for development and testing, not production workloads. section 12.3.1

minikube start

View the cluster-start command used to initialize the local environment. section 12.3.1

kubectl port-forward service/hello-minikube 8080:8080
Forwarding from 127.0.0.1:8080 -> 8080
Forwarding from [::1]:8080 -> 8080

View the port-forwarding command and its localhost output for the example service. section 12.3.1

How Google Anthos in Action covers it

How deep it goes
Explains setup requirements and a deployment-to-port-forwarding workflow, but stops short of production operations and cluster administration.
Examples
Demonstrates a hello-minikube Deployment, NodePort service, kubectl inspection, localhost port forwarding, and IDE-based application iteration.
What it assumes
Assumes basic Kubernetes and kubectl familiarity while specifying laptop resources, internet access, and virtualization requirements.
What you can do after
Operate a local Kubernetes preview by starting Minikube, deploying an image, exposing a service, and forwarding traffic to localhost.
How it connects
Connects Minikube with Kubernetes, kubectl, Anthos, Skaffold, Cloud Code, Cloud Run, and continuous development.

Also explained in

Compare how 3 books explain Minikube →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Google Anthos in Action. The section links point to the parts of the book it draws on.