mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-01-26 11:33:59 +00:00
22 lines
595 B
Plaintext
22 lines
595 B
Plaintext
---
|
|
syntax: markdown
|
|
tags: [tldr, common]
|
|
source: https://github.com/tldr-pages/tldr.git
|
|
---
|
|
# kubectl replace
|
|
|
|
> Replace a resource by file or `stdin`.
|
|
> More information: <https://kubernetes.io/docs/reference/kubectl/generated/kubectl_replace>.
|
|
|
|
- Replace the resource using the resource definition file:
|
|
|
|
`kubectl replace {{[-f|--filename]}} {{path/to/file.yml}}`
|
|
|
|
- Replace the resource using the input passed into `stdin`:
|
|
|
|
`kubectl replace {{[-f|--filename]}} -`
|
|
|
|
- Force replace, delete and then re-create the resource:
|
|
|
|
`kubectl replace --force {{[-f|--filename]}} {{path/to/file.yml}}`
|