kubectl apply vs kubectl create?

前端 未结 9 1471
[愿得一人]
[愿得一人] 2020-11-29 15:06

What I understood by the documentation is that:

  • kubectl create = Creates a new k8s resource in the cluster
  • kubectl replace
9条回答
  •  借酒劲吻你
    2020-11-29 15:17

    Those are two different approaches:

    Imperative Management

    kubectl create is what we call Imperative Management. On this approach you tell the Kubernetes API what you want to create, replace or delete, not how you want your K8s cluster world to look like.

    Declarative Management

    kubectl apply is part of the Declarative Management approach, where changes that you may have applied to a live object (i.e. through scale) are "maintained" even if you apply other changes to the object.

    You can read more about imperative and declarative management in the Kubernetes Object Management documentation.

提交回复
热议问题