| // _base defines settings that apply to all cloud objects |
| // k8s is a set of Kubernetes-specific settings that will be merged in at |
| // the top-level. The allowed fields are type specfic. |
| deployment <Name>: _base & { |
| // Allow any string, but take Name by default. |
| kind: *"deployment" | "stateful" | "daemon" |
| // expose port defines named ports that is exposed in the service |
| // port defines named ports that is not exposed in the service. |
| args: [ "-\(k)=\(v)" for k, v in arg ] | [...string] |
| envSpec: {"\(k)" value: v for k, v in env} |
| service <Name>: _base & { |
| // define services implied by deployments |
| // Copy over all ports exposed from containers. |
| // Set default external port to Port. targetPort must be |
| // the respective containerPort (Port) if it differs from port. |
| targetPort: Port if port != Port |
| } for Name, Port in spec.expose.port |
| } for k, spec in deployment if len(spec.expose.port) > 0 |