Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should protocol be at a higher level than ports? #72

Closed
akhilles opened this issue Feb 23, 2023 · 12 comments
Closed

Should protocol be at a higher level than ports? #72

akhilles opened this issue Feb 23, 2023 · 12 comments
Assignees
Labels
api-review Categorizes an issue or PR as actively needing an API review. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@akhilles
Copy link

In the current API, port numbers/ranges are given priority over protocol:

ports:
- portNumber:
    port: 443
    protocol: TCP

This makes it tricky to express rules for port-less IP protocols such as ICMP, OSPF, etc. This is probably fine for IPv4, but I think this is a problem for IPv6 due it's heavy reliance on ICMP. I expect a use-case such as "allow (TCP, 443) and ICMP traffic" to become increasingly common as IPv6 adoption improves. Maybe ICMP should be special-cased? But that seems a bit awkward.

I'm wondering whether this use-case warrants making protocol a top-level field in AdminNetworkPolicyPort. E.g:

ports:
- protocol: TCP
  portNumber:
    port: 443
- protocol: ICMP

Or perhaps making protocols the one-of variants. E.g:

protocols:
- tcp:
    portNumber:
      port: 443
- udp:
    portRange:
      start: 0
      end: 1024
- icmp:
    type: 3 # Destination unreachable

This is a much larger change, but it enables custom selectors for each protocol. Looks like the CNI-specific NetworkPolicy APIs have gone in this direction as well:

Apologies if this has already been discussed elsewhere, I wasn't able to find any previous threads on this topic.

@astoycos astoycos self-assigned this Feb 27, 2023
@astoycos astoycos added the api-review Categorizes an issue or PR as actively needing an API review. label Feb 27, 2023
@astoycos
Copy link
Member

This is a great issue @akhilles, I think we need to work through this a bit more as a group and will add it to the agenda to discuss tomorrow during the group meeting.

@akhilles
Copy link
Author

Thanks! I'll try to attend the meeting.

@danwinship
Copy link
Contributor

Kubernetes networking is mostly only defined for TCP, UDP, and SCTP. It is not defined how/whether NetworkPolicy affects other protocols. (Eg, if a pod is "isolated", does that mean it can't answer ARP requests?) For that matter, it is not defined how/whether other protocols even work on the pod network. (Eg, it's possible that the network plugin intercepts ARP requests and unicasts them rather than broadcasting them, or even just forges replies to them without ever sending them to the expected destination.)

Administrators may have more use cases for lower-level protocols than app developers, but this still runs into the problem that it's not well-defined whether such protocols can traverse the pod network at all...

@npinaeva
Copy link
Member

We decided to start with documenting the fact that the behaviour for some protocols is undefined. Then we are going to get a list of use cases when this behaviour needs to be defined and update the docs for the corresponding cases.

@npinaeva
Copy link
Member

/assign @npinaeva

@npinaeva
Copy link
Member

kubernetes/website#39875

@k8s-triage-robot
Copy link

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

This bot triages un-triaged issues 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 issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue 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 Jun 8, 2023
@npinaeva
Copy link
Member

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 12, 2023
@k8s-triage-robot
Copy link

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

This bot triages un-triaged issues 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 issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue 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 Jan 22, 2024
@npinaeva
Copy link
Member

This effort will be tracked here #187

@npinaeva
Copy link
Member

npinaeva commented Feb 1, 2024

/close

@k8s-ci-robot
Copy link
Contributor

@npinaeva: Closing this issue.

In response to this:

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-review Categorizes an issue or PR as actively needing an API review. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

6 participants