LinuxCommandLibrary

kubectl-replace

Replace a resource by file or `stdin`.

TLDR

Replace the resource using the resource definition file

$ kubectl replace -f [path/to/file.yml]
copy


Replace the resource using the input passed into stdin
$ kubectl replace -f -
copy


Force replace, delete and then re-create the resource
$ kubectl replace --force -f [path/to/file.yml]
copy

Copied to clipboard