In an overlay kustomization.yaml, how do you refer to an overlay file called replica_count.yaml?

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

In an overlay kustomization.yaml, how do you refer to an overlay file called replica_count.yaml?

Explanation:
In an overlay, changes to existing resources are applied through patch files listed under patches. Each entry points to a patch file that contains the modification you want to apply. So to reference a patch file named replica_count.yaml, you place it in the patches list like this: patches: - replica_count.yaml This tells Kustomize to apply that patch when building the overlay, modifying the target resource (for example, adjusting the replicas field in a Deployment) according to the patch contents. The other options don’t reflect how patches are referenced in an overlay: overlays is not a standard field for listing patch files; resources is used to bring in base resources, not to apply patches; and patchesStrategicMerge is used only when you intend to apply a strategic merge patch, which is a different patch mechanism.

In an overlay, changes to existing resources are applied through patch files listed under patches. Each entry points to a patch file that contains the modification you want to apply. So to reference a patch file named replica_count.yaml, you place it in the patches list like this:

patches:

  • replica_count.yaml

This tells Kustomize to apply that patch when building the overlay, modifying the target resource (for example, adjusting the replicas field in a Deployment) according to the patch contents.

The other options don’t reflect how patches are referenced in an overlay: overlays is not a standard field for listing patch files; resources is used to bring in base resources, not to apply patches; and patchesStrategicMerge is used only when you intend to apply a strategic merge patch, which is a different patch mechanism.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy