Files
tldr/pages.zh/common/kubectl-edit.md

24 lines
539 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# kubectl 编辑
> 编辑 Kubernetes 资源。
> 更多信息:<https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#edit>。
- 编辑一个 Pod
`kubectl edit pod/{{pod_name}}`
- 编辑一个部署:
`kubectl edit deployment/{{deployment_name}}`
- 编辑一个服务:
`kubectl edit svc/{{service_name}}`
- 使用特定编辑器编辑资源:
`KUBE_EDITOR={{nano}} kubectl edit {{resource}}/{{resource_name}}`
- 以 JSON 格式编辑资源:
`kubectl edit {{resource}}/{{resource_name}} --output json`