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

Add KEP 1659 - standard topology labels #1660

Merged
merged 1 commit into from
Jul 16, 2020

Conversation

thockin
Copy link
Member

@thockin thockin commented Apr 1, 2020

Kubernetes has always taken the position that "topology is arbitrary", and
designs dealing with topology have had to take that into account. Even so, the
project has two commonly assumed labels - topology.kubernetes.io/region and
topology.kubernetes.io/zone - which are used in many components, generally
hard-coded and not extensible. Those labels have relatively well understood
meanings, and (so far) have been sufficient to represent what most people need.

This KEP proposes to declare those labels, and possibly one more, as "standard"
and give them more well-defined meanings and semantics. APIs that handle
topology can still handle arbitrary topology keys, but these common ones may be
handled automatically.

/cc @robscott
/cc @freehan
/cc @JeremyOT
/cc @andrewsykim
/cc @dcbw
/cc @danwinship
/cc @ahg-g

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 1, 2020
@k8s-ci-robot
Copy link
Contributor

@thockin: GitHub didn't allow me to request PR reviews from the following users: jeremyot.

Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

Kubernetes has always taken the position that "topology is arbitrary", and
designs dealing with topology have had to take that into account. Even so, the
project has two commonly assumed labels - topology.kubernetes.io/region and
topology.kubernetes.io/zone - which are used in many components, generally
hard-coded and not extensible. Those labels have relatively well understood
meanings, and (so far) have been sufficient to represent what most people need.

This KEP proposes to declare those labels, and possibly one more, as "standard"
and give them more well-defined meanings and semantics. APIs that handle
topology can still handle arbitrary topology keys, but these common ones may be
handled automatically.

/cc @robscott
/cc @freehan
/cc @JeremyOT
/cc @andrewsykim
/cc @dcbw
/cc @danwinship
/cc @ahg-g

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 size/L Denotes a PR that changes 100-499 lines, ignoring generated files. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. labels Apr 1, 2020
@thockin thockin force-pushed the standard-topology-labels branch 2 times, most recently from 35db052 to ed25c3f Compare April 1, 2020 18:23
@alculquicondor
Copy link
Member

#1127 for reference to previous discussions

@thockin
Copy link
Member Author

thockin commented Apr 6, 2020

Hello assignees. I am looking for a volunteer or two to be approvers of this.

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.

/approve
/lgtm

Just had some minor comments/questions about kep.yaml.

@@ -0,0 +1,17 @@
title: Standard Topology Labels
kep-number: NNNN #FIXME
Copy link
Member

Choose a reason for hiding this comment

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

1659

Copy link
Member Author

Choose a reason for hiding this comment

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

will fix

- sig-cloud-provider
- sig-network
- sig-scheduling
status: provisional
Copy link
Member

Choose a reason for hiding this comment

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

I think this should just be implemented since we're just documenting what already exists?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think "implemented" means docs are done.

by downstream consumers of topology.

<<[UNRESOLVED]>>
Should we also try to standardize "kubernetes.io/hostname" as "topology.kubernetes.io/node" ?
Copy link
Member

Choose a reason for hiding this comment

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

This would be really nice for consistency, but not sure it's worth the trouble. Migrating from the old beta labels for zone/region was already a lot of work :(

Copy link
Member Author

Choose a reason for hiding this comment

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

Devil's advocate: we could add it and just support both, but call the old one deprecated.

Choose a reason for hiding this comment

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

See my comment above. I don't actually think limiting the application of these labels to the Node object is beneficial.

Copy link
Member Author

Choose a reason for hiding this comment

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

In this case, the label specifically means that the labelled item is strongly linked to a given k8s Node. The labelled item might be a pod or a disk or something else.

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Apr 7, 2020
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 8, 2020
@thockin
Copy link
Member Author

thockin commented Apr 8, 2020

Nits fixed. I added you as a reviewer. Do you want to be an approver? I want to get broad eyes on this, so I tagged it sig-arch.

@smarterclayton or @dcbw or @danwinship - do you guys have thoughts here? Who else should I ping? :) Other cloud-provider people?

@ahg-g for scheduling

@thockin thockin added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 8, 2020
@andrewsykim
Copy link
Member

ping @cheftako @nckturner for SIG cloud provider

@thockin
Copy link
Member Author

thockin commented May 9, 2020

@cheftako @nckturner @ahg-g @smarterclayton

This KEP has been open for a while. I'm still looking for an approver (unless you want to be it @andrewsykim ?) and more feedback.

@ahg-g
Copy link
Member

ahg-g commented May 9, 2020

@cheftako @nckturner @ahg-g @smarterclayton

This KEP has been open for a while. I'm still looking for an approver (unless you want to be it @andrewsykim ?) and more feedback.

This make a lot of sense for the scheduler, in the fact the scheduler already uses the zone topology label to spread pods by default across zones. The scheduler also special cases kubernetes.io/hostname topology in spreading/affinity computations to boost performance.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 9, 2020
Copy link
Member

@ahg-g ahg-g left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm

creation-date: 2020-03-31
reviewers:
- "@andrewsykim"
approvers:
Copy link
Member

Choose a reason for hiding this comment

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

you can list me as an approver.

Copy link
Member Author

Choose a reason for hiding this comment

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

ACK

@M00nF1sh
Copy link
Contributor

M00nF1sh commented May 9, 2020

/approve
/lgtm
:D

Label prefixes allow us to group labels on common origin and meaning. We
propose to document somewhere (TBD) that the prefix "topology.kuberntes.io" is
explicitly reserved for use in defining metadata about the physical or logical
connectivity and grouping of Kubernetes nodes, and the associated behavioral

Choose a reason for hiding this comment

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

I recognize that the topology.kubernetes.io/region and topology.kubernetes.io/zone labels are currently mostly used for Kubernetes Node objects, but I think explicitly limiting the application of these labels to Node objects might be unnecessarily constraining. I've seen other cloud/virtual objects -- elastic load balancers, VPC subnets, etc -- as well as objects that represent physical inventory -- racks, TORs, etc -- be decorated with these labels and the desired meaning of the label is identical even if it doesn't apply to a Node object.

Copy link
Member Author

Choose a reason for hiding this comment

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

ACK


This will also define that, while labels are generally mutable, the topology
labels should be assumed immutable and that any changes to them may be ignored
by downstream consumers of topology.

Choose a reason for hiding this comment

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

Would "region" have some explicit geographic denotation? Currently, "region" is almost always (AFAICT) assumed to be related to a geographic location. I would support an explicit callout that a "region" should actually NOT be assumed to be a specific geographic location in order to dispel this particularly constraining assumption. :)

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree, but I think that's a comment for a PR to actually write the words :)

by downstream consumers of topology.

<<[UNRESOLVED]>>
Should we also try to standardize "kubernetes.io/hostname" as "topology.kubernetes.io/node" ?

Choose a reason for hiding this comment

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

See my comment above. I don't actually think limiting the application of these labels to the Node object is beneficial.

This KEP proposes to define the meaning and semantics of the following labels:

* topology.kubernetes.io/region
* topology.kubernetes.io/zone

Choose a reason for hiding this comment

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

Above, you say the definition of "region" and "zone" needs to address "the associated behavioral and failure properties of those groups". I think I agree. I'm interested in seeing the proposed definitions from folks in this area.

In particular, I'm curious how a single key-value label will be enough to describe the behaviours and failure properties. Would one alternative to this KEP (albeit a more invasive one) be to have actual Region and Zone objects in the API that could have additional properties associated with them?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't see that as an alternative to, but rather a further extension. If we assert that topology is region/zone/host then we may want to expose additional information about the possible values for those labels (network cost metric, etc)

@szuecs
Copy link
Member

szuecs commented Jun 5, 2020

@thockin I just had an idea about hybrid cloud model could also be improved, if you could specify "use DC first" (maybe more relevant to multi cluster scheduling).

TBH: I don't have a hybrid cloud, so take it maybe as random idea with no priority.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 19, 2020
@thockin
Copy link
Member Author

thockin commented Jun 19, 2020

@szuecs I am trying to bite off a really small nibble here - just documenting the current assumptions and behavior. :) How this is used is a different KEP (or several)

@thockin
Copy link
Member Author

thockin commented Jun 19, 2020

@ahg-g PTAL

Copy link
Member

@ahg-g ahg-g left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

replaces: []

prr-approvers:
- "@jbelamaric"
Copy link
Member

Choose a reason for hiding this comment

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

verify is complaining, use johnbelamaric

Copy link
Member Author

Choose a reason for hiding this comment

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

ACK

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 20, 2020
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 22, 2020
Copy link
Contributor

@freehan freehan left a comment

Choose a reason for hiding this comment

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

LGTM. just one nit

@thockin
Copy link
Member Author

thockin commented Jun 23, 2020

Pushed with nits fixed

@thockin thockin removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 23, 2020
@thockin
Copy link
Member Author

thockin commented Jun 25, 2020

This KEP still needs another LGTM and approve :)

@ahg-g
Copy link
Member

ahg-g commented Jul 16, 2020

/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 16, 2020
@thockin thockin added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 16, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by: ahg-g, andrewsykim, M00nF1sh, thockin

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 merged commit b68b9d7 into kubernetes:master Jul 16, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.19 milestone Jul 16, 2020
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. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. 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.

10 participants