commands.sh

kubectl edit

all

Edit Kubernetes resources.

More info →

Options (5)

boolean

Edit a pod in the default namespace

Example: kubectl edit {{[po|pods]}}/{{pod_name}}
boolean

Edit a deployment in the default namespace

Example: kubectl edit {{[deploy|deployment]}}/{{deployment_name}}
boolean

Edit a service in the default namespace

Example: kubectl edit {{[svc|service]}}/{{service_name}}
-n, --namespaceboolean

Edit all entries of a given resource in a given namespace

Example: kubectl edit {{resource}} {{[-n|--namespace]}} {{namespace}}
-o, --outputboolean

Edit a resource in JSON format

Example: kubectl edit {{resource}}/{{resource_name}} {{[-o|--output]}} json

Examples (6)

Edit a pod in the default namespace

kubectl edit [po|pods]/pod_name

Edit a deployment in the default namespace

kubectl edit [deploy|deployment]/deployment_name

Edit a service in the default namespace

kubectl edit [svc|service]/service_name

Edit all entries of a given resource in a given namespace

kubectl edit resource [-n|--namespace] namespace

Edit a resource using a specific editor

KUBE_EDITOR=nano kubectl edit resource/resource_name

Edit a resource in JSON format

kubectl edit resource/resource_name [-o|--output] json
made by @shridhargupta | data from tldr-pages