Difference between kubectl apply and kubectl create

0 votes
From my understanding of the documentation: kubectl apply = kubectl create + kubectl replace. So, if I'm creating resources for the first time, I should use kubectl create. If I want to update something that already exists, I use kubectl replace. If I want to do both then I do kubectl apply.

I just want to know why are there three different commands doing essentially the same thing? Or is there some key difference that I'm missing?
Sep 11, 2018 in Kubernetes by Atul
• 10,240 points
14,176 views

1 answer to this question.

0 votes

These are two very different approaches. kubectl create uses Imperative Management. Here You specify what you want to create, delete or replace.

kubectl apply uses what we call Declarative approach. Here we tell the api How we want the cluster to look like. So even if you've applied changes to a live object, your changes are maintained.

More information on object management in kubernetes Kubernetes Object Management.

answered Sep 11, 2018 by ajs3033
• 7,300 points

Related Questions In Kubernetes

0 votes
1 answer

What's the difference between kubernetes load balancer and ingress controller?

Load Balancer: So Kubernetes LoadBalancer just points ...READ MORE

answered Jan 4, 2019 in Kubernetes by DareDev
• 6,890 points
13,512 views
0 votes
2 answers

Difference between a Deployment and a DaemonSet in Kubernetes

Adding to @Rohit's answer, I'll explain about ...READ MORE

answered Jan 6, 2019 in Kubernetes by Ramya
4,450 views
0 votes
1 answer
0 votes
1 answer

Difference between deploying apps on hosts and container

The left side architecture represents deploying applications ...READ MORE

answered Apr 17, 2019 in Kubernetes by Sahit
2,864 views
0 votes
1 answer

permissions related to AWS ECR

if you add allowContainerRegistry: true, kops will add those permissions ...READ MORE

answered Oct 9, 2018 in Kubernetes by Kalgi
• 52,360 points
940 views
+1 vote
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17, 2019 in Others by anonymous
14,613 views
0 votes
1 answer

What's the difference betweena a deployment and a stateful set?

Both the deployments and replication controllers are ...READ MORE

answered Oct 3, 2018 in Kubernetes by ajs3033
• 7,300 points
4,213 views
0 votes
1 answer

automating cluster setup and app deplument on kubernetes

Go through Google Cloud Deployment Manager. it automates ...READ MORE

answered Jul 5, 2018 in Kubernetes by ajs3033
• 7,300 points
424 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP