| domain: "prod" // always the same in the given files |
| component: Component // varies per directory |
| // Any port has the following properties. |
| protocol: *"TCP" | "UDP" // from the Kubernetes definition |
| selector: metadata.labels // we want those to be the same |
| // 1 is the default, but we allow any number |
| // we always have one namesake container |
| spec: containers: [{name: ID}] |
| daemonSet: [ID=_]: _spec & { |
| statefulSet: [ID=_]: _spec & { |
| deployment: [ID=_]: _spec & { |
| metadata: labels: component: Component |
| metadata: labels: component: Component |
| spec: containers: [{name: Name}] |
| // Define the _export option and set the default to true |
| // for all ports defined in all containers. |
| _spec: spec: template: spec: containers: [...{ |
| _export: *true | false // include the port in the service |
| for x in [deployment, daemonSet, statefulSet] for k, v in x { |
| spec: selector: v.spec.template.metadata.labels |
| Port = p.containerPort // Port is an alias |
| } for c in v.spec.template.spec.containers |