Updating the kubeadm command reference documentation
kubeadm uses Cobra as a CLI library and the command line reference documentation is generated automatically. The generated output can be found here:
If a command or a command flag is added or removed this has to be reflected in the documentation on a new release. Some manual steps are still required.
Example scenario: adding a new sub-command
- Implemented a new kubeadm configuration sub-command called
kubeadm config newcommand
by sending a PR forkubernetes/kubernetes
. - Run
./hack/update-generated-docs.sh
. This will generate files in the folder./docs/admin/
. Some of them will be for the new command -*newcommand*
. - In your local copy of
kubernetes/website
navigate to this folder:./content/en/docs/reference/setup-tools/kubeadm/generated
- Copy the
*newcommand*
files fromkubernetes/docs/admin/
to the this folder. - Create a PR for
kubernetes/website
and add these files to your commit. - Depending on the parent command of
newcommand
(in this caseconfig
) import the generated sub-command in the parent command MD file like so:Full example:## kubeadm config view {#cmd-config-newcommand} {{< include "generated/kubeadm_config_newcommand.md" >}}
- Please note that these files will act only as placeholders with respect to the
kubernetes/website
and they will later be overwritten with generated files by a separate tool that also supports HTML styles. This process is managed by SIG Docs on each release.
Example scenario: removing a sub-command
- Remove the sub-command
kubeadm config newcommand
by sending a PR forkubernetes/kubernetes
. - When sending a PR for
kubernetes/website
make sure that you remove files related to*newcommand*
in:./content/en/docs/reference/setup-tools/kubeadm/generated
- Also, remove includes and any notes about this command in the parent command MD file.
- Make sure that you commit these changes in your PR for
kubernetes/website
.