website icon indicating copy to clipboard operation
website copied to clipboard

Incorrect docs for label kubernetes.io/metadata.name

Open sftim opened this issue 5 years ago • 12 comments

This is a Bug Report

Problem: The docs for kubernetes.io/metadata.name say that this label is set on namespaces when you enable a feature gate, NamespaceDefaultLabelName. However that's no longer true. In current Kubernetes the control plane always sets that label on namespaces.

Proposed Solution: Reword that section to make it clear that the control plane always sets that label

Page to Update: https://kubernetes.io/docs/reference/labels-annotations-taints/#kubernetes-io-metadata-name

Kubernetes Version: v1.22

Additional Information: /language en /kind bug /help /priority backlog

sftim avatar Nov 23 '21 23:11 sftim

@sftim: This request has been marked as needing help from a contributor.

Guidelines

Please ensure that the issue body includes answers to the following questions:

  • Why are we solving this issue?
  • To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
  • Does this issue have zero to low barrier of entry?
  • How can the assignee reach out to you for help?

For more details on the requirements of such an issue, please see here and ensure that they are met.

If this request no longer meets these requirements, the label can be removed by commenting with the /remove-help command.

In response to this:

This is a Bug Report

Problem: The docs for kubernetes.io/metadata.name say that this label is set on namespaces when you enable a feature gate, NamespaceDefaultLabelName. However that's no longer true. In current Kubernetes the control plane always sets that label on namespaces.

Proposed Solution: Reword that section to make it clear that the control plane always sets that label

Page to Update: https://kubernetes.io/docs/reference/labels-annotations-taints/#kubernetes-io-metadata-name

Kubernetes Version: v1.22

Additional Information: /language en /kind bug /help /priority backlog

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 avatar Nov 23 '21 23:11 k8s-ci-robot

/triage accepted

sftim avatar Nov 23 '21 23:11 sftim

Hi, I would like to work on this issue. /assign

Babapool avatar Nov 24 '21 13:11 Babapool

Any questions about how to fix it?

sftim avatar Nov 24 '21 14:11 sftim

I have a few technical questions:

  1. Since the Control Plane sets the label on the namespaces instead of enabling the feature gate , so there would be no role of K8s API server in this process?
  2. How will the Control Plane set label on the namespaces? I mean will it do it automatically or we need to do something to set the labels like enabling something?

Babapool avatar Nov 24 '21 14:11 Babapool

The API server is part of the control plane - see https://kubernetes.io/docs/concepts/overview/components/ The component within the control plane that sets the label isn't a detail we need to specify here. All we need to mention is that it happens, and phrase it to make it clear it's not optional.

sftim avatar Nov 24 '21 14:11 sftim

Just to be clear that the Control plane will set the labels of the namespace and this setting of the labels is compulsorily (i.e. it is not optional).?

Babapool avatar Nov 24 '21 16:11 Babapool

(also, we'll get the API Machinery folks to check technical accuracy anyway - it's not on the docs contributors to thoroughly verify this kind of detail).

sftim avatar Nov 24 '21 16:11 sftim

Okay thanks . I now have an idea on how to fix the issue, I will file the PR soon :)

Babapool avatar Nov 24 '21 16:11 Babapool

I have a doubt: The phrase which tells that It is compulsory to set a label to namespace ,would it be better to included it as a Note shortcode or it should be kept as a normal text.?

Babapool avatar Nov 24 '21 19:11 Babapool

@babapool the best way for folks to review your proposed changes is to open a pull request. (Also: anyone else who wants to work on this is welcome to - please liaise with @Babapool if that's feasible).

sftim avatar Nov 24 '21 23:11 sftim

I have filed a PR but if anyone wants to work on this they are welcome to share their suggestions in the PR Conversation. Thanks.

Babapool avatar Nov 25 '21 07:11 Babapool