kubectl

install
[!NOTE] references:
info:
kubectl-convert
[!NOTE] A plugin for Kubernetes command-line tool kubectl, which allows you to convert manifests between different API versions. This can be particularly helpful to migrate manifests to a non-deprecated api version with newer Kubernetes release.
sha256 check
osx
completion
[!NOTE] The Homebrew installation of bash-completion v2 sources all the files in the
BASH_COMPLETION_COMPAT_DIRdirectory, that's why the latter two methods work
linux
completion
windows
get
get all
get cluster status
get po
name
or
sort pods by nodeName
sort by restart count
get all images
list
list image from a single deploy
or
or
list all quota
check api server healthy
delete apiservers
get apiservers
get apiresources
check available
check apiservices registered
check etcd
output format
[!NOTE|label:references:]
patch
json patch path
[!TIP]
jsonpath vs. json patch path
PURPOSE
JSON PATCH PATH
JSONPATH EXPRESSION
Used for
Modifying fields in kubectl patch --type=json
Reading/querying values in kubectl get -o jsonpath=...
Syntax
Slash-separated path (/a/b/0/c)
Dot notation with array indexing ({.a.b[0].c})
Array access
Index with /0/
Index with [0]
Wildcards / filters
Not supported
Supported
FIELD
JSON PATCH PATH
JSONPATH EXPRESSION
Container image
/spec/template/spec/containers/0/image
{.spec.template.spec.containers[0].image}
Container name
/spec/template/spec/containers/0/name
{.spec.template.spec.containers[0].name}
apply
[!NOTE|label:referenecs]
oneline cmd
rollback
[!NOTE|label:references:] -** How do you rollback deployments in Kubernetes?
check history
upgrade with CHANGE-CAUSE
check comments
check replicasets
Last updated
Was this helpful?