kubectl apply vs kubectl create?

前端 未结 9 1462
[愿得一人]
[愿得一人] 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条回答
  •  -上瘾入骨i
    2020-11-29 15:39

    The explanation below from the official documentation helped me understand kubectl apply.

    This command will compare the version of the configuration that you’re pushing with the previous version and apply the changes you’ve made, without overwriting any automated changes to properties you haven’t specified.

    kubectl create on the other hand will create (should be non-existing) resources.

提交回复
热议问题