Kubernetes Lab with Minikube Guide¶
This lab gives you a practical Minikube workflow for local Kubernetes practice. Use it when you want a small, disposable cluster for learning Deployments, Services, logs, rollout checks, and cleanup commands.
What You Will Learn¶
- Start a local Kubernetes cluster with Minikube
- Confirm your
kubectlcontext before applying resources - Deploy and expose a small application
- Validate pods, services, logs, and rollout status
- Stop or delete the cluster when the lab is finished
Prerequisites¶
- Docker, Podman, HyperKit, VirtualBox, or another supported Minikube driver
minikubeinstalledkubectlinstalled- At least 2 CPUs and 4 GB RAM available for a small local cluster
Use a disposable cluster
Local labs are best for learning commands and object behavior. Do not treat a successful Minikube test as proof that production networking, storage, or security settings are complete.
Suggested Flow¶
- Start Minikube with your preferred driver.
- Confirm the cluster and current namespace context.
- Apply a sample Deployment and Service.
- Check rollout status and logs.
- Stop or delete the cluster when the exercise is finished.
Step-by-Step Lab¶
Start a cluster with the Docker driver:
Confirm that kubectl is pointing at Minikube:
Create a sample Deployment with a pinned image:
kubectl create deployment hello-minikube --image=nginx:1.27
kubectl rollout status deployment/hello-minikube
Expose the Deployment with a Service:
kubectl expose deployment hello-minikube --type=NodePort --port=80
kubectl get service hello-minikube
Open or inspect the service URL:
Quick Validation¶
minikube start --driver=docker
kubectl get nodes
kubectl get pods -A
kubectl rollout status deployment/hello-minikube
kubectl logs deployment/hello-minikube
Troubleshooting¶
- If Minikube fails to start, check the selected driver and available CPU/RAM.
- If
kubectlpoints to another cluster, runkubectl config use-context minikube. - If the Service URL does not respond, verify the pod is running with
kubectl get pods. - If the image pull fails, check internet access and the image tag.
Cleanup¶
Remove only the sample workload:
Stop or delete the full lab cluster:
Next Steps¶
- Try the hands-on Kubernetes scenarios
- Review Kubernetes fundamentals
- Keep Kubernetes quick reference open while practicing