Repository navigation
Description
Summary
On an OpenShift 4.20 cluster using OVN-Kubernetes, the harness egress NetworkPolicy
(deploy/knative/harness-egress-policy.yaml, name serverless-harness-egress) prevents the
harness pod from performing any DNS resolution. A pod carrying the harness label
serving.knative.dev/service=serverless-harness cannot reach the cluster DNS service
(172.30.0.10:53), so it cannot resolve redis, the LLM host, or authbridge-ab1 — every
outbound connection that needs name resolution fails with a connection timeout.
This is pre-existing (the base policy, not AuthBridge-specific) and was invisible on Kind
because kindnet does not enforce NetworkPolicy egress. It was surfaced by the RC1-4 live gate on
OCP/OVN-K, where the tightened AuthBridge egress variant (harness-egress-ab1.yaml) inherits the
same broken DNS rule.
Root cause
The DNS egress rule uses ports: [{UDP,53},{TCP,53}] with no to: selector. Per the
NetworkPolicy spec that means "port 53 to all destinations", but on this cluster's OVN-K it does
not actually permit reaching the cluster DNS.
Evidence (A/B probes, harness-labeled pod, default namespace)
| Egress policy on the pod | DNS result |
|---|---|
| none | resolves api.anthropic.com in 0.08s (HTTP 401, reachable) |
base harness-egress-policy.yaml (ports:53, no to) |
times out reaching 172.30.0.10:53 |
tightened harness-egress-ab1.yaml (ports:53, no to) |
times out |
to: namespaceSelector kubernetes.io/metadata.name=openshift-dns + ports:53 |
still times out |
The unlabeled control (no policy selects the pod) resolves fine, so cluster→DNS and
cluster→internet egress are healthy; the block is specifically the egress policy on harness-labeled
pods, and the usual OpenShift fix (allow egress to the openshift-dns namespace) is not
sufficient here.
Impact
- The harness cannot complete an agent turn on OVN-K (LLM call can't resolve its host) — this is
why the RC1-4 gate'sH1-allowclaim fails while all secret-free / deny / inject claims pass
(those don't require the harness pod itself to resolve a name). - Affects the flag-off default path too (base policy), i.e. any harness deployment on an
enforcing CNI — not just theSH_AUTHBRIDGEpath.
Candidate directions
- Determine how pods actually reach DNS on this cluster (
cat /etc/resolv.confinside a harness
pod). If the nameserver is a node-local address (host-network DNS),namespaceSelector/
podSelectorto:rules won't match it — an explicitipBlockallowance (node CIDR / the
resolver IP) on port 53 would be required. - Otherwise, an explicit
to: podSelectorfor the CoreDNS (dns-default) pods inopenshift-dns,
or the node CIDR ipBlock, rather than the bareports:53rule.
Notes
- Discovered by the RC1-4 OCP progression live gate. RC1-4 code needs no change to benefit —
once DNS egress is fixed, re-running the gate should give a full 6/6 (currently 5/6). - The tightened
harness-egress-ab1.yamlshould get the same fix as the base policy.
Assisted-By: Claude (Anthropic AI) [email protected]
Activity
fix: harness egress DNS rule to 5353/openshift-dns for OVN-K post-DNAT
pdettori commentedon Jul 14, 2026
Root cause confirmed + fixed (live OCP 4.20 / OVN-K)
Root cause: OVN-Kubernetes enforces egress
NetworkPolicyagainst the post-DNAT packet. Thedns-defaultService (172.30.0.10:53) DNATs to the CoreDNS pods on their real container port5353(the nameddns/dns-tcptargetPort — the endpoints are10.x.x.x:5353, and the pods are on the pod network, not hostNetwork). A rule matchingport: 53therefore never matches the translated DNS traffic, so the packet hits default-deny and every lookup times out.This also explains why the reporter's
namespaceSelector: openshift-dns+port:53attempt still failed — the selector was fine; the port was wrong. The node-local-DNS hypothesis is ruled out:resolv.confis the standardnameserver 172.30.0.10(cluster DNS service, not a node-local address).Evidence — A/B/C/D/E probe matrix (harness-labeled pod,
defaultns)ports:53, nototo: openshift-dnsns +ports:53to: openshift-dnsns +ports:5353ports:5353, notoThe only variable between failing (D) and passing (C) is the port number — confirming the DNAT-port mismatch, not the selector.
Fix
Change the DNS egress rule from
ports: 53toto: namespaceSelector kubernetes.io/metadata.name=openshift-dns+ports: 5353(UDP+TCP) in bothdeploy/knative/harness-egress-policy.yaml(base) anddeploy/knative/authbridge/harness-egress-ab1.yaml(tightened AB1 variant), plus the manifest-shape vitest.Verification — RC1-4 live gate now 6/6
Re-ran
deploy/knative/rc1-ocp-gate.sh gateon OCP 4.20/OVN-K after the fix:All 6 AuthBridge claims pass (H2-secret-free, H2-inject, H2-deny, H1-secret-free, H1-allow, H1-deny) — previously 5/6. Namespace auto-restored to base state.
Fix committed on
feat/rc1-4-ocp.Assisted-By: Claude (Anthropic AI) [email protected]
docs: add AuthBridge two-hop egress-control demo (Kind + OCP)
Fix harness egress NetworkPolicy blocking DNS on Kind (Connection tim…