Skip to content

NPEP-248: Add match all to ingress/egress peers#339

Open
fasaxc wants to merge 2 commits into
kubernetes-sigs:mainfrom
fasaxc:npep-248-match-all
Open

NPEP-248: Add match all to ingress/egress peers#339
fasaxc wants to merge 2 commits into
kubernetes-sigs:mainfrom
fasaxc:npep-248-match-all

Conversation

@fasaxc
Copy link
Copy Markdown
Contributor

@fasaxc fasaxc commented Oct 27, 2025

Attempt to tackle #248 by adding an explicit match all operator to peer objects.

Attempt to tackly kubernetes-sigs#248 by adding an explicit match all operator
to peer objects.
@netlify
Copy link
Copy Markdown

netlify Bot commented Oct 27, 2025

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

Name Link
🔨 Latest commit 199d6ba
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-sigs-network-policy-api/deploys/6900944d6b064f0008b5853c
😎 Deploy Preview https://deploy-preview-339--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
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: fasaxc
Once this PR has been reviewed and has the lgtm label, please assign danwinship for approval. For more information see the Code Review Process.

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

Details 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 requested a review from aojea October 27, 2025 18:25
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 27, 2025
@k8s-ci-robot k8s-ci-robot requested a review from tssurya October 27, 2025 18:25
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 27, 2025
@fasaxc fasaxc changed the title NPEP-248: Match all NPEP-248: Add match all to ingress/egress peers Oct 27, 2025
to add new fields inside the struct later without a breaking change. "Old"
implementations won't see the new fields, and they'd act like they weren't present.

I think this is OK in this unique case because "all" is naturally a unique "top"
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.

Have you thought about how the API could evolve to cover the "deny all UDP traffic" case?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

deny all UDP traffic

Can already be expressed by saying "deny UDP ports 1-65535". In general, you can already pick out the parts of the Venn diagram, but what was missing was a way to say "just match it all, don't restrict"

- all: {}
```

Then, via to-be-written controller, we auto-generate a higher precedence policy per unique tenant
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.

Are the implementations/end-users expected to write such a controller or do we plan to include something in this repo?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We've discussed writing such a controller as a way to prove out tenancy. Then, either that becomes the answer or the templating mechanism gets absorbed into the vendor implementations once we're happy with it. This section was mainly to say "this feature fits in with what we discussed about tenancy", not to commit us to that tenancy path.

Copy link
Copy Markdown
Contributor

@danwinship danwinship left a comment

Choose a reason for hiding this comment

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

This looks like it matches our consensus at the time it was written, but hasn't been updated after the discussions at KubeCon, #248 (comment).

Especially, the NPEP needs to do something about kubelet probes (either by deciding that "deny all" doesn't deny them (🤮) or by figuring out some way administrators can explicitly re-allow them).

Comment on lines +84 to +86
**Note:** Since we're explicitly using the empty struct here, we won't be able
to add new fields inside the struct later without a breaking change. "Old"
implementations won't see the new fields, and they'd act like they weren't present.
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.

I think we've decided that we don't have to fall into that trap. We know how to create an Informer that will warn you if it sees any fields that it doesn't know how to deserialize.

@k8s-triage-robot
Copy link
Copy Markdown

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. 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