What is a potential drawback of kubectl apply related to tracking resource state?

Study for the Kubernetes Certified Network Administrator Exam. Our test offers comprehensive flashcards, multiple-choice questions, and detailed explanations. Be confident for your exam!

Multiple Choice

What is a potential drawback of kubectl apply related to tracking resource state?

Explanation:
The idea being tested is how kubectl apply tracks what you’ve declared and what happens when that declaration changes. kubectl apply stores what you previously applied and uses a merge process to bring the live state in line with the manifest. If you remove resources from the manifest, those resources are no longer part of the declared state. If you run apply with pruning enabled, kubectl will delete resources that aren’t present in the manifest but still exist in the cluster, effectively aligning the cluster with the reduced declaration. This behavior is a real risk: removing items from the manifest can lead to their unintended deletion during apply, because the tooling treats them as no longer desired. If prune isn’t used, those resources won’t be deleted, but they’ll drift from the manifest’s declaration and won’t be tracked going forward.

The idea being tested is how kubectl apply tracks what you’ve declared and what happens when that declaration changes. kubectl apply stores what you previously applied and uses a merge process to bring the live state in line with the manifest. If you remove resources from the manifest, those resources are no longer part of the declared state. If you run apply with pruning enabled, kubectl will delete resources that aren’t present in the manifest but still exist in the cluster, effectively aligning the cluster with the reduced declaration. This behavior is a real risk: removing items from the manifest can lead to their unintended deletion during apply, because the tooling treats them as no longer desired. If prune isn’t used, those resources won’t be deleted, but they’ll drift from the manifest’s declaration and won’t be tracked going forward.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy