Archive · Kubernetes

MicroK8s: A Lightweight Kubernetes Cluster with Snap

Install MicroK8s 1.31 on Ubuntu 24.04 and enable the add-ons you need.

1 min read

  • MicroK8s 1.31
  • Kubernetes 1.31
  • Ubuntu 24.04 LTS

MicroK8s is Canonical’s single-package Kubernetes, convenient for small servers, labs and edge sites.

sudo snap install microk8s --classic --channel=1.31/stable
sudo usermod -aG microk8s $USER && newgrp microk8s
microk8s status --wait-ready
microk8s kubectl get nodes
echo "alias kubectl='microk8s kubectl'" >> ~/.bashrc

Enable add-ons as needed:

microk8s enable dns hostpath-storage metrics-server ingress
microk8s enable cert-manager
microk8s enable observability      # Prometheus and Grafana stack, needs resources
microk8s enable registry           # private registry on localhost:32000

Export a kubeconfig for your workstation: microk8s config > ~/.kube/config.

Notes:

  • Updates arrive through the snap channel; use --channel=1.31/stable to stay on a minor version and refresh deliberately (sudo snap refresh microk8s --channel=1.32/stable).
  • hostpath-storage stores volumes on the node’s disk, so it is not highly available.
  • Allow 2 vCPUs and 4 GB RAM at the least.