apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: routes.edgeserverless.kubeedge.io
  labels:
    edgeserverless.kubeedge.io/crd-install: "true"
spec:
  group: edgeserverless.kubeedge.io
  versions:
    - name: v1alpha1
      served: true
      storage: true
      schema:
        openAPIV3Schema:
          description: Define Route YAML Spec
          type: object
          properties:
            spec:
              type: object
              properties:
                id:
                  type: string
                  minLength: 36
                  maxLength: 36
                name:
                  type: string
                  minLength: 8
                  maxLength: 64
                  example: test-route
                uri:
                  type: string
                  example: subdomain.user.com/uri
                  minLength: 0
                  maxLength: 256
                targets:
                  type: array
                  minItems: 1
                  maxItems: 2
                  items:
                    type: object
                    properties:
                      target:
                        type: string
                      type:
                        type: string
                        enum:
                          - k8sservice
                          - yuanrong
                      ratio:
                        type: integer
                        format: int64
                        minimum: 0
                        maximum: 100
  names:
    kind: Route
    plural: routes
    singular: route
    shortNames:
      - rt
  scope: Namespaced