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

kubenet: replace gateway with cni result #85993

Merged
merged 1 commit into from Jan 10, 2020

Conversation

chendotjs
Copy link
Contributor

@chendotjs chendotjs commented Dec 6, 2019

What type of PR is this?

/kind bug

What this PR does / why we need it:

Remove the tricky method that kubenet uses to calculate gateway from pod cidr. Instead,kubenet will fetch gateway from cni result since host-localhas the ability to conclude an appropriate gateway for a subnet as @mars1024 methioned in #84550.

Which issue(s) this PR fixes:

Fixes #84541

Special notes for your reviewer:

Thanks for review.

Does this PR introduce a user-facing change?:

fix a regression in kubenet that prevent pods to obtain ip addresses

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


@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-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 6, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @chendotjs. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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 area/kubelet sig/network Categorizes an issue or PR as relevant to SIG Network. sig/node Categorizes an issue or PR as relevant to SIG Node. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Dec 6, 2019
@chendotjs
Copy link
Contributor Author

/priority important-soon
/cc @khenidak @mars1024 @aojea

I'll keep on adding tests if removing gateway generation is accepted

@k8s-ci-robot k8s-ci-robot added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Dec 6, 2019
@chendotjs chendotjs changed the title [WIP]: kubenet: replace gateway with cni result kubenet: replace gateway with cni result Dec 6, 2019
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 6, 2019
@chendotjs
Copy link
Contributor Author

ping @mars1024
ptal

Copy link
Member

@mars1024 mars1024 left a comment

Choose a reason for hiding this comment

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

Sorry for the late reply, I think this almost LGTM except some tests :)

@mars1024
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 10, 2019
@@ -336,6 +332,9 @@ func (plugin *kubenetNetworkPlugin) Capabilities() utilsets.Int {
// setup sets up networking through CNI using the given ns/name and sandbox ID.
func (plugin *kubenetNetworkPlugin) setup(namespace string, name string, id kubecontainer.ContainerID, annotations map[string]string) error {
var ipv4, ipv6 net.IP
var podGateways []net.IP
var podCIDRs []net.IPNet

This comment was marked as resolved.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 19, 2019
@chendotjs
Copy link
Contributor Author

@mars1024 @aojea
tests have been updated. would you please take another look? thanks for review :)

@aojea
Copy link
Member

aojea commented Dec 19, 2019

I suggest to squash the commits before merge, anyway it LGTM, but defer to @mars1024 the final lgtm

@chendotjs
Copy link
Contributor Author

@aojea thanks for your relpy, the commits are squashed.

@squeed
Copy link
Contributor

squeed commented Dec 19, 2019

I think this is missing something: you still need to keep plugin.podGateways, because that's where we gather state (though it's still wrong, because it doesn't survive reboots... sigh.

@chendotjs
Copy link
Contributor Author

I'm afraid I didn't catch your meaning of gathering state from plugin.podGateways, could you explain a little bit more? @squeed Thanks in advance.
PS: PR #84550 still keeps plugin.podGateways.

@dcbw
Copy link
Member

dcbw commented Jan 9, 2020

I think this is missing something: you still need to keep plugin.podGateways, because that's where we gather state (though it's still wrong, because it doesn't survive reboots... sigh.

@squeed I don't know what state gets kept in there. podGateways doesn't seem to be used for anything other than creating the host-local ranges, which doesn't need state to be kept.

@dcbw
Copy link
Member

dcbw commented Jan 9, 2020

/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 Jan 9, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chendotjs, dcbw

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 Jan 9, 2020
@dcbw
Copy link
Member

dcbw commented Jan 9, 2020

/test pull-kubernetes-e2e-gce-100-performance

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@k8s-ci-robot k8s-ci-robot merged commit 7a50fdb into kubernetes:master Jan 10, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.18 milestone Jan 10, 2020
@chendotjs chendotjs deleted the fix-cidr branch January 12, 2020 13:43
@baranov1ch
Copy link

shouldn't it be cherry-picked to 1.16 and 1.17 ?

@aojea
Copy link
Member

aojea commented Jan 16, 2020

@chendotjs do you mind adding a release note?
I've added this to the cherry picks

fix a regression in kubenet  that  prevent pods to obtain ip addresses

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Jan 18, 2020
@chendotjs
Copy link
Contributor Author

@aojea thanks for reminding,release note updated 😃

k8s-ci-robot added a commit that referenced this pull request Feb 1, 2020
…upstream-release-1.17

Automated cherry pick of #85993: kubenet: replace gateway with cni result
k8s-ci-robot added a commit that referenced this pull request Feb 21, 2020
…upstream-release-1.16

Automated cherry pick of #85993: kubenet: replace gateway with cni result
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. area/kubelet cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. 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/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.

Kubenet not working with pod CIDRs from node spec in 1.16
10 participants