Skip to content

Add optional NetworkPolicy templates for namespace isolation#5

Open
p-rog wants to merge 2 commits into
validatedpatterns:mainfrom
p-rog:network-policy-support
Open

Add optional NetworkPolicy templates for namespace isolation#5
p-rog wants to merge 2 commits into
validatedpatterns:mainfrom
p-rog:network-policy-support

Conversation

@p-rog

@p-rog p-rog commented Jun 12, 2026

Copy link
Copy Markdown

Adds a default-deny NetworkPolicy and per-pod allow rule templates for spire-server, OIDC discovery provider, SPIFFE CSI driver, and ZTWIM operator. All disabled by default — patterns opt in via values.

Note: spire-agent uses hostNetwork and is not affected by NetworkPolicies.

Adds a default-deny NetworkPolicy and per-pod allow rule templates for
spire-server, OIDC discovery provider, SPIFFE CSI driver, and ZTWIM
operator. All disabled by default — patterns opt in via values.

Note: spire-agent uses hostNetwork and is not affected by NetworkPolicies.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@minmzzhang minmzzhang left a comment

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.

shall we update the conditions before submission?

@@ -0,0 +1,18 @@
{{- if and (eq (.Values.defaultDenyNetworkPolicy.enabled | toString) "true") .Values.networkPolicy.csiDriver.enabled }}

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.

do we want to add the toSring here?

{{- if and (eq (.Values.defaultDenyNetworkPolicy.enabled | toString) "true") (eq (.Values.networkPolicy.csiDriver.enabled | toString) "true") }}

@@ -0,0 +1,22 @@
{{- if and (eq (.Values.defaultDenyNetworkPolicy.enabled | toString) "true") .Values.networkPolicy.oidcDiscoveryProvider.enabled }}

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.

same here toString for the 2nd half

Comment thread templates/operator-network-policy.yaml Outdated
@@ -0,0 +1,22 @@
{{- if and (eq (.Values.defaultDenyNetworkPolicy.enabled | toString) "true") .Values.networkPolicy.operator.enabled }}

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.

same here toString for the 2nd half

@@ -0,0 +1,22 @@
{{- if and (eq (.Values.defaultDenyNetworkPolicy.enabled | toString) "true") .Values.networkPolicy.spireServer.enabled }}

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.

same here toString for the 2nd half

@p-rog

p-rog commented Jun 12, 2026

Copy link
Copy Markdown
Author

shall we update the conditions before submission?

Great catch, I'm fixing it right away.

Use toString + eq for both halves of the condition to handle values
passed as strings via Helm overrides (common in Validated Patterns).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@minmzzhang minmzzhang left a comment

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.

let's also bump up the version, and run "make helm-docs" before submission. Otherwise, all LGTM! very well documented!

@minmzzhang

minmzzhang commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

If the superlinter fails, probably should add the prettier reformatting as updated in the rhbk chart: Makefile

podman run $(PODMAN_ARGS) -v $(PWD):/work:rw -w /work $(PRETTIER_IMAGE) --write README.md

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