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

Revise the page to accurately document the well-known labels, annotations and taints #25998

Merged
merged 2 commits into from
Feb 16, 2021
Merged

Revise the page to accurately document the well-known labels, annotations and taints #25998

merged 2 commits into from
Feb 16, 2021

Conversation

CKchen0726
Copy link
Contributor

@CKchen0726 CKchen0726 commented Jan 7, 2021

Ref #25860

Revise the page to accurately document the well-known labels, annotations and taints

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/en Issues or PRs related to English language labels Jan 7, 2021
@k8s-ci-robot k8s-ci-robot added sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 7, 2021
@netlify
Copy link

netlify bot commented Jan 7, 2021

Deploy preview for kubernetes-io-master-staging ready!

Built with commit c6b704e

https://deploy-preview-25998--kubernetes-io-master-staging.netlify.app

@@ -14,6 +14,8 @@ This document serves both as a reference to the values and as a coordination poi

<!-- body -->

# Labels
Copy link
Contributor

Choose a reason for hiding this comment

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

We do not use H1 in any pages. The "top-level" headers are always H2, i.e. ##.


Used on: Service

The label is the tag name we use to differentiate multiple services. Used currently for ELBs only.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The label is the tag name we use to differentiate multiple services. Used currently for ELBs only.
The label is the tag name we use to differentiate multiple Services. Used currently for ELBs only.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd write:

Suggested change
The label is the tag name we use to differentiate multiple services. Used currently for ELBs only.
Kubernetes uses this label to differentiate multiple Services. Used currently for ELBs only.

however:
I also recommend explaining ELB, or rephrasing so that this text is not needed.


Example: `experimental.windows.kubernetes.io/isolation-type: "hyperv"`

The annotation is used to run windows containers with hyperv isolation.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The annotation is used to run windows containers with hyperv isolation.
The annotation is used to run Windows containers with Hyper-V isolation.

Copy link
Contributor

Choose a reason for hiding this comment

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

I presume this is an annotation for a Pod. Is it a hint or something stronger? What acts on it (eg the kubelet)?


## experimental.windows.kubernetes.io/isolation-type

Example: `experimental.windows.kubernetes.io/isolation-type: "hyperv"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we also add "used on:" for annotations, if possible?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It also applies to the annotations, I will update it.


Example: `ingressclass.kubernetes.io/is-default-class: "true"`

When a single IngressClass resource has this annotation set to true, new Ingress resource without a class specified will be assigned this default class.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
When a single IngressClass resource has this annotation set to true, new Ingress resource without a class specified will be assigned this default class.
When a single IngressClass resource has this annotation set to `"true"`, new Ingress resource without a class specified will be assigned this default class.

Boolean values are always a headache. So please accurately specify that the value is actually a string.


Example: `node.kubernetes.io/unschedulable:NoSchedule`

The taint will be added when node becomes unschedulable and removed when node becomes scheduable.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add "This taint is added to a Node during node initialization to avoid race condition."


Example: `node.kubernetes.io/memory-pressure:NoSchedule`

The taint will be added when node has memory pressure and removed when node has enough memory.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add "The kubelet detects memory pressure based on the memory.available and allocatableMemory.available observed on a Node. The observed values are then compared to the corresponding thresholds that can be set on the kubelet to determine if the Node condition and taint should be added/removed."


Example: `node.kubernetes.io/disk-pressure:NoSchedule`

The taint will be added when node has disk pressure and removed when node has enough disk.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add "The kubelet detects disk pressure by observing the imagefs.available,
imagefs.inodesFree, nodefs.available, and nodefs.inodesFree(Linux only) metrics for a Node. The observed values are then compared to the corresponding thresholds that can be set on the kubelet to determine if the node condition and taint should be added/removed."


Example: `node.kubernetes.io/network-unavailable:NoSchedule`

The taint will be added when node's network is unavailable and removed when network becomes ready.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add "This is initially set by the kubelet when the cloud provider used indicates a requirement for additional network configuration. Only when the route on the cloud is configured properly will the taint be removed by the cloud provider."


Example: `node.kubernetes.io/pid-pressure:NoSchedule`

The taint will be added when there are not enough process numbers to assign on the node and removed when there are enough process numbers to assign on the node.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add "The kubelet checks the PIDs consumed by Kubernetes on a node and the rlimit setting on the node. The number of available PIDs are referred to as the pid.available metric. The metric is then compared to the corresponding threshold that can be set on the kubelet to determine if the node condition and taint should be added/removed."

Copy link
Contributor

Choose a reason for hiding this comment

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

Does the kubelet also check the size of /proc/sys/kernel/pid_max when measuring for this taint? If so, we might want document that either here or on a page that we link to.
(if it's looking complex, that's a strong hint to note it and move on - we can sort out the details in a separate issue).

Copy link
Contributor

@sftim sftim left a comment

Choose a reason for hiding this comment

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

Hi @CKchen0726

I really like the intent of this PR. It seems to me that more changes are needed before this could be ready to merge.

I'm very much OK with the idea of merging this even with a few snags left in; as I see it right now though, there are several details worth cleaning up first.

If you'd like advice on next steps, please feel free to reply.


Used on: Service

The label is added by Controller to an Endpoint denoting if its parent Service is Headless.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The label is added by Controller to an Endpoint denoting if its parent Service is Headless.
The control plane adds this label to an Endpoints object when the owning Service is headless.

BTW what about an EndpointSlice? Does the control plane also label EndpointSlices for headless services?


Used on: Node

Starting in v1.17, this label is automatically added to adapt to the situation that the same cluster uses multiple versions of windows server.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Starting in v1.17, this label is automatically added to adapt to the situation that the same cluster uses multiple versions of windows server.
When the kubelet is running on Microsoft Windows, the kubelet automatically labels its node
to record the version of Windows Server in use.

Mentioning v1.17 isn't needed; this PR targets documentation for the current (v1.20) release.


The label is added by Controller to an Endpoint denoting if its parent Service is Headless.

See [service.kubernetes.io/headless](#servicekubernetesioheadless).
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
See [service.kubernetes.io/headless](#servicekubernetesioheadless).
See [`service.kubernetes.io/headless`](#servicekubernetesioheadless).


Used on: Service

The label is the tag name we use to differentiate multiple services. Used currently for ELBs only.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd write:

Suggested change
The label is the tag name we use to differentiate multiple services. Used currently for ELBs only.
Kubernetes uses this label to differentiate multiple Services. Used currently for ELBs only.

however:
I also recommend explaining ELB, or rephrasing so that this text is not needed.


The label is the tag name we use to differentiate multiple services. Used currently for ELBs only.

See [kubernetes.io/service-name](#kubernetesioservice-name).
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand this link.


When upgrading to v1.17 with a cluster with EndpointSlice enabled, the `endpointslice.kubernetes.io/managed-by` label needs to be set on each EndpointSlice.

See [endpointslice.kubernetes.io/managed-by](#endpointslicekubernetesiomanaged-by).
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand this link.


The label can be set to true on an Endpoint resource to indicate that the EndpointSliceMirroring controller should not mirror this resource with EndpointSlices.

See [endpointslice.kubernetes.io/skip-mirror](#endpointslicekubernetesioskip-mirror).
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand this link.


Used on: Service

The label indicates that a custom service proxy will implement this service, kube-proxy does not generate iptables for the service.
Copy link
Contributor

Choose a reason for hiding this comment

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

Bear in mind that kube-proxy might not be running in iptables mode. Can we reword to be more technology-neutral?


The label indicates that a custom service proxy will implement this service, kube-proxy does not generate iptables for the service.

See [service.kubernetes.io/service-proxy-name](#servicekubernetesioservice-proxy-name).
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand this link.


Example: `alpha.kubernetes.io/provided-node-ip: "10.0.0.1"`

The annotation is a node IP annotation set by the "external" cloud provider.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this right?

Suggested change
The annotation is a node IP annotation set by the "external" cloud provider.
The kubelet can set this annotation on a Node to denote its configured IPv4 address.

(does it also work with IPv6? What about a dual-stack node?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this taint is only used for IPv4 address.


Example: `node.kubernetes.io/unreachable:NoExecute`

The control plane monitors the health of all Nodes and decides whether to add or remove the taint.
Copy link
Contributor

@tengqm tengqm Jan 11, 2021

Choose a reason for hiding this comment

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

pls consider my previous suggestions on this and the 'not-ready' labels. It is not clear what 'unreachable' means and what 'not-ready' means.

Your original text should be retained:

The taint will be added when node becomes unreachable (corresponding to Node's Ready condition status Unknown) and removed when node becomes reachable (Node's Ready condition status True).

Copy link
Member

@onlydole onlydole left a comment

Choose a reason for hiding this comment

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

I agree with @sftim, and @tengqm's feedback (I don't have any additional feedback at this time!)


Example: `node.kubernetes.io/unreachable:NoExecute`

The node controller adds the taint to a node corresponding to the NodeCondition `Ready` being `Unknown`.
Copy link
Contributor

Choose a reason for hiding this comment

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

pls be careful when putting new terms. E.g. NodeCondition makes sense to developers, but not to average users.


When kubelet is started with the "external" cloud provider, it sets this annotation on the Node to denote an IP address set from the command line flag (`--node-ip`). This IP is verified with the cloud provider as valid by the cloud-controller-manager.

## The taints listed below are always used on Nodes.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
## The taints listed below are always used on Nodes.
**The taints listed below are always used on Nodes**


Example: `node.kubernetes.io/not-ready:NoExecute`

Sets the taint with `NotReady` on a node at creation. Otherwise, a new node may receive the taint with some delay causing Pods to be scheduled on a not-ready node. node controller will remove the taint when the node becomes ready.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Sets the taint with `NotReady` on a node at creation. Otherwise, a new node may receive the taint with some delay causing Pods to be scheduled on a not-ready node. node controller will remove the taint when the node becomes ready.
The node controller detects whether a node is ready by monitoring its health
and adds or removes this taint accordingly.

Copy link
Contributor

@tengqm tengqm left a comment

Choose a reason for hiding this comment

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

lgtm other than two nits.


Example: `node.kubernetes.io/not-ready:NoExecute`

The node controller detects whether a node is ready by monitoriing its health and adds or removes this taint accordingly.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The node controller detects whether a node is ready by monitoriing its health and adds or removes this taint accordingly.
The node controller detects whether a node is ready by monitoring its health and adds or removes this taint accordingly.


Example: `node.kubernetes.io/unreachable:NoExecute`

The node controller adds the taint to a node corresponding to the [NodeCondition](/docs/concepts/architecture/nodes/#condition) `Ready` being `Unknown`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The node controller adds the taint to a node corresponding to the [NodeCondition](/docs/concepts/architecture/nodes/#condition) `Ready` being `Unknown`.
The node controller adds the taint to a node corresponding to the [Node condition](/docs/concepts/architecture/nodes/#condition) `Ready` being `Unknown`.

Copy link
Contributor

@tengqm tengqm left a comment

Choose a reason for hiding this comment

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

The 'NodeCondition' term still concerns me.

Copy link
Contributor Author

@CKchen0726 CKchen0726 left a comment

Choose a reason for hiding this comment

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

The 'NodeCondition' term still concerns me.
I found there are many quote with "NodeCondition", and link is added to explain it.

eg.


Example: `node.cloudprovider.kubernetes.io/uninitialized:NoSchedule`

Sets this taint on a node to mark it as unusable, when kubelet is started with the "external" cloud provider, until a controller from the cloud-controller-manager initializes this node, and then removes the taint.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Kubelet's --cloud-provider options is now marked as deprecated, I have no idea if this parameter is appropriate.


{{< note >}} Starting in v1.18, this annotation is deprecated in favor of [spec.ingressClassName]. {{< /note >}}

## alpha.kubernetes.io/provided-node-ip
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it do not require enabling alpha feature.


## service.kubernetes.io/headless {#servicekubernetesioheadless}

Example: `service.kubernetes.io/headless=""`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I found that the others have double quotes, keep the style consistent.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 20, 2021
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 21, 2021
Copy link
Contributor

@sftim sftim left a comment

Choose a reason for hiding this comment

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

/lgtm

Some caveats (see inline feedback) but overall these changes leave the page better than they found it.
I haven't checked against source code but all updates look reasonable.


Used on: Service

Kubernetes uses this label to differentiate multiple Services. Used currently for `ELB`(Elastic Load Balancer) only.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this correct:

Suggested change
Kubernetes uses this label to differentiate multiple Services. Used currently for `ELB`(Elastic Load Balancer) only.
Kubernetes uses this label to differentiate multiple Services. Only used for Services that integrate with AWS Elastic Load Balancing using the legacy AWS cloud-controller-manager.

?


## kubernetes.io/service-name {#kubernetesioservice-name}

Example: `kubernetes.io/service-name="nginx"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Because nginx is (can be) a load-balancing solution, I suggest:

Suggested change
Example: `kubernetes.io/service-name="nginx"`
Example: `kubernetes.io/service-name="mywebapp"`

Is that better?


Used on: Pod

The annotation is used to run Windows containers with Hyper-V isolation. To use Hyper-V isolation feature and create a Hyper-V isolated container, the kubelet should be started with feature gates HyperVContainer=true and the Pod should include the annotation experimental.windows.kubernetes.io/isolation-type=hyperv.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd write:

Suggested change
The annotation is used to run Windows containers with Hyper-V isolation. To use Hyper-V isolation feature and create a Hyper-V isolated container, the kubelet should be started with feature gates HyperVContainer=true and the Pod should include the annotation experimental.windows.kubernetes.io/isolation-type=hyperv.
The annotation is used to run Windows pods with Hyper-V isolation. To use Hyper-V isolation feature and create a Hyper-V isolated pod, the kubelet should be started with the [feature gate](/docs/reference/command-line-tools-reference/feature-gates/) `HyperVContainer` enabled, and the Pod should include the annotation `experimental.windows.kubernetes.io/isolation-type=hyperv`.


Used on: IngressClass

When a single IngressClass resource has this annotation set to `"true"`, new Ingress resource without a class specified will be assigned this default class.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
When a single IngressClass resource has this annotation set to `"true"`, new Ingress resource without a class specified will be assigned this default class.
When exactly one IngressClass resource has this annotation set to `"true"`, and you then create a new Ingress resource without a class specified, the control plane assigns this default class to the new Ingress.

?


Example: `node.kubernetes.io/disk-pressure:NoSchedule`

The kubelet detects disk pressure based on `imagefs.available`, `imagefs.inodesFree`, `nodefs.available` and `nodefs.inodesFree`(Linux only) observed on a Node. The observed values are then compared to the corresponding thresholds that can be set on the kubelet to determine if the Node condition and taint should be added/removed.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
The kubelet detects disk pressure based on `imagefs.available`, `imagefs.inodesFree`, `nodefs.available` and `nodefs.inodesFree`(Linux only) observed on a Node. The observed values are then compared to the corresponding thresholds that can be set on the kubelet to determine if the Node condition and taint should be added/removed.
The kubelet detects disk pressure based on `imagefs.available`, `imagefs.inodesFree`, `nodefs.available` and `nodefs.inodesFree` (Linux only) observed on a Node. The observed values are then compared to the corresponding thresholds that can be set on the kubelet to determine if the Node condition and taint should be added/removed.


Example: `node.kubernetes.io/pid-pressure:NoSchedule`

The kubelet checks D-value of the size of `/proc/sys/kernel/pid_max` and the PIDs consumed by Kubernetes on a node to get the number of available PIDs that referred to as the `pid.available` metric. The metric is then compared to the corresponding threshold that can be set on the kubelet to determine if the node condition and taint should be added/removed.
Copy link
Contributor

Choose a reason for hiding this comment

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

“D-value”? This might well confuse readers - it confuses me.

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

LGTM label has been added.

Git tree hash: 5ea4a1c81f9e569fd984421b844764a0a1ff95a7

@tengqm
Copy link
Contributor

tengqm commented Feb 16, 2021

/approve

This overall looks good to me. Language tweakings can be left to future PRs.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tengqm

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 Feb 16, 2021
@k8s-ci-robot k8s-ci-robot merged commit 9853323 into kubernetes:master Feb 16, 2021
@sftim
Copy link
Contributor

sftim commented Feb 16, 2021

@CKchen0726 thanks - this really improves the usefulness of the page.

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. language/en Issues or PRs related to English language lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/docs Categorizes an issue or PR as relevant to SIG Docs. 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.

5 participants