Skip to content

config: add NetworkPolicy for operator pod - #30

Merged
Rakshith-R merged 1 commit into
RamenDR:mainfrom
Rakshith-R:operator-network-policy
Oct 30, 2026
Merged

Rakshith-R merged 1 commit into
RamenDR:mainfrom
Rakshith-R:operator-network-policy

Conversation

@Rakshith-R

Copy link
Copy Markdown
Collaborator

Add a NetworkPolicy for the controller-manager pod that denies all ingress and allows all egress, matching ceph-csi-operator and kubernetes-csi-addons. The operator exposes no ports by default (metrics are disabled and kubelet health probes bypass NetworkPolicy). Egress stays open for API server access.

The policy is included in config/default and in the OLM bundle.

Assisted-by: Claude noreply@anthropic.com

@Rakshith-R
Rakshith-R force-pushed the operator-network-policy branch from d29ff02 to fd2b75c Compare October 22, 2026 13:50
select {
case <-r.exitCh:
case err := <-r.exitCh:
_ = err

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the change here? Can you drop this not related to this PR?

@@ -1,2 +1,2 @@
resources:
- allow-metrics-traffic.yaml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no longer used now since ingress is now denied by default.
Either remove the file or add a comment [Metrics] telling users to add it back when they enable metrics?

matchLabels:
control-plane: controller-manager
app.kubernetes.io/name: ceph-volsync-plugin-operator
# Ingress is not specified - deny all inbound traffic.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Ingress is not specified - deny all inbound traffic.
# Ingress is listed in `policyTypes` with no rules, so all inbound traffic is denied.

kind: NetworkPolicy
metadata:
name: controller-manager
namespace: system

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add following?

app.kubernetes.io/name: ceph-volsync-plugin-operator
app.kubernetes.io/managed-by: kustomize

Add a NetworkPolicy for the controller-manager pod that denies all
ingress and allows all egress, matching ceph-csi-operator and
kubernetes-csi-addons. The operator exposes no ports by default
(metrics are disabled and kubelet health probes bypass
NetworkPolicy). Egress stays open for API server access.

The policy is included in config/default and in the OLM bundle.

Also mark the unused receive in RsyncDaemon.Stop as explicitly
discarded to fix the errcheck finding in golangci-lint v2.15.0.

Assisted-by: Claude <noreply@anthropic.com>
Signed-off-by: Rakshith R <rar@redhat.com>
@Rakshith-R
Rakshith-R force-pushed the operator-network-policy branch from fd2b75c to cdcdd4f Compare October 23, 2026 13:31
@Rakshith-R
Rakshith-R marked this pull request as ready for review October 30, 2026 06:45
@Rakshith-R
Rakshith-R merged commit 3e39903 into RamenDR:main Oct 30, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants