# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/registry/route.cue
apiVersion: core.oam.dev/v1beta1
kind: TraitDefinition
metadata:
  annotations:
    definition.oam.dev/description: Configures external access to your service.
  name: route
  namespace: vela-system
spec:
  appliesToWorkloads:
    - deployments.apps
  definitionRef:
    name: routes.standard.oam.dev
  extension:
    install:
      helm:
        name: nginx-ingress
        repo: stable
        url: https://kubernetes-charts.storage.googleapis.com/
        version: 1.41.2
  podDisruptive: false
  schematic:
    cue:
      template: |
        outputs: route: {
        	apiVersion: "standard.oam.dev/v1alpha1"
        	kind:       "Route"
        	spec: {
        		host: parameter.domain

        		if parameter.issuer != "" {
        			tls: issuerName: parameter.issuer
        		}

        		if parameter["rules"] != _|_ {
        			rules: parameter.rules
        		}

        		provider:     *"nginx" | parameter.provider
        		ingressClass: *"nginx" | parameter.ingressClass
        	}
        }
        parameter: {
        	// +usage= Domain name
        	domain: *"" | string

        	issuer: *"" | string
        	rules?: [...{
        		path:          string
        		rewriteTarget: *"" | string
        	}]
        	provider?:     string
        	ingressClass?: string
        }

