Skip to content

Latest commit

 

History

History
192 lines (124 loc) · 5.31 KB

README.md

File metadata and controls

192 lines (124 loc) · 5.31 KB

Minikube

Run a single-node Kubernetes cluster for local development and learning

🚀 Introduction

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.

🛠️ Provision

Choose one of the following methods to provision your environment:

Github Codespace

Open in GitHub Codespaces

bash docker/docker.sh
bash minikube/minikube.sh

Vagrant

vagrant up --provision-with basetools,docker,docsify,minikube

Docker Compose

docker compose exec hashiqube /bin/bash
bash hashiqube/basetools.sh
bash docker/docker.sh
bash docsify/docsify.sh
bash minikube/minikube.sh

📊 Key Components

Minikube Dashboard

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

Access URL: http://localhost:10888/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/#/overview?namespace=kubernetes-dashboard

Minikube Dashboard

Kubernetes Pods

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

Kubernetes Pods

Kubernetes Services

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

Kubernetes Services

Helm Dashboard

Helm Dashboard

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/

Helm Dashboard

K9s CLI

K9s is a terminal-based UI for Kubernetes that wraps kubectl functionality for intuitive cluster interaction.

To launch K9s:

vagrant ssh
k9s

k9s terminal UI

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 on Minikube

Traefik Logo

Traefik is a modern HTTP reverse proxy and load balancer that can be used as an Ingress controller for Kubernetes.

Access URLs:

Traefik on Minikube

🧩 kubectl Commands

You can interact with kubectl from your computer using:

vagrant ssh -c "sudo kubectl command"

Common Command Examples

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.

📚 Resources

💡 Tips for Using Minikube

  1. Start Simple: Begin with basic deployments and gradually add complexity
  2. Use the Dashboard: The Kubernetes Dashboard provides a visual way to understand your cluster
  3. Experiment with Services: Try different service types (ClusterIP, NodePort, LoadBalancer) to understand networking
  4. Learn kubectl: Become familiar with common kubectl commands for managing your cluster
  5. Use Namespaces: Organize your resources into namespaces for better management