Skip to content

Add optional NetworkPolicy templates for namespace isolation#10

Open
p-rog wants to merge 3 commits into
validatedpatterns:mainfrom
p-rog:add-default-deny-network-policy
Open

Add optional NetworkPolicy templates for namespace isolation#10
p-rog wants to merge 3 commits into
validatedpatterns:mainfrom
p-rog:add-default-deny-network-policy

Conversation

@p-rog
Copy link
Copy Markdown

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

Adds a default-deny NetworkPolicy and per-pod allow rule templates for keycloak, postgresql-db, and rhbk-operator pods. All disabled by default — patterns opt in via values. The RHBK operator-managed ingress policy is left untouched; the keycloak template covers egress only.

Adds a default-deny NetworkPolicy and per-pod allow rule templates for
keycloak, postgresql-db, and rhbk-operator pods. All disabled by default
— patterns opt in via values. The RHBK operator-managed ingress policy
is left untouched; the keycloak template covers egress only.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@p-rog
Copy link
Copy Markdown
Author

p-rog commented May 12, 2026

@minmzzhang @sabre1041 @mhjacks can you please review this and merge if no objections?

It's a part of ZTVP network policies improvements and overall VP project improvements.

Copy link
Copy Markdown

@mlorenzofr mlorenzofr left a comment

Choose a reason for hiding this comment

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

LGTM

PTAL to the documentation, in case we want to add the egress rule for the operator

Comment thread README.md.gotmpl
@mlorenzofr
Copy link
Copy Markdown

I'm not including it as a change in the review, because we still need to make this chart more generic and it will be something specific to layered-zero-trust, but in the NetworkPolicy we will have to add an egress rule so that the realm import job (label: job-name=ztvp-realm-import) can connect to the database

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@p-rog
Copy link
Copy Markdown
Author

p-rog commented May 15, 2026

I'm not including it as a change in the review, because we still need to make this chart more generic and it will be something specific to layered-zero-trust, but in the NetworkPolicy we will have to add an egress rule so that the realm import job (label: job-name=ztvp-realm-import) can connect to the database

The realm import job runs at sync-wave 41 (same as Keycloak), and on a fresh deployment, it runs during initial setup before network policies are applied (since policies come via extraValueFiles which are applied at the same sync-wave). But in case of any re-sync, you are right, we need to add it to the ZTVP keycloak network policies.

Adds networkPolicy.realmImport section with configurable pod selector.
Patterns set the label and egress rules via extraValueFiles.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@p-rog
Copy link
Copy Markdown
Author

p-rog commented May 15, 2026

I'm not including it as a change in the review, because we still need to make this chart more generic and it will be something specific to layered-zero-trust, but in the NetworkPolicy we will have to add an egress rule so that the realm import job (label: job-name=ztvp-realm-import) can connect to the database

The realm import job runs at sync-wave 41 (same as Keycloak), and on a fresh deployment, it runs during initial setup before network policies are applied (since policies come via extraValueFiles which are applied at the same sync-wave). But in case of any re-sync, you are right, we need to add it to the ZTVP keycloak network policies.

@mlorenzofr I just added a generic networkPolicy.realmImport section to the rhbk-chart with a configurable pod selector label and egress rules via networkPolicy.realmImport.
In the layered-zero-trust pattern there will be exact NetworkPolicy rules.

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