The pod was running, but nothing could reach it. You checked the service, the deployment, the node. All green. The problem was the network policy. Kubernetes Network Policies decide which traffic is allowed in and out of your pods. If you get them wrong, your app is either wide open or completely cut off.
A NetworkPolicy in Kubernetes is a resource that defines rules at the IP address or port level. These rules use labels to match pods and namespaces. By default, pods accept all traffic. Once you create a policy, the default flips to deny all, unless a rule allows it. This makes policies powerful — and dangerous without precision.
You can control ingress, egress, or both. Ingress governs incoming connections to a pod. Egress governs outgoing connections from a pod. You can match by podSelector, namespaceSelector, and IPBlock. Policies are enforced by the CNI plugin you are using. Not all plugins support all features, so check before you deploy.
When running network-reliant tools like Mosh — the mobile shell that stays connected across network changes — you must configure Network Policies to allow its traffic. Mosh relies on UDP, typically using ports starting from 60000 to 61000. A standard NetworkPolicy example for Mosh requires UDP rules in both ingress and egress for the correct port range. Without these rules, Mosh sessions will fail despite healthy pods.