Your 4-node k3s cluster with full observability is up and running!
| Node | IP Address | Role | Status | Version |
|---|---|---|---|---|
| master | 192.168.5.200 | control-plane | Ready | v1.33.5+k3s1 |
| worker1 | 192.168.5.201 | worker | Ready | v1.33.5+k3s1 |
| worker2 | 192.168.5.202 | worker | Ready | v1.33.5+k3s1 |
| worker3 | 192.168.5.203 | worker | Ready | v1.33.5+k3s1 |
Open these URLs in your browser:
-
Grafana: http://192.168.5.200:30080
- Username:
admin - Password:
admin - Pre-configured dashboards for Kubernetes monitoring
- Loki datasource configured for log exploration
- Username:
-
Prometheus: http://192.168.5.200:30090
- Direct access to Prometheus UI
- Query metrics and create custom queries
-
Alertmanager: http://192.168.5.200:30093
- Configure and view alerts
✅ Prometheus - Metrics collection and storage (7 day retention) ✅ Grafana - Visualization and dashboards ✅ Loki - Log aggregation and querying ✅ Promtail - Log collection agent (running on all nodes) ✅ Alertmanager - Alert management ✅ Node Exporter - Host-level metrics (running on all nodes) ✅ Kube State Metrics - Kubernetes object metrics ✅ Prometheus Operator - Kubernetes-native Prometheus management
Once logged into Grafana, explore these dashboards:
- Kubernetes / Compute Resources / Cluster - Overall cluster view
- Kubernetes / Compute Resources / Namespace - Per-namespace resources
- Kubernetes / Compute Resources / Node - Node-level details
- Kubernetes / Compute Resources / Pod - Pod-level metrics
- Node Exporter / Nodes - Host system metrics
# Set your kubeconfig
export KUBECONFIG=~/.kube/config
# View cluster nodes
kubectl get nodes -o wide
# View all pods
kubectl get pods -A
# View monitoring stack
kubectl get all -n monitoring# Check cluster health
kubectl get nodes
kubectl get pods -A
# View monitoring logs
kubectl logs -n monitoring -l app.kubernetes.io/name=grafana -f
kubectl logs -n monitoring -l app.kubernetes.io/name=prometheus -f
# View Loki logs
kubectl logs -n monitoring -l app=loki -f
# Port forward to services (if NodePort doesn't work)
kubectl port-forward -n monitoring svc/kube-prometheus-stack-grafana 3000:80
kubectl port-forward -n monitoring svc/kube-prometheus-stack-prometheus 9090:9090# Deploy a sample nginx app to test
kubectl create deployment nginx --image=nginx
kubectl expose deployment nginx --port=80 --type=NodePort
# Check the assigned NodePort
kubectl get svc nginx
# Access it (replace <NodePort> with the actual port)
curl http://192.168.5.200:<NodePort># SSH as vagrant user
ssh vagrant@192.168.5.200 # master
ssh vagrant@192.168.5.201 # worker1
ssh vagrant@192.168.5.202 # worker2
ssh vagrant@192.168.5.203 # worker3
# SSH as root
ssh root@192.168.5.200 # master (root)./scripts/ssh-nodes.sh master # Quick SSH to master
./scripts/ssh-nodes.sh w1 # Quick SSH to worker1
./scripts/ssh-nodes.sh w2 # Quick SSH to worker2
./scripts/ssh-nodes.sh w3 # Quick SSH to worker3- Open http://192.168.5.200:30090
- Try these queries:
node_cpu_seconds_total- CPU usagenode_memory_MemAvailable_bytes- Available memorykube_pod_container_status_running- Running containerscontainer_cpu_usage_seconds_total- Container CPU usage
- Open http://192.168.5.200:30080
- Go to "Explore" (compass icon)
- Select "Loki" datasource
- Use LogQL queries:
{namespace="kube-system"}- All kube-system logs{app="nginx"}- Logs from nginx pods{job="systemd-journal"}- System journal logs
- Login to Grafana
- Click "+" → "Dashboard"
- Add panels with Prometheus queries
- Use Loki for log panels
# See all pods in monitoring namespace
kubectl get pods -n monitoring
# Describe a problematic pod
kubectl describe pod <pod-name> -n monitoring
# View pod logs
kubectl logs <pod-name> -n monitoring# Restart Grafana
kubectl rollout restart deployment kube-prometheus-stack-grafana -n monitoring
# Restart Prometheus
kubectl delete pod prometheus-kube-prometheus-stack-prometheus-0 -n monitoring
# Restart Loki
kubectl rollout restart statefulset loki -n monitoring# List all services
kubectl get svc -n monitoring
# Check endpoints
kubectl get endpoints -n monitoring# SSH to master
ssh root@192.168.5.200
# Remove helm releases
helm uninstall kube-prometheus-stack -n monitoring
helm uninstall loki -n monitoring
# Delete namespace
kubectl delete namespace monitoring# Stop k3s on all nodes
ssh root@192.168.5.200 '/usr/local/bin/k3s-uninstall.sh'
ssh root@192.168.5.201 '/usr/local/bin/k3s-agent-uninstall.sh'
ssh root@192.168.5.202 '/usr/local/bin/k3s-agent-uninstall.sh'
ssh root@192.168.5.203 '/usr/local/bin/k3s-agent-uninstall.sh'
# Or destroy VMs completely
vagrant destroy -f- k3s Documentation: https://docs.k3s.io/
- Prometheus Documentation: https://prometheus.io/docs/
- Grafana Documentation: https://grafana.com/docs/
- Loki Documentation: https://grafana.com/docs/loki/
- kubectl Cheat Sheet: https://kubernetes.io/docs/reference/kubectl/cheatsheet/
Now that your cluster is ready with full observability, you can:
- Deploy containerized applications
- Set up CI/CD pipelines
- Test microservices architectures
- Experiment with service meshes (Istio, Linkerd)
- Deploy databases (PostgreSQL, MongoDB, Redis)
- Test autoscaling with HPA
- Implement GitOps with ArgoCD or Flux
Enjoy your homelab! 🚀