Skip to content

Conversation

@npinaeva
Copy link
Member

@npinaeva npinaeva commented Oct 13, 2025

Add a blog post with short description of changes, some migration examples and future plans.
I have also added a new version of the CNP model made in drawio, and the source file should be import-able to make future changes, but lmk if you have better ideas to store images

Fixes a part of #312

@netlify
Copy link

netlify bot commented Oct 13, 2025

Deploy Preview for kubernetes-sigs-network-policy-api ready!

Name Link
🔨 Latest commit e9a4362
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-sigs-network-policy-api/deploys/690c9f73c4feb800085b57aa
😎 Deploy Preview https://deploy-preview-333--kubernetes-sigs-network-policy-api.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 13, 2025
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 13, 2025
Copy link
Contributor

@bowei bowei left a comment

Choose a reason for hiding this comment

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

Looks good to me.

Don't we write a new blog post vs update the old ones?

cluster](user-stories.md#story-5-cluster-wide-default-guardrails).

### AdminNetworkPolicy Actions
### ClusterNetworkPolicy Actions
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest just leave this as ### Actions

Copy link
Member Author

Choose a reason for hiding this comment

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

I edited all headers to remote the CNP from it, it probably was only important when we had ANP vs BANP

@tssurya
Copy link
Contributor

tssurya commented Oct 14, 2025

#328 there is another blog post from @frozenprocess ?
maybe combining them is better? or do we want to go with both?

Ah I see comment on that one already: #328 (comment)

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: npinaeva

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 16, 2025
@npinaeva
Copy link
Member Author

Don't we write a new blog post vs update the old ones?

I am not sure what you mean, I did write a new blog post

@npinaeva npinaeva added this to the v1alpha2 milestone Oct 16, 2025
@npinaeva
Copy link
Member Author

@bowei will you have some time this week to give it another look?

Copy link
Contributor

@Dyanngg Dyanngg left a comment

Choose a reason for hiding this comment

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

Thanks for all the work put in this API evolution @npinaeva! Antrea is interested in picking up ClusterNetworkPolicy and implement it once the API is ready


- **Pass**: Skips all further ClusterNetworkPolicy rules in the
current tier for the selected traffic, and passes
evaluation to the next tier.
Copy link
Contributor

Choose a reason for hiding this comment

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

Technically 'NetworkPolicy' is not the "next tier", not sure if we want to call it out here. I know that we have the diagram above which illustrates the policy evaluation model, but I don't want people to think that once we're done with "Admin" tier rules we move on to the "Baseline" tier.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it could be explained either way (it's based on the definition of terms etc), but we should be consistent across all the docs to avoid confusion. Either the notion of tiers is just a convenient way to refer 1) to Admin -> NP -> Baseline or 2) we are more strict and say only Admin and Baseline are tiers.

I think in the code comments, it is closer to 1)

Copy link
Member Author

Choose a reason for hiding this comment

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

good point, I think this part is confusing because I didn't update the tiers section properly, let me update it with the API doc

BaselineAdminNetworkPolicies.
or Deny rules. For example, intra-namespace traffic management can be delegated to namespace
admins explicitly with the use of `Pass` rules. More specifically traffic selected by a `Pass` rule
will skip any lower precedence `Admin` tier rules and proceed to be evaluated by `NetworkPolicy` and
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this feels like a bit of a run-on sentence for me

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like chopping it at the i.e. and just making that another sentence would suffice?

- npinaeva
---

# ClusterNetworkPolicy or what happened to the AdminNetworkPolicy and BaselineAdminNetworkPolicy?
Copy link
Contributor

@bowei bowei Nov 4, 2025

Choose a reason for hiding this comment

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

Suggest to make it more direct so people understand the change.

# API update for v1alpha2: `ClusterNetworkPolicy` replaces `AdminNetworkPolicy` and `BaselineAdminNetworkPolicy`

We have merged `v1alpha1.AdminNetworkPolicy` and `v1alpha1.BaselineAdminNetworkPolicy` into a single API in `v1alpha2.ClusterNetworkPolicy`.

(put the rest of your discussion below)

Copy link
Contributor

@bowei bowei left a comment

Choose a reason for hiding this comment

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

Just some specific comments.

Note the comment on the diagram.

Generally, looks ok


![image](/images/ANP-api-model.png)

The model stays the same with the new API, the only difference is that evaluation order is now defined by the `priority` field
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mean tier instead of priority?

Copy link
Member Author

Choose a reason for hiding this comment

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

oh yes, good catch

Other changes bring the functionality of `BaselineAdminNetworkPolicy` to parity with `AdminNetworkPolicy`. This includes:
- Allowing multiple `ClusterNetworkPolicy` resources with `tier=Baseline` by using the same `priority` field as for `tier=Admin`.
- Supporting `Pass` action in `ClusterNetworkPolicy` with `tier=Baseline` to allow skipping all further rules in the `Baseline` tier.
- Supporting `domainNames` matching for `egress` rules in `ClusterNetworkPolicy` with `tier=Baseline`.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is experimental channel

Copy link
Member Author

Choose a reason for hiding this comment

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

do you mean I should add a note saying that domainNames is an experimental feature?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think you should have two priority arrows and number 1 - 1000 on each. This diagram makes it seem like the priority # extends across all of the tiers, which it does not. Also, the NetworkPolicy tier does not have priority numbers

Copy link
Member Author

Choose a reason for hiding this comment

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

good point, I am thinking if just leaving Evaluated first and Evaluated last is good enough? Or maybe replace Priority with "evaluation order"?
I don't think adding detail on the actual priority field was a point of this picture

Copy link
Contributor

Choose a reason for hiding this comment

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

SG


- **Pass**: Skips all further ClusterNetworkPolicy rules in the
current tier for the selected traffic, and passes
evaluation to the next tier.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it could be explained either way (it's based on the definition of terms etc), but we should be consistent across all the docs to avoid confusion. Either the notion of tiers is just a convenient way to refer 1) to Admin -> NP -> Baseline or 2) we are more strict and say only Admin and Baseline are tiers.

I think in the code comments, it is closer to 1)

BaselineAdminNetworkPolicies.
or Deny rules. For example, intra-namespace traffic management can be delegated to namespace
admins explicitly with the use of `Pass` rules. More specifically traffic selected by a `Pass` rule
will skip any lower precedence `Admin` tier rules and proceed to be evaluated by `NetworkPolicy` and
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like chopping it at the i.e. and just making that another sentence would suffice?

@npinaeva
Copy link
Member Author

npinaeva commented Nov 5, 2025

I updated install docs as discussed in the last meeting, see the last commit

Add a blog post with short description of changes, some migration
examples and future plans.

Signed-off-by: Nadia Pinaeva <[email protected]>
We don't release install.yaml artifact anymore, simply use
`crd/standard` files from the right tag/main branch.
Add mkdocs feature that enables "copy to clipboard" button on the
bash commands.

Signed-off-by: Nadia Pinaeva <[email protected]>
@bowei
Copy link
Contributor

bowei commented Nov 7, 2025

/lgtm

(I don't know why but I can't seem to resolve any comment threads)

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 7, 2025
@k8s-ci-robot k8s-ci-robot merged commit deabb1d into kubernetes-sigs:main Nov 7, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants