RHOAIENG-57443: Permissive head NetworkPolicy egress for default-deny#183
RHOAIENG-57443: Permissive head NetworkPolicy egress for default-deny#183DavidAdaRH wants to merge 1 commit into
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com> rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
/run-kuberay-e2e |
|
@DavidAdaRH: The following test has Succeeded: OCI Artifact Browser URLInspecting Test Artifacts ManuallyTo inspect your test artifacts manually, follow these steps:
mkdir -p oras-artifacts
cd oras-artifacts
oras pull quay.io/opendatahub/odh-ci-artifacts:odh-pr-test-kuberay-tkhq4 |
| // because the head pod's egress requirements are platform-dependent (DNS, Kubernetes API, workers, | ||
| // node-local services, platform-specific OVN/SDN paths, etc.). The primary security boundary for | ||
| // the head pod is the ingress rules above. | ||
| egressRules := []networkingv1.NetworkPolicyEgressRule{ |
There was a problem hiding this comment.
This creates an open, broad rule as per the comments but we actually don't need it. If we use the upstream DenyAllIngress when its merged, it will achieve the same by implicitly allowing all egress. Additionally, we actually already have implicitly open egress rules as we don't define any and NetworkPolicy treats this the same as an open rule. @DavidAdaRH can you manually verify that auto-scaling works without your changes just to fact check me?
rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
Why are these changes needed?
When the
odh.ray.io/secure-trusted-networkannotation is enabled, the head pod's NetworkPolicy previously only declaredPolicyTypeIngress. In clusters that also apply a namespace-level default-deny egress policy, this meant the head pod's outbound traffic was blocked — preventing the Ray autoscaler sidecar from reaching the Kubernetes API server, DNS, and worker pods, causing autoscaling to fail.This change adds
PolicyTypeEgressto the head NetworkPolicy with a single allow-all egress rule. A permissive egress rule is used rather than enumerating specific destinations because the head pod's egress requirements are platform-dependent (DNS, Kubernetes API, workers, node-local services, platform-specific OVN/SDN paths, etc.). The primary security boundary for the head pod remains the ingress rules.Related issue number
Closes RHOAIENG-57443
Checks
Manual testing performed
policyTypes: ["Ingress", "Egress"]andegress: [{}]automatically from the annotation — no manual editing requiredSummary by CodeRabbit