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

Service Topology implementation for Kubernetes #72046

Merged
merged 4 commits into from
Nov 15, 2019

Conversation

m1093782566
Copy link
Contributor

@m1093782566 m1093782566 commented Dec 14, 2018

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

@andrewsykim andrewsykim left a comment

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

// If this field is specified and all entries have no backends that match
// the topology of the client, the service has no backends for that client
// and connections should fail.
// The special value "*" may be used to mean "any node". This catch-all
Copy link
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?

klog.Errorf("Received a watch event for a node %s that doesn't match the current node %v", node.Name, proxier.hostname)
return
}
new := node.Labels
Copy link
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
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
Member

Choose a reason for hiding this comment

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

thanks

return
}
new := node.Labels
old := proxier.nodeLabels
Copy link
Member

Choose a reason for hiding this comment

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

oldLabels

proxier.mu.Lock()
proxier.nodeLabels = new
proxier.mu.Unlock()
if len(old) != len(new) || !reflect.DeepEqual(old, new) {
Copy link
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
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.

klog.Errorf("Received a watch event for a node %s that doesn't match the current node %v", node.Name, proxier.hostname)
return
}
new := node.Labels
Copy link
Member

Choose a reason for hiding this comment

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

newLabels

return
}
new := node.Labels
old := proxier.nodeLabels
Copy link
Member

Choose a reason for hiding this comment

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

oldLabels

klog.Errorf("Received a watch event for a node %s that doesn't match the current node %v", node.Name, proxier.hostname)
return
}
new := node.Labels
Copy link
Member

Choose a reason for hiding this comment

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

newLabels

return
}
new := node.Labels
old := proxier.nodeLabels
Copy link
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
@imroc imroc force-pushed the service-topology-api branch from 63a1a40 to fce9324 Compare November 15, 2019 05:37
@josiahbjorgaard
Copy link
Contributor

/milestone v1.18

(code freeze v1.17)

@k8s-ci-robot k8s-ci-robot modified the milestones: v1.17, v1.18 Nov 15, 2019
@imroc
Copy link
Contributor

imroc commented Nov 15, 2019

/milestone v1.18

(code freeze v1.17)

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

@andrewsykim
Copy link
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)

@k8s-ci-robot k8s-ci-robot modified the milestones: v1.18, v1.17 Nov 15, 2019
@andrewsykim
Copy link
Member

I see comments are addressed now, thanks @imroc

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 15, 2019
@andrewsykim
Copy link
Member

/retest

@andrewsykim
Copy link
Member

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

@imroc imroc force-pushed the service-topology-api branch from fce9324 to 31d623b Compare November 15, 2019 06:38
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 15, 2019
@imroc
Copy link
Contributor

imroc commented Nov 15, 2019

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

Yes, now it's updated and pushed.

@andrewsykim
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 Nov 15, 2019
@imroc
Copy link
Contributor

imroc commented Nov 15, 2019

/retest help wanted please.

@m1093782566
Copy link
Contributor Author

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

@m1093782566
Copy link
Contributor Author

/retest

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Nov 15, 2019

@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.

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-ci-robot k8s-ci-robot merged commit d9be37e into kubernetes:master Nov 15, 2019
@m1093782566 m1093782566 changed the title Service Topology implementation Service Topology implementation for Kubernetes Nov 15, 2019
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.