About this question
Can you please tell me the difference between kubectl apply and kubectl create. Why there are 3 different commands (apply, replace and create) doing the same thing?
Can you please tell me the difference between kubectl apply and kubectl create. Why there are 3 different commands (apply, replace and create) doing the same thing?
Log in to share your answer and help other learners.
Log in to answerBest Answer · By JanBask Data Science Expert
Answered on Jul 15, 2021
Here are some key differences that you should consider when Kubectl apply vs create:
S. No.
Kubectl apply
Kubectl create
1.
It directly updates in the current live source, only the attributes which are given in the file.
It first deletes the resources and then creates it from the file provided.
2.
The file used in apply can be an incomplete spec
The file used in create should be complete
3.
Apply works only on some properties of the resources
Create works on every property of the resources
4.
You can apply a file that changes only an annotation, without specifying any other properties of the resource.
If you will use the same file with a reply command, the command would fail, due to the missing information.
Hope this helps!
Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.
Step-by-step Data Science guides from industry experts
Common Data Science interview questions, answered
Guides, tips and career advice on Data Science from JanBask experts.
Data Science The Best Data Science Projects (Beginner To Advanced)
Discover 15 data science project ideas from beginner to advanced levels. Includes tech stacks, time estimates, & real-use cases.…
Data Science Data Science vs Software Engineering - What you should know?
Compare Data Science vs. Software Engineering - explore skills, tools, roles, salaries, and career scope. Discover which tech…
Data Science Top 15 Deep Learning Algorithms You Must Know in 2025
Discover the top 15 deep learning algorithms powering AI in 2025. Learn how deep learning models, DL models, and deep machine…
Data Science Deep Learning Tutorial Guide for Beginners
Deep Learning, Machine Learning & Artificial Intelligence have become trending words of the IT sector today.