To remove a Kubernetes/OpenShift resource defined in YAML, which command is used?

Prepare for the Red Hat OpenShift Developer II DO288 Exam with our quizzes. Study with flashcards and multiple choice questions, each with hints and explanations. Get ready for your certification!

Multiple Choice

To remove a Kubernetes/OpenShift resource defined in YAML, which command is used?

Explanation:
Deleting resources defined in a YAML manifest is done with a delete command that uses the -f flag to read the file. This reads the manifest and removes every resource described there from the cluster. The other actions operate differently: applying the manifest would reconcile the cluster to match the file by creating or updating resources, not removing them; creating would only create new resources, and patching would modify existing ones rather than delete them. If you run this in the appropriate namespace, you’ll remove exactly the resources listed in the YAML, assuming they exist; if they don’t, you may see not-found messages for those items.

Deleting resources defined in a YAML manifest is done with a delete command that uses the -f flag to read the file. This reads the manifest and removes every resource described there from the cluster. The other actions operate differently: applying the manifest would reconcile the cluster to match the file by creating or updating resources, not removing them; creating would only create new resources, and patching would modify existing ones rather than delete them. If you run this in the appropriate namespace, you’ll remove exactly the resources listed in the YAML, assuming they exist; if they don’t, you may see not-found messages for those items.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy