k8wiz
Kubernetes
Medium
Commands

What is the difference between 'kubectl create' and 'kubectl apply'?

Select your answer:

Show answer and explanation

Answer: 'create' is for initial creation only, while 'apply' can create and update resources

Explanation

'kubectl create' is imperative and will fail if the resource already exists. 'kubectl apply' is declarative and can both create new resources and update existing ones. 'apply' is generally preferred for managing resources in production environments.

Read more about Kubernetes