feat: add NetworkPolicy support for operator and proxy-webhook#3714
Open
jkhelil wants to merge 2 commits into
Open
feat: add NetworkPolicy support for operator and proxy-webhook#3714jkhelil wants to merge 2 commits into
jkhelil wants to merge 2 commits into
Conversation
Contributor
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Member
Author
|
/kind feature |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3714 +/- ##
==========================================
- Coverage 25.51% 25.49% -0.02%
==========================================
Files 448 449 +1
Lines 23309 23370 +61
==========================================
+ Hits 5948 5959 +11
- Misses 16675 16725 +50
Partials 686 686
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
e99d0f1 to
02c76cd
Compare
Ship fixed NetworkPolicies for the operator's own namespace (tekton-operator / openshift-operators) as static manifests alongside the Deployment/RBAC, scoping the main operator and CR admission webhook pods for ingress/egress. No CR watches the operator's own namespace, so these cannot be reconciled and ship statically instead. Each podSelector targets this operator's own pod labels only, never an empty/namespace-wide selector, so the bundle never affects other pods sharing openshift-operators. Related to SRVKP-12050. Signed-off-by: Jawed khelil <jkhelil@redhat.com> Assisted-by: Claude Sonnet 5 (via Cursor) Co-authored-by: Cursor <cursoragent@cursor.com>
Reuse the NetworkPolicy foundation built for TektonTrigger to scope ingress/egress for the proxy-webhook workload TektonPipeline deploys into the operand namespace. Adds spec.networkPolicy to TektonPipeline, propagated from TektonConfig, and reconciles it via a new custom InstallerSet, mirroring the TektonTrigger pattern. Related to SRVKP-12050. Signed-off-by: Jawed khelil <jkhelil@redhat.com> Assisted-by: Claude Sonnet 5 (via Cursor) Co-authored-by: Cursor <cursoragent@cursor.com>
02c76cd to
cb11020
Compare
6 tasks
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.
Summary
Implements
NetworkPolicyresources to restrict network access for the operator's own workloads, building on the foundation established by the Tekton TriggersNetworkPolicyimplementation.NetworkPolicymanifests for the main operator controller pod and theproxy-webhookpod in the operator's own namespace (config/kubernetes/base/networkpolicy.yaml,config/openshift/base/networkpolicy.yaml). These are static because no CR reconciles the operator's own namespace, and the operator is also distributed via OLM bundles.TektonPipeline(reconciled): Adds aspec.networkPolicyfield toTektonPipeline(propagated fromTektonConfig, mirroring the existingTektonTriggerfield) and a newpkg/reconciler/kubernetes/tektonpipeline/networkpolicies.gothat reconciles default-deny +proxy-webhookpolicies in the operand namespace, following the same pattern used bytektontrigger.networkpolicy.PlatformParamshelper (different DNS/API server ports and label selectors per platform).docs/NetworkPolicy.md.Ref: SRVKP-12050
Test plan
go build ./...go vet ./.../gofmtyamllinton new YAML filesSubmitter Checklist
make test lintbefore submitting a PRRelease Notes
Made with Cursor