0

In my szenario I have multiple Microservices that share most of the structure of a kubernetes service. Say we have a structure as the following one:

apiVersion: v1
kind: Service
metadata:
  name: dummy
spec:
  selector:
    app: dummy
  ports:
    - name: 8080-tcp
      protocol: TCP
      port: 8080
      targetPort: 8080

...and assuming I have 3 services service-a, service-b, service-c. Can I have a kustomization that gets the shown service.yaml as input, and outputs three service definition, one per service-a to c?

René Jahn
  • 1,155
  • 1
  • 10
  • 27

1 Answers1

0

You will need to create multiple kustomization files to be able to do that, and then patch it for each iteration. If I understood correctly this is what you want to do, but additionally to this, you will need to create a patch in the children kustomization files like this:

patchesStrategicMerge:
- patch-service-a.yaml