Replace a resource by file or stdin. More information: https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#replace.
stdin
kubectl replace -f path/to/file.yml
kubectl replace -f -
kubectl replace --force -f path/to/file.yml