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

Add EndPort to Network Policy - Alpha #97058

Merged
merged 9 commits into from Feb 2, 2021

Conversation

rikatz
Copy link
Contributor

@rikatz rikatz commented Dec 3, 2020

Signed-off-by: Ricardo Pchevuzinske Katz ricardo.katz@gmail.com

What type of PR is this?
/kind feature
/kind api-change

What this PR does / why we need it: This PR adds support to EndPort in Network Policy per Kep enhancements #2079 and the respective KEP (once it gets merged, will update the issue)

Which issue(s) this PR fixes:
Fixes #67526 #93111

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Adds support for endPort field in NetworkPolicy

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

TBD Docs


TODO:

  • Validation
  • Unit tests
  • Documentation
  • Communicate to CNI Providers

@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 3, 2020
@k8s-ci-robot
Copy link
Contributor

@rikatz: This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@k8s-ci-robot k8s-ci-robot added the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Dec 3, 2020
@rikatz
Copy link
Contributor Author

rikatz commented Dec 3, 2020

/sig network

@k8s-ci-robot k8s-ci-robot added sig/network Categorizes an issue or PR as relevant to SIG Network. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Dec 3, 2020
@rikatz rikatz changed the title Add EndPort to Network Policy - Alpha [WIP] Add EndPort to Network Policy - Alpha Dec 3, 2020
@k8s-ci-robot k8s-ci-robot added the sig/apps Categorizes an issue or PR as relevant to SIG Apps. label Dec 3, 2020
@rikatz
Copy link
Contributor Author

rikatz commented Dec 3, 2020

/uncc @danwinship @resouer

@rikatz
Copy link
Contributor Author

rikatz commented Dec 9, 2020

/cc @abhiraut

I'm going to insert the feature gate and the validations during this week, when this is ready I'll convert from Draft to a valid PR

@rikatz
Copy link
Contributor Author

rikatz commented Dec 9, 2020

So far:

  • new fields added to the API
  • validation added to the API
  • CNIs notified about the new field: Antrea (@abhiraut), Calico (via Slack, @caseydavenport aware), Cilium (via Slack), openshift-sdn and ovn-kubernetes (via @danwinship in Slack)

Still needs:

  • validation_test.go to cover all the validation cases

@danwinship
Copy link
Contributor

danwinship commented Dec 10, 2020

OVS-CNI is some weird kubevirt thing. The plugins I'm involved with are openshift-sdn and ovn-kubernetes.

Copy link
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.

I know it's WIP but I was here...

pkg/apis/networking/types.go Outdated Show resolved Hide resolved
pkg/apis/networking/types.go Outdated Show resolved Hide resolved
pkg/apis/networking/types.go Outdated Show resolved Hide resolved
pkg/apis/networking/validation/validation.go Outdated Show resolved Hide resolved
pkg/apis/networking/validation/validation.go Outdated Show resolved Hide resolved
pkg/apis/networking/validation/validation.go Outdated Show resolved Hide resolved
pkg/apis/networking/validation/validation.go Outdated Show resolved Hide resolved
pkg/features/kube_features.go Outdated Show resolved Hide resolved
pkg/features/kube_features.go Outdated Show resolved Hide resolved
pkg/features/kube_features.go Outdated Show resolved Hide resolved
pkg/apis/networking/types.go Outdated Show resolved Hide resolved
pkg/apis/networking/validation/validation.go Outdated Show resolved Hide resolved
pkg/apis/networking/validation/validation.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot removed the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 12, 2020
// This feature is in Alpha state and should be enabled using the Feature Gate
// "NetworkPolicyEndPort".
// +optional
optional int32 endPort = 3;
Copy link
Member

Choose a reason for hiding this comment

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

weird curious what these =2 and =3 things mean

Copy link
Member

Choose a reason for hiding this comment

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

oh nvm i guess thats the byte where they appear ha

Copy link
Member

@jayunit100 jayunit100 left a comment

Choose a reason for hiding this comment

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

minor nits on 65535, but otherwise looks good to me sir !!!!!!!!!!!

@jayunit100
Copy link
Member

@rikatz if my comments arent too important feel free to merge, your call :)

@jayunit100
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 2, 2021
@jayunit100
Copy link
Member

feel free to do the high port number in a follow on review @rikatz

@jayunit100
Copy link
Member

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 2, 2021
@jayunit100
Copy link
Member

wait we need to squash the commits !

@jayunit100
Copy link
Member

ricardo said no squash required

@jayunit100
Copy link
Member

/hold remove

@abhiraut
Copy link
Contributor

abhiraut commented Feb 2, 2021

wait we need to squash the commits !

he has the fancy label applied for this

@jayunit100
Copy link
Member

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 2, 2021
@rikatz
Copy link
Contributor Author

rikatz commented Feb 2, 2021

/retest

@k8s-ci-robot
Copy link
Contributor

@rikatz: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-kubernetes-e2e-gce-ubuntu-containerd 3a68735 link /test pull-kubernetes-e2e-gce-ubuntu-containerd
pull-kubernetes-bazel-test 3a68735 link /test pull-kubernetes-bazel-test

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@rikatz
Copy link
Contributor Author

rikatz commented Feb 2, 2021

/retest
🤞

@k8s-ci-robot k8s-ci-robot merged commit b7c82bb into kubernetes:master Feb 2, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.21 milestone Feb 2, 2021
@jayunit100
Copy link
Member

how did /test pull-kubernetes-bazel-test fail but this merged?

@rikatz
Copy link
Contributor Author

rikatz commented Feb 3, 2021

Yeah this is a mystery to me. Maybe it passed on the batch from tide but failed when I asked to retest

@sftim
Copy link
Contributor

sftim commented Mar 4, 2021

BTW I recommend a tweak to the release note:

Adds support for portRange / endPort in NetworkPolicy

@rikatz
Copy link
Contributor Author

rikatz commented Mar 5, 2021

Thanks @sftim

I've updated to contain only the field name (endPort), as now we already have this documented on website, sounds good? Otherwise can change again! :)

@liggitt liggitt added this to API review completed, 1.21 in API Reviews Mar 5, 2021
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. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. priority/backlog Higher priority than priority/awaiting-more-evidence. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/network Categorizes an issue or PR as relevant to SIG Network. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
Status: API review completed, 1.21
Development

Successfully merging this pull request may close these issues.

Allow range of ports for Network Policy