Repository navigation
Revert "LOG-7579: Deploy operator NetworkPolicy via OLM" #3541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,6 @@ | ||
| # NetworkPolicy for cluster-logging-operator manager pod | ||
| # This policy defines both ingress and egress rules required for the operator to function | ||
| # in a restrictive network environment. It only takes effect for traffic that a matching | ||
| # AdminNetworkPolicy rule allows or delegates with a Pass action; an AdminNetworkPolicy Deny | ||
| # takes precedence and cannot be overridden by this NetworkPolicy. | ||
| # in a restrictive network environment. | ||
| apiVersion: networking.k8s.io/v1 | ||
| kind: NetworkPolicy | ||
| metadata: | ||
|
|
@@ -18,17 +16,15 @@ spec: | |
| - Ingress | ||
| - Egress | ||
| ingress: | ||
| # Allow metrics scraping (metrics-bind-address :8443) | ||
| # Allow metrics (Port 8443) | ||
| - ports: | ||
| - port: 8443 | ||
| - port: https-metrics | ||
| protocol: TCP | ||
| egress: | ||
| # Allow DNS resolution | ||
| - ports: | ||
| - port: 53 | ||
| - port: dns | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
set -euo pipefail
rg -n -C 5 --glob '*.yaml' --glob '*.yml' --glob '*.adoc' \
'clo-permissive-network-policy|port:[[:space:]]*53|port:[[:space:]]*dns' \
config bundle docsRepository: openshift/cluster-logging-operator Length of output: 3386 🏁 Script executed: set -euo pipefail
printf '%s\n' '--- feature documentation ---'
nl -ba docs/features/network_policy.adoc | sed -n '1,220p'
printf '%s\n' '--- network-policy files ---'
for f in config/network-policy/*.yaml; do
printf '\n### %s\n' "$f"
nl -ba "$f"
done
printf '%s\n' '--- policy and feature references ---'
rg -n -F --glob '*.go' --glob '*.yaml' --glob '*.yml' --glob '*.adoc' --glob '*.json' \
-e 'clo-permissive-network-policy' \
-e 'NetworkPolicy' \
-e 'network policy' \
-e 'networkPolicy' \
-e 'dns' \
-e 'port: 53' \
-e 'port: tcp-dns' \
. | sed -n '1,260p'
printf '%s\n' '--- current diff against supplied merge base ---'
git diff --no-ext-diff --unified=40 fd45bce879a57e2a08c27711077f9645611dcc9f a3fd5a1d6b87a175eff6e5f25444cdfcda1ddceb -- config/network-policy/clo-permissive-network-policy.yaml config/network-policy/kustomization.yaml docs/features/network_policy.adocRepository: openshift/cluster-logging-operator Length of output: 41643 Retain TCP DNS when this policy is applied. The documented opt-in path still allows users to apply this YAML manually. If no overlapping policy permits TCP/53, matching operator pods can send DNS only over UDP. DNS clients may retry truncated UDP responses over TCP, and those retries will be blocked. 🐛 Suggested fix--- "a/config/network-policy/clo-permissive-network-policy.yaml"
+++ "b/config/network-policy/clo-permissive-network-policy.yaml"
@@ -23,8 +23,10 @@
egress:
# Allow DNS resolution
- ports:
- port: dns
protocol: UDP
+ - port: 53
+ protocol: TCP
# Allow communication with Kubernetes API server
- ports:
- port: 6443🤖 Prompt for AI Agents |
||
| protocol: UDP | ||
| - port: 53 | ||
| protocol: TCP | ||
| # Allow communication with Kubernetes API server | ||
| - ports: | ||
| - port: 6443 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,4 @@ | ||
| resources: | ||
| # The permissive NetworkPolicy for the operator manager pod. It is deployed by OLM | ||
| # so the operator keeps functioning (metrics, DNS, API server) under a restrictive | ||
| # AdminNetworkPolicy, but only for traffic that a matching AdminNetworkPolicy rule allows | ||
| # or delegates with a Pass action; an AdminNetworkPolicy Deny cannot be overridden here. | ||
| # See docs/features/network_policy.adoc. | ||
| - clo-permissive-network-policy.yaml | ||
| # allow-metrics-traffic.yaml and allow-webhook-traffic.yaml are operator-sdk | ||
| # scaffolding and are intentionally not included. | ||
| # resources: | ||
| # - allow-metrics-traffic.yaml | ||
| # - allow-webhook-traffic.yaml | ||
| # - clo-permissive-network-policy.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: openshift/cluster-logging-operator
Length of output: 7413
🏁 Script executed:
Repository: openshift/cluster-logging-operator
Length of output: 5762
🏁 Script executed:
Repository: openshift/cluster-logging-operator
Length of output: 18621
Use numeric port
8443for metrics ingress.The selected Deployment matches
name: cluster-logging-operator, but its container declares noportsentry. The metrics patch adds--metrics-bind-address=:8443only. It does not declarehttps-metrics. A named NetworkPolicy port therefore does not match this Pod.🐛 Suggested fix
📝 Committable suggestion
🤖 Prompt for AI Agents