Skip to content

Add optional NetworkPolicy templates for namespace isolation#10

Merged
mlorenzofr merged 5 commits into
validatedpatterns:mainfrom
p-rog:add-default-deny-network-policy
May 19, 2026
Merged

Add optional NetworkPolicy templates for namespace isolation#10
mlorenzofr merged 5 commits into
validatedpatterns:mainfrom
p-rog:add-default-deny-network-policy

Conversation

@p-rog
Copy link
Copy Markdown
Contributor

@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
Contributor 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
Contributor

@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
Contributor

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
Contributor 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
Contributor 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.

Copy link
Copy Markdown
Contributor

@sabre1041 sabre1041 left a comment

Choose a reason for hiding this comment

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

@p-rog this looks good. Let's be sure to also bump the version of the chart. Ideally we can put it behind #11 which is also ready to be merged.

Additional work to move out the majority of the ZTVP specific items should be accounted for in #9

@mlorenzofr mlorenzofr merged commit 8b2c956 into validatedpatterns:main May 19, 2026
3 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.

3 participants