Kubernetes Local Clusters Cheatsheet
Purpose
This page helps developers work with Kubernetes locally using MicroK8s, k3s/k3d, kind, minikube, or kubeadm. Use the option that matches the team's platform strategy.
kubectl Basics
kubectl version --client
kubectl config get-contexts
kubectl config use-context <context>
kubectl get nodes
kubectl get pods -A
kubectl get svc -A
kubectl get deploy -A
kubectl describe pod <pod>
kubectl logs <pod>
kubectl logs -f <pod>
kubectl exec -it <pod> -- sh
Apply And Delete
kubectl apply -f deployment.yaml
kubectl apply -f k8s/
kubectl delete -f deployment.yaml
kubectl rollout status deployment/<name>
kubectl rollout restart deployment/<name>
Namespaces
kubectl create namespace simpro-dev
kubectl get ns
kubectl config set-context --current --namespace=simpro-dev
kubectl get all
Port Forwarding
kubectl port-forward svc/<service> 8080:80
kubectl port-forward pod/<pod> 8080:8080
Debugging
kubectl describe pod <pod>
kubectl get events --sort-by=.metadata.creationTimestamp
kubectl logs <pod> --previous
kubectl top pods
kubectl top nodes
MicroK8s
Common commands:
microk8s status
microk8s enable dns storage ingress
microk8s kubectl get nodes
microk8s kubectl get pods -A
microk8s stop
microk8s start
Export kubeconfig:
microk8s config
k3s And k3d
k3s is lightweight Kubernetes. k3d runs k3s in containers.
k3d cluster create simpro-dev
k3d cluster list
k3d kubeconfig get simpro-dev
k3d cluster delete simpro-dev
kind
kind runs Kubernetes in Docker containers.
kind create cluster --name simpro-dev
kind get clusters
kind delete cluster --name simpro-dev
kind load docker-image simpro-api:dev --name simpro-dev
minikube
minikube start
minikube status
minikube dashboard
minikube service <service>
minikube stop
minikube delete
kubeadm
kubeadm is usually for creating more realistic clusters, not the quickest developer path.
Common lifecycle:
kubeadm init
kubeadm join
kubeadm reset
Use kubeadm only when you need to understand or test cluster-bootstrap behavior.
Helm Basics
helm version
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
helm install my-release bitnami/nginx
helm list
helm upgrade my-release bitnami/nginx
helm uninstall my-release
Good Kubernetes Habits
- Use namespaces for separation.
- Keep manifests readable.
- Use resource requests/limits for serious workloads.
- Use health probes.
- Never store secrets in plain YAML committed to Git.
- Prefer local clusters for learning and integration testing, not as production replicas.
Team Reference Guide
How To Explain This Page
Use this page as a reference conversation, not as a checklist to read aloud. Start by explaining why the topic matters, then connect it to current team work, and finally ask what behavior should change.
The most useful way to teach this material is to move from concept to example. Explain the principle, show how it appears in daily work, ask the team where it is currently strong or weak, and finish with one small action.
Guidelines For Teams
- Connect the topic to a current project, customer problem, incident, or decision.
- Translate concepts into visible behaviors.
- Keep the guidance lightweight enough to use weekly.
- Capture decisions, examples, and improvements back into the wiki.
- Review the page again after a project, incident, or retrospective to update what the team has learned.
Reflection Questions
- What part of this topic is already working well for us?
- What part is still mostly theory?
- What is one behavior we can change in the next 30 days?