You finally get your cluster running, pods humming, but nothing’s reachable outside localhost. The culprit is probably the Microk8s port configuration. It looks simple—open a port, expose a service—but under the hood, it decides who gets to talk to your workloads and how securely they do it.
Microk8s is a lightweight Kubernetes distribution built for local or edge deployments. It trades sprawling complexity for convenience, wrapping everything into a single snap package. The “port” piece in Microk8s, though, controls external communication. Understanding how that mapping works turns a black box into a predictable gate between your container network and the outside world.
A Microk8s port can represent two things: the port your service listens on internally and the exposed port that proxies traffic to it. The translation happens in Kubernetes service definitions and ingress rules. In practice, Microk8s keeps strict network isolation until you deliberately open it up. That behavior prevents random exposure of pods, which is why many teams trust it for labs or smaller clusters that still require real-world access.
When you configure the ports, think of it as defining a controlled handshake between your application and the network. Use NodePort when testing locally or LoadBalancer with MetalLB for production-grade routing. If you only need your dashboard or a simple API visible, enable the relevant addon and forward the port directly. Behind that request Microk8s sets up iptables rules and NAT translation that keep your cluster boundary intact.
Quick answer: To access a Microk8s service externally, expose a port using microk8s kubectl expose or map the port through an ingress addon. The internal container port stays shielded; only the routed external port is visible to your network clients.