kubectl apply vs kubectl create?

What I understood by the documentation is that:

  • kubectl create
    

    Creates a new k8s resource in the cluster

  • kubectl replace
    

    Updates a resource in the live cluster

  • kubectl apply
    

    If I want to do create + replace (Reference)

My questions are

  1. Why are there three operations for doing the same task in a cluster?
  2. What are the use cases for these operations?
  3. How do they differ from each other under the hood?

9 Answers
9

Leave a Comment