6

Any suggestion where I can get and install kubectl man pages? Asking Google all the time is getting annoying.

I want to be able to see the man page from the command line like:

$ man kubectl pods

I obviously know about the documentation online on the internet.

Thanks

smrt28
  • 304
  • 3
  • 12

2 Answers2

3

The kubectl CLI is written in Golang, and use Cobra features to automatic generate documentation based on subcommands, flags, etc.

So, you can use kubectl --help to see all the available options. Furthermore, you can dig into specific subcommands options (e.g., kubectl describe --help, kubectl get --help and so on).

More than that, you can use kubectl explain to describe the fields associated with each supported API resources, which is very useful when writing templates. Examples:

  # Get the documentation of the resource and its fields
  kubectl explain pods

  # Get the documentation of a specific field of a resource
  kubectl explain pods.spec.containers
1

I don't think there is a man page for this. But the CLI reference is here and can be bookmarked:

https://kubernetes.io/docs/reference/kubectl/kubectl/

xenoid
  • 5,759