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.