mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-08-22 11:44:01 +02:00
28 lines
772 B
Markdown
28 lines
772 B
Markdown
# kubectl edit
|
|
|
|
> Edit Kubernetes resources.
|
|
> More information: <https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#edit>.
|
|
|
|
- Edit a pod in the default namespace:
|
|
|
|
`kubectl edit {{[po|pod]}}/{{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`
|