Skip to content

Service Topology implementation for Kubernetes - #72046

Merged
k8s-ci-robot merged 4 commits into
kubernetes:masterfrom
m1093782566:service-topology-api
Nov 15, 2019
Merged

k8s-ci-robot merged 4 commits into
kubernetes:masterfrom
m1093782566:service-topology-api

Conversation

@m1093782566

@m1093782566 m1093782566 commented Dec 14, 2018

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind api-change

/kind feature

What this PR does / why we need it:

API&Implement for feature: topology-aware service routing

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Design document of this feature is kubernetes/enhancements#640

Does this PR introduce a user-facing change?:

Support Service Topology

@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. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. 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. labels Dec 14, 2018
@k8s-ci-robot k8s-ci-robot added kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. and removed needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Dec 14, 2018
@m1093782566 m1093782566 changed the title [WIP] Add service topologykeys API Add service topologykeys API Dec 14, 2018
@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 do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Dec 14, 2018
@m1093782566 m1093782566 changed the title Add service topologykeys API Add service TopologyKeys API Dec 14, 2018
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Dec 14, 2018
@m1093782566

Copy link
Copy Markdown
Contributor Author

/assign @thockin @johnbelamaric @wojtek-t

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Dec 14, 2018
@m1093782566 m1093782566 changed the title Add service TopologyKeys API Add Service TopologyKeys API Dec 14, 2018
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 14, 2018
@andrewsykim

Copy link
Copy Markdown
Member

/retest

1 similar comment
@m1093782566

Copy link
Copy Markdown
Contributor Author

/retest

@thockin thockin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I did a full top-to-bottom review. This looks really good overall. Now that I am refreshed on it, followup reviews should be fast and easy. Of all these comments, only a couple are really significant.

Almost there

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think this needs "get" any more

@andrewsykim andrewsykim Nov 12, 2019

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure this is the case anymore but I was under the impression that we generally only make additive changes to bootstrap policies since removing rules can complicate downgrade.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think it has needed "get" for a long time :)

Comment thread pkg/apis/core/types.go Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These changes did not get copied to the v1 types.go, which is where the actually matter.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice catch. Not very familiar with the mechanism before, now I am familiar with it.

Comment thread pkg/apis/core/types.go Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

unresolved

Comment thread staging/src/k8s.io/api/core/v1/types.go Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I agree that only one is needed, and since topology keys is alpha, that's the one we should yell about. But I won't block the PR just on that.

Comment thread pkg/proxy/topology.go Outdated
Comment thread pkg/proxy/iptables/proxier.go Outdated
Comment thread pkg/proxy/iptables/proxier.go Outdated
Comment thread pkg/proxy/iptables/proxier.go Outdated
Comment thread pkg/proxy/ipvs/proxier.go Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same comments from iptables

@imroc

imroc commented Nov 13, 2019

Copy link
Copy Markdown
Contributor

All fixes have pushed and squashed, PTAL. @thockin

@thockin thockin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm going to approve this but I need a followup PR to do the sync trigger (or explain why not) and to fix validation.

Glad to get this in. Looking forward to the discussion of traffic policy :)

/lgtm
/approve

Comment thread pkg/proxy/iptables/proxier.go Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we need to explicitly trigger a sync (in all 3 handlers), don't we? Otherwise this will be deferred until the next service or endpoint change. Or am I missing some connection? E.g.

lock
old = proxier.nodeLabels
proxier.nodeLabels = new
unlock

if old != new  { 
  proxier.syncProxyRules()
}

@imroc imroc Nov 15, 2019

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, sorry It's my mistake. It seems we still need DeepEqual to compare the old and new labels, but we can compare length at first to avoid traversing when labels been added or removed.

Comment thread pkg/proxy/ipvs/proxier.go Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same comment from iptables re triggering a sync

@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: m1093782566, thockin

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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

@thockin

thockin commented Nov 14, 2019

Copy link
Copy Markdown
Member

Looks like there's a conflict already :(

@andrewsykim

Copy link
Copy Markdown
Member

/milestone v1.17

@imroc

imroc commented Nov 15, 2019

Copy link
Copy Markdown
Contributor

I'll do the rebase to resolve conflicts.

@imroc

imroc commented Nov 15, 2019

Copy link
Copy Markdown
Contributor

CI failure seems is a flake #85320 #85303

@m1093782566

Copy link
Copy Markdown
Contributor Author

/retest

@andrewsykim andrewsykim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Using new as a variable name is the only blocker, lgtm otherwise

Comment thread pkg/apis/core/types.go Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

btw, this is still unresolved, can we fix in follow-up PR?

Comment thread pkg/proxy/iptables/proxier.go Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

shouldn't use new, since it's a go keyword, can we rename to newLabels

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, will fix it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks

Comment thread pkg/proxy/iptables/proxier.go Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

oldLabels

Comment thread pkg/proxy/iptables/proxier.go Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

length is already considered from reflecy.DeepEqual?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, gonna remove length comparation.

Comment thread pkg/proxy/ipvs/proxier.go Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

newLabels

Comment thread pkg/proxy/ipvs/proxier.go Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

oldLabels

Comment thread pkg/proxy/ipvs/proxier.go Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

newLabels

Comment thread pkg/proxy/ipvs/proxier.go Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

oldLabels

m1093782566 and others added 3 commits November 15, 2019 13:36
@josiahbjorgaard

Copy link
Copy Markdown
Contributor

/milestone v1.18

(code freeze v1.17)

@imroc

imroc commented Nov 15, 2019

Copy link
Copy Markdown
Contributor

/milestone v1.18

(code freeze v1.17)

Can we request an exception to fit this into v1.17? @thockin @andrewsykim @johnbelamaric

@andrewsykim

Copy link
Copy Markdown
Member

/milestone v1.17

I can lgtm by EOD PST if comments are addressed, otherwise we'll file an exception (we agreed to do this in today's SIG meeting)

@andrewsykim

Copy link
Copy Markdown
Member

I see comments are addressed now, thanks @imroc

/lgtm

@andrewsykim

Copy link
Copy Markdown
Member

/retest

@andrewsykim

Copy link
Copy Markdown
Member

@imroc looks like we need to update swagger docs and protobuf

@imroc

imroc commented Nov 15, 2019

Copy link
Copy Markdown
Contributor

@imroc looks like we need to update swagger docs and protobuf

Yes, now it's updated and pushed.

@andrewsykim

Copy link
Copy Markdown
Member

/lgtm

@imroc

imroc commented Nov 15, 2019

Copy link
Copy Markdown
Contributor

/retest help wanted please.

@m1093782566

Copy link
Copy Markdown
Contributor Author

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

@m1093782566

Copy link
Copy Markdown
Contributor Author

/retest

@k8s-ci-robot

k8s-ci-robot commented Nov 15, 2019

Copy link
Copy Markdown
Contributor

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

Test name Commit Details Rerun command
pull-kubernetes-node-e2e-containerd 31d623b link /test pull-kubernetes-node-e2e-containerd

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.

Details

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.

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/ipvs 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. 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/apps Categorizes an issue or PR as relevant to SIG Apps. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/network Categorizes an issue or PR as relevant to SIG Network. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.