Add NetworkPolicy controller to restrict operator pod traffic (#110) - #174
Open
ompushkara wants to merge 3 commits into
Open
Add NetworkPolicy controller to restrict operator pod traffic (#110)#174ompushkara wants to merge 3 commits into
ompushkara wants to merge 3 commits into
Conversation
* Add NetworkPolicy controller to restrict operator pod traffic Introduce a self-healing NetworkPolicy reconciler that enforces ingress (9443, 8081) and egress (DNS, HTTPS, K8s API) rules on the operator pod. The controller watches for drift and recreates or updates the policy automatically. Includes RBAC permissions, POD_NAMESPACE downward API injection, unit tests, and test utility updates for NetworkPolicy scheme. * Add peer selectors and metrics port to NetworkPolicy Signed-off-by: ompushkara <omotilal@redhat.com> Add OLM upgrade version logic instead of manually hardcoding * Allow same-namespace pods to reach metrics port in NetworkPolicy Signed-off-by: ompushkara <omotilal@redhat.com> * Drop namespace selectors for apiserver NetworkPolicy rules Signed-off-by: ompushkara <omotilal@redhat.com> * Replace NetworkPolicy reconciler with one-shot startup install Instead of a dedicated controller that watches and reconciles the NetworkPolicy, install it once at operator startup using a direct client call. This simplifies the codebase while achieving the same result — the operator's NetworkPolicy is created or updated before the manager starts. Signed-off-by: ompushkara <omotilal@redhat.com> --------- Signed-off-by: ompushkara <omotilal@redhat.com>
Signed-off-by: ompushkara <omotilal@redhat.com>
…to be in sync with what securesign operator does for upgrade Signed-off-by: ompushkara <omotilal@redhat.com>
ompushkara
force-pushed
the
add/network-policies-upstream
branch
from
September 3, 2026 09:54
4810e2c to
9c483d2
Compare
Author
|
Added OLM upgrade test as well Downstream PRs : |
ompushkara
force-pushed
the
add/network-policies-upstream
branch
from
September 3, 2026 10:07
9c483d2 to
940f6cd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce a self-healing NetworkPolicy reconciler that enforces ingress (9443, 8081) and egress (DNS, HTTPS, K8s API) rules on the operator pod. The controller watches for drift and recreates or updates the policy automatically. Includes RBAC permissions, POD_NAMESPACE downward API injection, unit tests, and test utility updates for NetworkPolicy scheme.
Add OLM upgrade version logic instead of manually hardcoding
Allow same-namespace pods to reach metrics port in NetworkPolicy
Drop namespace selectors for apiserver NetworkPolicy rules
Replace NetworkPolicy reconciler with one-shot startup install
Instead of a dedicated controller that watches and reconciles the NetworkPolicy, install it once at operator startup using a direct client call. This simplifies the codebase while achieving the same result — the operator's NetworkPolicy is created or updated before the manager starts.
Summary
Release Note
Documentation