Run a single-node Kubernetes cluster for local development and learning
Minikube is a tool that runs a single-node Kubernetes cluster in a virtual machine on your personal computer. This HashiQube DevOps lab provides hands-on experience with Minikube, Helm, Helm Dashboard, and Traefik, allowing you to learn and experiment with Kubernetes in a safe, local environment.
Choose one of the following methods to provision your environment:
bash docker/docker.sh
bash minikube/minikube.sh
vagrant up --provision-with basetools,docker,docsify,minikube
docker compose exec hashiqube /bin/bash
bash hashiqube/basetools.sh
bash docker/docker.sh
bash docsify/docsify.sh
bash minikube/minikube.sh
The Dashboard is a web-based Kubernetes user interface that lets you:
- Deploy containerized applications
- Troubleshoot applications
- Manage cluster resources
- View applications running on your cluster
- Create or modify Kubernetes resources
Pods are the smallest deployable units of computing that you can create and manage in Kubernetes.
Key characteristics:
- Group of one or more containers
- Shared storage and network resources
- Co-located and co-scheduled
- Run in a shared context
Services are a method for exposing network applications running as Pods.
Purpose:
- Expose Pods to network traffic
- Provide stable networking for dynamic Pods
- Allow frontends to connect to backends without tracking changing IPs
Helm Dashboard is an open-source UI for Helm charts that allows you to:
- View installed Helm charts and their revision history
- See manifest diffs between revisions
- Browse Kubernetes resources created by charts
- Perform rollbacks or upgrades with clear manifest diffs
- Switch between multiple clusters
- Use locally or install into a Kubernetes cluster
Access URL: http://localhost:11888/
K9s is a terminal-based UI for Kubernetes that wraps kubectl functionality for intuitive cluster interaction.
To launch K9s:
vagrant ssh
k9s
K9s Tips:
- Press
0
to display all namespaces - Press
:
to bring up command prompt - Navigate with arrow keys and interact using buttons shown in the top right
- Press
l
to show logs of selected pod
For more information, visit the K9s website.
Traefik is a modern HTTP reverse proxy and load balancer that can be used as an Ingress controller for Kubernetes.
Access URLs:
- Dashboard: http://localhost:18181/dashboard/
- Load Balancer: http://localhost:18080
- Documentation: http://localhost:3333/#/minikube/README?id=traefik-on-minikube
You can interact with kubectl from your computer using:
vagrant ssh -c "sudo kubectl command"
Get nodes:
vagrant ssh -c "sudo kubectl get nodes"
Get all resources:
vagrant ssh -c "kubectl get all -A"
or inside HashiQube:
kubectl get all -A
Get deployments:
vagrant ssh -c "sudo kubectl get deployments"
Get services:
vagrant ssh -c "sudo kubectl get services"
Alternatively, SSH into the VM with vagrant ssh
and then use sudo kubectl get nodes
.
- Start Simple: Begin with basic deployments and gradually add complexity
- Use the Dashboard: The Kubernetes Dashboard provides a visual way to understand your cluster
- Experiment with Services: Try different service types (ClusterIP, NodePort, LoadBalancer) to understand networking
- Learn kubectl: Become familiar with common kubectl commands for managing your cluster
- Use Namespaces: Organize your resources into namespaces for better management