Local Kubernetes: kind and minikube
Throwaway clusters on your laptop: creating and deleting, loading local images, ingress and services.
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 clustersLoad 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 8gStatus
minikube statusBuild 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 ingressExpose LoadBalancer services on localhostadvanced
minikube tunnelKubernetes dashboard
minikube dashboardDelete everything
minikube delete --allBoth
Which cluster kubectl talks to
kubectl config current-contextSwitch between local clusters
kubectl config use-context kind-<kind_cluster>