kubectl and kubeconfig · Question 3 of 12

Which command applies a YAML file declaratively and creates or updates the object?

1 answer is correct. Easy Created with AI

Show answer

Answer

  • A kubectl apply -f file.yaml

Explanation

kubectl apply compares the desired state from the file with the object in the cluster: if it is missing, it is created, otherwise it is updated. That is why the same command can be run any number of times.

Certifications & exams

Which exam comes next?

You can already practise for 51 exams, and 16 are up for a vote. See all certifications with their official information, cast your vote or suggest your exam.

See all certifications