$ command-helper

Local Kubernetes: kind and minikube

Throwaway clusters on your laptop: creating and deleting, loading local images, ingress and services.

Requires Google sign-in

kind

Create a cluster
kind create cluster --name <kind_cluster>
Multi-node cluster from a configadvanced
# kind.yaml
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
  - role: control-plane
  - role: worker
  - role: worker

# then: kind create cluster --name <kind_cluster> --config kind.yaml
List clusters
kind get clusters
Load a locally built image (no registry needed)
kind load docker-image <image> --name <kind_cluster>
Delete a cluster
kind delete cluster --name <kind_cluster>

minikube

Start a cluster
minikube start --cpus 4 --memory 8g
Status
minikube status
Build images straight into minikube's Docker
eval $(minikube docker-env)
Open a service in the browser
minikube service <k8s_service> -n <namespace>
Enable the ingress controller
minikube addons enable ingress
Expose LoadBalancer services on localhostadvanced
minikube tunnel
Kubernetes dashboard
minikube dashboard
Delete everything
minikube delete --all

Both

Which cluster kubectl talks to
kubectl config current-context
Switch between local clusters
kubectl config use-context kind-<kind_cluster>