KUBERNETES(1)(kubernetes)
π KUBERNETES(1)(kubernetes) π
okay so bestie, this page lives in section 1 of the manual (that's the "kubernetes" manual, iykyk), and the original was written by Eric Paris back in Jan 2015. that's the whole header, we're done with it, now let's get into the good stuff π
β¨ NAME β¨
kubectl explain β get documentation for a resource π
πΈ SYNOPSIS πΈ
kubectl explain [OPTIONS]
π¦ DESCRIPTION π¦
so like, this command describes the fields and the whole structure of various resources. it's the "wait what even IS this field" command. the main character of "i forgot what spec.containers takes". π
This command describes the fields associated with each supported API resource. Fields are identified via a simple JSONPath identifier:
TYPE.FIELDNAME[.FIELDNAME]
Information about each field is retrieved from the server in OpenAPI format. yes, the server is the one doing the homework here, not your laptop. β¨
and if you want the full list of supported resources? run kubectl api-resources. that's the menu, this is the nutrition label. π
π OPTIONS π
--api-version=""β get different explanations for a particular API version (it wants an API group/version, likeapps/v1). π¦--max-depth=0β maximum recursion depth when printing nested fields with--recursive.0means no limit at all, go wild. but heads up: it requires--recursivewhen it's greater than 0. no--recursive, no depth party. π-o,--output="plaintext"β the format in which to render the schema. your choices areplaintextandplaintext-openapiv2. that's it, that's the list, it's giving "two options and both are plaintext". π-R,--recursive=falseβ print the fields of fields. like, the fields inside the fields. π use--max-depthto cap the recursion depth so it doesn't spiral forever.
π OPTIONS INHERITED FROM PARENT COMMANDS π
these are the ones you get for free from kubectl itself. they're not this command's own, they're the family hand-me-downs. π«Ά
--as=""β username to impersonate for the operation. user could be a regular user or a service account in a namespace. π--as-group=[]β group to impersonate for the operation. this flag can be repeated to specify multiple groups. π--as-uid=""β UID to impersonate for the operation. πͺͺ--as-user-extra=[]β user extras to impersonate for the operation. this flag can be repeated to specify multiple values for the same key. π--cache-dir="/home/username/.kube/cache"β default cache directory. π--certificate-authority=""β path to a cert file for the certificate authority. π--client-certificate=""β path to a client certificate file for TLS. π--client-key=""β path to a client key file for TLS. ποΈ--cluster=""β the name of the kubeconfig cluster to use. βοΈ--context=""β the name of the kubeconfig context to use. π―--disable-compression=falseβ iftrue, opt-out of response compression for all requests to the server. ποΈ--insecure-skip-tls-verify=falseβ iftrue, the server's certificate will not be checked for validity. this will make your HTTPS connections insecure. do not do this casually bestie, this is the "i trust everyone" setting. π--kubeconfig=""β path to the kubeconfig file to use for CLI requests. π--kuberc=""β path to the kuberc file to use for preferences. this can be disabled by exporting theKUBECTL_KUBERC=falsefeature gate or turning off the featureKUBERC=off. πͺ--match-server-version=falseβ require server version to match client version. π€-n,--namespace=""β if present, the namespace scope for this CLI request. π--password=""β password for basic authentication to the API server. π€«--profile="none"β name of profile to capture. one of(none|cpu|heap|goroutine|threadcreate|block|mutex|trace). π--profile-output="profile.pprof"β name of the file to write the profile to. π--proxy-url=""β proxy URL to use for requests to the API server. π--request-timeout="0"β the length of time to wait before giving up on a single server request. non-zero values should contain a corresponding time unit (e.g.1s,2m,3h). a value of zero means don't timeout requests. β³-s,--server=""β the address and port of the Kubernetes API server. π₯οΈ--tls-server-name=""β server name to use for server certificate validation. if it is not provided, the hostname used to contact the server is used. π·οΈ--token=""β bearer token for authentication to the API server. π«--user=""β the name of the kubeconfig user to use. π§βπ»--username=""β username for basic authentication to the API server. π--version=falseβ--version,--version=rawprints version information and quits;--version=vX.Y.Z...sets the reported version. π’--warnings-as-errors=falseβ treat warnings received from the server as errors and exit with a non-zero exit code. β οΈ
π EXAMPLE π
okay here's the fun part, the little field trips you can take. all of these are exactly as written, no cap. π
# Get the documentation of the resource and its fields
kubectl explain pods
# Get all the fields in the resource
kubectl explain pods --recursive
# Get fields in the resource up to a specific recursive depth
kubectl explain pods --recursive --max-depth=2
# Get the explanation for deployment in supported api versions
kubectl explain deployments --api-version=apps/v1
# Get the documentation of a specific field of a resource
kubectl explain pods.spec.containers
# Get the documentation of resources in different format
kubectl explain deployment --output=plaintext-openapiv2
β SEE ALSO β
π HISTORY π
January 2015, originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! π§ manifesting auto-generated docs for everyone, fr fr. β¨
and that's the whole page bestie!! π this came from the Manuals set, User section, filed under KUBERNETES(1)(kubernetes) β go explain some pods, you got this π«ΆπΈ
π¦ where this page comes from
- arch rolling: kubectl 1.37.2-1 Β· Apache-2.0
- fedora 43: kubernetes1.37-client 1.37.0-3.fc43
- fedora 43: kubernetes1.37-client 1.37.1-1.fc43 Β· Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-3-Clause-HP AND CC-BY-4.0 AND ISC AND MIT AND MPL-2.0
- fedora 44: kubernetes1.37-client 1.37.0-3.fc44
- fedora 44: kubernetes1.37-client 1.37.1-1.fc44 Β· Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-3-Clause-HP AND CC-BY-4.0 AND ISC AND MIT AND MPL-2.0
- nixpkgs unstable: kubectl 1.37.2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms