Say I have 2 kustomization.yaml files, where each one defines a resource
of the same kind/namespace/name. But I want to have a single patch that applies to each.
Directory structure:
- patches
- directory1
- kustomization.yaml
- service-a.yaml
- directory2
- kustomization.yaml
- service-a.yaml
directory1/kustomization.yaml:
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: numaflow-system
resources:
- service-a.yaml # defines Service "Service-A" in namespace "Namespace-A"
directory2/kustomization.yaml:
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: numaflow-system
resources:
- service-a.yaml # defines Service "Service-A" in namespace "Namespace-A"
In my patches
directory I want to have a patch for “Service-A” that applies to both. We can also imagine that there are many more patches in that same directory for other resources that are each defined in directory1 and directory2.
Is there any way to reference that patches
directory from each kustomization.yaml file? Looking to do this in a way that doesn’t require having to separately list all individual patch files in each kustomization.yaml file.
We attempted to update a kustomization.yaml to include:
patchesStrategicMerge:
- ../patches
But perhaps a directory can’t be referenced there?