https://garden.io logo
#🌱|help-and-getting-started
Using YAML anchors across separate garden action manifests
# 🌱|help-and-getting-started
m

many-pizza-75746

01/23/2024, 3:14 AM
Can YAML anchors be referenced from multiple garden action manifests? One example of this is using the same patchResources section for deploy and run actions that use the same set of env variables.
m

mammoth-flag-56137

01/23/2024, 3:32 AM
f

flat-state-47578

01/23/2024, 4:03 AM
I think I had the same question around YAML anchors/references a couple of years ago and in 0.12 at least I believe they were intentionally not supported. That being said we are using them in a Kubernetes deploy action in order to not duplicate all the Ingress http routing rules a bunch of times. I believe that works because they are passed straight onto the K8s cluster without much interpretation by Garden. I second the config templates suggestion above though.
m

mammoth-flag-56137

01/23/2024, 4:05 AM
the workaround is probably to define a secret/configmap resource with garden using patchresources to insert the runtime values, then refer to that secret/configmap in the deployment manifest to avoid having multiple duplicate patchresources blocks