0
0
Kubernetesdevops~5 mins

kubectl apply vs create in Kubernetes - Quick Revision & Key Differences

Choose your learning style9 modes available
Recall & Review
beginner
What does kubectl create do?

kubectl create makes a new resource in Kubernetes from a file or command. It fails if the resource already exists.

Click to reveal answer
beginner
What is the main purpose of kubectl apply?

kubectl apply creates or updates a resource by applying changes from a file. It can update existing resources without deleting them.

Click to reveal answer
beginner
Can kubectl create update an existing resource?

No, kubectl create will fail if the resource already exists. It only creates new resources.

Click to reveal answer
intermediate
How does kubectl apply handle changes to resources?

kubectl apply compares the current resource state with the desired state in the file and updates only the differences.

Click to reveal answer
beginner
When should you prefer kubectl apply over kubectl create?

Use kubectl apply when you want to manage resources declaratively and update them safely over time.

Click to reveal answer
What happens if you run kubectl create on a resource that already exists?
AIt fails with an error
BIt deletes the resource
CIt updates the resource
DIt ignores the command
Which command can update an existing Kubernetes resource?
Akubectl create
Bkubectl apply
Ckubectl delete
Dkubectl get
What is the main benefit of using kubectl apply?
AIt only creates new resources
BIt deletes resources safely
CIt manages resources declaratively and updates them
DIt shows resource status
Which command should you use to create a resource only once?
Akubectl create
Bkubectl replace
Ckubectl edit
Dkubectl apply
If you want to update a resource without deleting it first, which command is best?
Akubectl create
Bkubectl expose
Ckubectl delete
Dkubectl apply
Explain the difference between kubectl create and kubectl apply.
Think about creating new vs updating existing resources.
You got /4 concepts.
    When would you choose to use kubectl apply instead of kubectl create in your workflow?
    Consider how you manage changes to resources.
    You got /4 concepts.