# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/registry/expose.cue
apiVersion: core.oam.dev/v1beta1
kind: TraitDefinition
metadata:
  annotations:
    definition.oam.dev/description: Expose a service.
  name: expose
  namespace: vela-system
spec:
  podDisruptive: false
  schematic:
    cue:
      template: |
        parameter: {
        	domain: string
        	http: [string]: int
        }
        outputs: {
        	for k, v in parameter.http {
        		(k): {
        			apiVersion: "v1"
        			kind:       "Service"
        			spec: {
        				selector: app: context.name
        				ports: [{
        					port:       v
        					targetPort: v
        				}]
        			}
        		}
        	}
        }

