How do you define an overlay file for a deployment to override the replica count to 5?

Prepare for the Red Hat Openshift Developer EX288 Exam. Study with comprehensive quizzes and flashcards. Each question includes hints and explanations to enhance your understanding. Ace your exam with confidence!

Multiple Choice

How do you define an overlay file for a deployment to override the replica count to 5?

Explanation:
Overlays and patches modify specific fields of an existing resource, so you need a patch that clearly identifies which resource to change and what to change. To override the number of replicas for a Deployment, you patch the Deployment by including its identifying details and the new replica value under spec.replicas. The YAML shown contains all the necessary parts: apiVersion and kind specify the resource type, metadata.name identifies the exact Deployment to modify, and spec.replicas sets the desired count to 5. This makes it a valid overlay patch for that Deployment, reliably applying the change to the correct resource. The other options aren’t suitable because they’re incomplete, not patch-like, or refer to a different resource type (which doesn’t use replicas).

Overlays and patches modify specific fields of an existing resource, so you need a patch that clearly identifies which resource to change and what to change. To override the number of replicas for a Deployment, you patch the Deployment by including its identifying details and the new replica value under spec.replicas.

The YAML shown contains all the necessary parts: apiVersion and kind specify the resource type, metadata.name identifies the exact Deployment to modify, and spec.replicas sets the desired count to 5. This makes it a valid overlay patch for that Deployment, reliably applying the change to the correct resource.

The other options aren’t suitable because they’re incomplete, not patch-like, or refer to a different resource type (which doesn’t use replicas).

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy