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

dockershim/network: pass ipRange CNI capabilities #64445

Merged
merged 1 commit into from
Aug 16, 2018

Conversation

squeed
Copy link
Contributor

@squeed squeed commented May 29, 2018

What this PR does / why we need it:
Updates the dynamic (capability args) passed from Kubernetes to the CNI plugin. This means CNI plugin authors can offer more features and / or reduce their dependency on the APIServer.

Currently, we only pass the portMappings capability. CNI now supports bandwidth for bandwidth limiting and ipRanges for preferred IP blocks. This PR adds support for these two new capabilities.

Bandwidth limits are provided - as implemented in kubenet - via the pod annotations kubernetes.io/ingress-bandwidth and kubernetes.io/egress-bandwidth.

The ipRanges field simply passes the PodCIDR. This does mean that we need to change the NodeReady algorithm. Previously, we would only set NodeNotReady on missing PodCIDR when using Kubenet. Now, if the CNI configuration includes the ipRanges capability, we need to do the same.

Which issue(s) this PR fixes:
Fixes #64393

Release note:

The dockershim now sets the "bandwidth" and "ipRanges" CNI capabilities (dynamic parameters). Plugin authors and administrators can now take advantage of this by updating their CNI configuration file. For more information, see the [CNI docs](https://github.com/containernetworking/cni/blob/master/CONVENTIONS.md#dynamic-plugin-specific-fields-capabilities--runtime-configuration)

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. 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. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 29, 2018
@k8s-ci-robot k8s-ci-robot requested review from bowei and eparis May 29, 2018 12:42
@squeed
Copy link
Contributor Author

squeed commented May 29, 2018

/sig network
/sig node

@k8s-ci-robot k8s-ci-robot added sig/network Categorizes an issue or PR as relevant to SIG Network. sig/node Categorizes an issue or PR as relevant to SIG Node. labels May 29, 2018
@kragniz
Copy link
Member

kragniz commented May 29, 2018

/ok-to-test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 29, 2018
@squeed squeed force-pushed the more-cni-capabilities branch 2 times, most recently from c412449 to 131f76c Compare May 29, 2018 13:46
@squeed
Copy link
Contributor Author

squeed commented May 29, 2018

/retest

@squeed
Copy link
Contributor Author

squeed commented May 29, 2018

CI is all green :-)

@squeed
Copy link
Contributor Author

squeed commented May 29, 2018

@kubernetes/sig-network-pr-reviews this is ready for review.

@k8s-ci-robot
Copy link
Contributor

@squeed: Reiterating the mentions to trigger a notification:
@kubernetes/sig-network-pr-reviews

In response to this:

@kubernetes/sig-network-pr-reviews this is ready for review.

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.

@krmayankk
Copy link

Will this allow scheduler to consider ip available on a node when making scheduling decisions

@squeed
Copy link
Contributor Author

squeed commented May 30, 2018

@krmayankk no, this doesn't change anything with the scheduler. It just makes it easier for CNI plugins to get the PodCIDR. Right now, CNI plugins have to contact the apiserver; this removes that round-trip.

@squeed
Copy link
Contributor Author

squeed commented May 30, 2018

It seems that bandwidth shaping has also been added in #63194 - I'll rework this PR.

@m1093782566
Copy link
Contributor

m1093782566 commented May 31, 2018

It seems that bandwidth shaping has also been added in #63194 - I'll rework this PR.

Thanks @squeed :)

@squeed
Copy link
Contributor Author

squeed commented Jun 8, 2018

Still waiting for #63194 to be merged; CI is green, it's just pending review.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 11, 2018
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jul 12, 2018
@squeed
Copy link
Contributor Author

squeed commented Jul 12, 2018

OK, blocker has been merged; this PR is ready for review and merge again.

@squeed
Copy link
Contributor Author

squeed commented Jul 12, 2018

Flake: #65466

/retest

@m1093782566
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 13, 2018
@squeed
Copy link
Contributor Author

squeed commented Jul 13, 2018

/retest

@squeed
Copy link
Contributor Author

squeed commented Jul 13, 2018

Paging @dcbw - can I get an approval?

@squeed squeed changed the title dockershim/network: pass ipRange and bandwidth CNI capabilities dockershim/network: pass ipRange CNI capabilities Jul 13, 2018
@@ -638,7 +638,7 @@ function start_apiserver {

function start_controller_manager {
node_cidr_args=""
if [[ "${NET_PLUGIN}" == "kubenet" ]]; then
if [[ "${NET_PLUGIN}" == "kubenet" || "${NET_PLUGIN}" == "cni" ]]; then
Copy link
Member

Choose a reason for hiding this comment

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

Not all CNI plugins will actually want --allocate-node-cidrs, it really depends on what happens to be in /etc/cni/net.d or what happens to get written there when the net plugin's daemonset starts. So I don't think we can assume CNI==allocate-node-cidrs. Maybe have another environment variable for local-up-cluster.sh that turns this option on if NET_PLUGIN=cni?

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 26, 2018
@squeed
Copy link
Contributor Author

squeed commented Jul 26, 2018

Update PR to remove change to hack/local-up-cluster.sh per advice from @dcbw.

This is ready for final review and merge (whenever the flaky tests pass).

@squeed
Copy link
Contributor Author

squeed commented Jul 26, 2018

/retest

Has CI been green in months?

CNI now supports passing ipRanges dynamically. Pass podCIDR so that
plugins no longer have to look it up.
@dcbw
Copy link
Member

dcbw commented Aug 16, 2018

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 16, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dcbw, m1093782566, squeed

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 Aug 16, 2018
@k8s-github-robot
Copy link

/test all [submit-queue is verifying that this PR is safe to merge]

@k8s-ci-robot
Copy link
Contributor

@squeed: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-bazel-test 5d9ec20 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.

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 64445, 67459, 67434). If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit da3f1a3 into kubernetes:master Aug 16, 2018
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. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/network Categorizes an issue or PR as relevant to SIG Network. sig/node Categorizes an issue or PR as relevant to SIG Node. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dockershim (and other runtimes): take advantage of new CNI capabilities
7 participants