netatlas Star on GitHub

Egress the mesh needs: istiod and DNS

An egress NetworkPolicy can keep a workload from something the mesh needs: istiod, which configures its sidecar, and kube-dns, which resolves names. netatlas lists each such workload with the policies that restrict it, so you find the egress rule you left out before new pods stop becoming ready or names stop resolving. This page says what each line means and which rule fixes it. Traffic and Outbound cover what the same policies allow between workloads and out of the cluster.

istiod on TCP 15012

A workload with a sidecar whose egress does not admit the istiod pods in Istio's root namespace on TCP 15012 reads cannot reach istiod on TCP 15012 (<policies>). New pods do not become ready while these policies apply: their sidecar waits for configuration from istiod. The sidecar starts, but Istio's readiness check for it fails until istiod has sent its first configuration. A workload that reaches istiod only through an ipBlock rule on that port gets the line too (What netatlas does not do yet).

netatlas takes a pod for istiod when it is labelled app: istiod and runs in Istio's root namespace, istio-system unless the cluster's istio.rootNamespace says otherwise (Clusters).

kube-dns on UDP 53

A workload whose egress does not admit the pods labelled k8s-app=kube-dns on UDP 53 reads cannot reach kube-dns on UDP 53 (<policies>). Names do not resolve. Names resolve over UDP, so netatlas asks for UDP 53. It cannot tell which address answers DNS (NodeLocal DNSCache listens on a link-local one), so an address rule that admits the port counts as reaching it.

Where netatlas lists them

The Overview lists each such workload under Egress the mesh needs, as <cluster>: <namespace> / <name> <text>. The workload's panel on the Policy map lists it too, with the text starting with a capital. The text names the policies that restrict the workload's egress.

The egress rule that fixes each

To fix a line, add an egress rule that admits that port to those pods. Add it under egress: of one of the policies the line names. Kubernetes adds up the rules of every policy that selects a pod, so the new rule widens what the pod may call and takes nothing away (Kubernetes: network policies).

For istiod, replace istio-system with Istio's root namespace if it is another:

egress:
  - to:
      - namespaceSelector:
          matchLabels:
            kubernetes.io/metadata.name: istio-system
        podSelector:
          matchLabels:
            app: istiod
    ports:
      - protocol: TCP
        port: 15012

For kube-dns, whose pods run in kube-system unless your cluster says otherwise:

egress:
  - to:
      - namespaceSelector:
          matchLabels:
            kubernetes.io/metadata.name: kube-system
        podSelector:
          matchLabels:
            k8s-app: kube-dns
    ports:
      - protocol: UDP
        port: 53
      - protocol: TCP
        port: 53

netatlas asks for UDP 53 only. The rule opens TCP 53 as well, because a resolver retries over TCP when a UDP answer comes back truncated (RFC 7766).

What netatlas does not check

  • netatlas skips a check when it sees no istiod or kube-dns pods, for example with an external control plane, and it never checks the target's own pods.
  • It checks these two targets only, and only the workload's egress: an ingress policy on istiod's or kube-dns's pods is not read for this.