Kustomize
Hard
Concepts
Which field path selects the value of the env var SERVICE_HOST in the container named app, for a replacement target?
Select your answer:
Show answer and explanation
Answer: spec.template.spec.containers.[name=app].env.[name=SERVICE_HOST].value
Explanation
Kustomize field paths use dots and select list items by a field value with [name=app], or every item with *. A replacement's options include delimiter and index, which let you replace one part of a value, such as the host in a URL.
More hard Kustomize questions
- A production overlay lists a remote base with ?ref=main. What's the risk?
- A strategic merge patch adds one item to a list in a custom resource, but the build replaces the whole list. Why?
- A custom resource refers to a generated ConfigMap by name, but after the build it still uses the name without the hash suffix. Why?
- An overlay's configMapGenerator uses the same name as one generated in the base, with no behavior set. What happens?
- A kustomization sets namespace: team-a and includes a ClusterRole. What happens to the ClusterRole?
- In a strategic merge patch, what does $patch: replace inside a container's resources map do?