kubectl apply vs kubectl create?

前端 未结 9 1472
[愿得一人]
[愿得一人] 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:22

    ┌─────────┬───────────────────────┬────────────────────────┐
    │ command │ object does not exist │ object already exists  │
    ├─────────┼───────────────────────┼────────────────────────┤
    │ create  │ create new object     │          ERROR         │ 
    │         │                       │                        │
    │ apply   │ create new object     │ configure object       │
    │         │ (needs complete spec) │ (accepts partial spec) │
    │         │                       │                        │
    │ replace │         ERROR         │ delete object          │
    │         │                       │ create new object      │
    └─────────┴───────────────────────┴────────────────────────┘
    

提交回复
热议问题