In the documentation, I realized that kubectl apply = kubectl create + kubectl replace . Link
As far as I understand, if I want to create a new k8s resource in a cluster, I should use the kubectl create operation . Now, if I want to update something in k8s live resources, I have to use the kubectl replace operation .
If I want to perform both operations (create a new k8s resource, as well as update k8s live resources), I must use the kubectl apply operation
My questions are: why are there three operations in a cluster to perform the same task? What are the use cases for these operations? How do they differ from each other under the hood?
I am currently using kubectl create to create new resources in the cluster. thank
source
share