Calico: Support for NetworkPolicy port ranges

Created on 9 Dec 2020  路  3Comments  路  Source: projectcalico/calico

Proposed in this KEP: https://github.com/kubernetes/enhancements/tree/master/keps/sig-network/2079-network-policy-port-range

Calico already supports port ranges, so this should be pretty easy to do.

Just need to bump the API version we include to one that has the new types, add the right translation code to libcalico-go so that it translates NP port ranges to Calico port ranges.

Upstream PR implementing the new API here: https://github.com/kubernetes/kubernetes/pull/97058

kinenhancement

Most helpful comment

@caseydavenport you can assign this to me, I will take a look as soon as the code gets merged (so can use the latest library, etc etc)

All 3 comments

@caseydavenport you can assign this to me, I will take a look as soon as the code gets merged (so can use the latest library, etc etc)

@caseydavenport opened the PRs in advance:

https://github.com/projectcalico/libcalico-go/pull/1357 -> For the libcalico-go (which is the main code)
https://github.com/projectcalico/kube-controllers/pull/600 -> Just a unit test so we know kube-controllers works fine with the lib

Once the main k/k PR gets merged and released we can move forward to update the k8s libs (need to update both PRs) and hopefully get them merged :)

BTW, I've tested with the changed k8s code locally and the tests worked as a charm, just need to make some better tests with a running cluster

Was this page helpful?
0 / 5 - 0 ratings