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

Missing links to generated kubeadm pages #24542

Closed
tengqm opened this issue Oct 13, 2020 · 10 comments · Fixed by #24557
Closed

Missing links to generated kubeadm pages #24542

tengqm opened this issue Oct 13, 2020 · 10 comments · Fixed by #24557
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. language/en Issues or PRs related to English language priority/backlog Higher priority than priority/awaiting-more-evidence. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@tengqm
Copy link
Contributor

tengqm commented Oct 13, 2020

This is a Bug Report

Problem:

The following pages under docs/reference/setup-tools/kubeadm/ are currently manually maintained.

kubeadm-alpha.md
kubeadm-config.md
kubeadm-init-phase.md
kubeadm-init.md
kubeadm-join-phase.md
kubeadm-join.md
kubeadm-reset-phase.md
kubeadm-reset.md
kubeadm-token.md
kubeadm-upgrade-phase.md
kubeadm-upgrade.md
kubeadm-version.md

It is expected that each generated page under docs/reference/setup-tools/kubeadm/generated/ has at least one link to it from these files, otherwise it becomes orphaned.

The following pages are orphaned:

docs/reference/setup-tools/kubeadm/generated/kubeadm_alpha_certs.md
docs/reference/setup-tools/kubeadm/generated/kubeadm_alpha_certs_generate-csr.md
docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubelet-finalize.md
docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubelet-finalize_all.md
docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubelet-finalize_experimental-cert-rotation.md
docs/reference/setup-tools/kubeadm/generated/kubeadm_upgrade_node_phase_preflight.md

Proposed Solution:

Add links to these generated pages.

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Oct 13, 2020
@sftim
Copy link
Contributor

sftim commented Oct 13, 2020

Thanks

/sig cluster-lifecycle
/triage accepted
/kind cleanup
/language en
/priority backlog

@k8s-ci-robot k8s-ci-robot added sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. triage/accepted Indicates an issue or PR is ready to be actively worked on. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. language/en Issues or PRs related to English language priority/backlog Higher priority than priority/awaiting-more-evidence. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Oct 13, 2020
@sftim
Copy link
Contributor

sftim commented Oct 13, 2020

We could instead use Docsy's automatic list generation, and add descriptions to each page (eg, to the front matter of /docs/reference/setup-tools/kubeadm/generated/kubeadm-alpha.md).

@neolit123
Copy link
Member

neolit123 commented Oct 13, 2020

docs/reference/setup-tools/kubeadm/generated/kubeadm_alpha_certs.md
docs/reference/setup-tools/kubeadm/generated/kubeadm_alpha_certs_generate-csr.md

kubeadm alpha certs is marked as deprecated in 1.20, so i assume the generation for it will be skipped (the command will be hidden). the command is graduated as kubeadm certs.

the graduation and missing generate-csr is covered here:
#24410

Add links to these generated pages.

the rest are indeed missing.
is there a way to catch this during CI of website PRs?

We could instead use Docsy's automatic list generation, and add descriptions to each page (eg, to the front matter of /docs/reference/setup-tools/kubeadm/generated/kubeadm-alpha.md).

i don't know how Docsy works, but would appreciate ideas around this as manually maintaining the subcommands is not ideal.

@sftim
Copy link
Contributor

sftim commented Oct 13, 2020

Hmm, looking at this a bit more just setting a description might not be enough. The current pages are a mix of generated and manually written ones.

There are a few different ways to combine these. It sounds like extending the generator could help there - that could be a separate feature request against the generator code, eg to warn if a subcommand isn't documented as expected.

@neolit123
Copy link
Member

neolit123 commented Oct 13, 2020

i think we could do the following:

EDIT: and if the kubeadm commands lack sufficient information it should be added in the source code of kubeadm.

would navigating around /generated pages sound like a good idea?
e.g. https://kubernetes.io/docs/reference/setup-tools/kubeadm/generated/kubeadm_config_view/

@sftim
Copy link
Contributor

sftim commented Oct 13, 2020

@neolit123 that sounds like a plan.

BTW, if the generator has the smarts to add metadata into generated Markdown (eg: a YAML list of subcommands, in front matter) then we can implement a Hugo layout that automatically processes that metadata into HTML. I can probably help with this approach, if selected.

So you have options: more code in the docs generator, or less docs generator code but then more work for the Go templating.

@neolit123
Copy link
Member

neolit123 commented Oct 13, 2020

BTW, if the generator has the smarts to add metadata into generated Markdown (eg: a YAML list of subcommands, in front matter) then we can implement a Hugo layout that automatically processes that metadata into HTML. I can probably help with this approach, if selected.

given the subcommand relation is already described by the filenames:

kubeadm_config
kubeadm_config_foo
kubeadm_config_foo_bar

can Hugo just process that instead of requiring the metadata to be part of the markdown?

So you have options: more code in the docs generator, or less docs generator code but then more work for the Go templating.

i think i'm leaning towards the first option, but that is because i don't know much about Hugo.

if the docs team and @tengqm prefer the second option, we should go for that.

@sftim
Copy link
Contributor

sftim commented Oct 13, 2020

given the subcommand relation is already described by the filenames

can Hugo just process that instead of requiring the metadata to be part of the markdown?

I'd rather not hard-code in a full path into the layout code, because I think that could be fragile when it doesn't need to be.

If we can set some marker eg content_type: generated in the front matter for each page where that applies, I think I could persuade Hugo to work out the rest of the details.

@tengqm
Copy link
Contributor Author

tengqm commented Oct 14, 2020

Let's fix it by following the current practices. We can file a new issue to track the improvement/automation.

@neolit123
Copy link
Member

LGTMed the PR, will add notes to #24558
thanks @tengqm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. language/en Issues or PRs related to English language priority/backlog Higher priority than priority/awaiting-more-evidence. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants