blob: 3b8a377804e99b1b4f8c19fe5b79ba4f58cfbdd5 [file] [log] [blame]
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: apisixroutes.apisix.apache.org
spec:
additionalPrinterColumns:
- JSONPath: .spec.http[].match.hosts
name: Hosts
type: string
- JSONPath: .spec.http[].match.paths
name: URIs
type: string
- JSONPath: .spec.http[].match.backends[].serviceName
name: Target Service
type: string
- JSONPath: .spec.tcp[].match.ingressPort
name: Ingress Server Port
type: integer
- JSONPath: .spec.tcp[].match.backend.serviceName
name: Target Service
type: string
- JSONPath: .metadata.creationTimestamp
name: Age
type: date
group: apisix.apache.org
versions:
- name: v1
served: true
storage: false
deprecated: true
- name: v2alpha1
served: true
storage: true
- name: v2beta1
served: true
storage: false
scope: Namespaced
names:
plural: apisixroutes
singular: apisixroute
kind: ApisixRoute
shortNames:
- ar
preserveUnknownFields: true # we have to enable it since plugin config
subresources:
status: {}
validation:
openAPIV3Schema:
type: object
properties:
spec:
type: object
anyOf:
- required: ["http"]
- required: ["tcp"]
- required: ["stream"]
properties:
http:
type: array
minItems: 1
items:
type: object
oneOf:
- required: ["name", "match", "backend"]
- required: ["name", "match", "backends"]
properties:
name:
type: string
minLength: 1
priority:
type: integer
match:
type: object
required:
- paths
properties:
paths:
type: array
minItems: 1
items:
type: string
pattern: "^/[a-zA-Z0-9\\-._~%!$&'()+,;=:@/]*\\*?$"
hosts:
type: array
minItems: 1
items:
type: string
pattern: "^\\*?[0-9a-zA-Z-._]+$"
methods:
type: array
minItems: 1
items:
type: string
enum: ["CONNECT", "DELETE", "GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT", "TRACE"]
remoteAddrs:
type: array
minItems: 1
items:
type: string
exprs:
type: array
minItems: 1
items:
type: object
properties:
subject:
type: object
properties:
scope:
type: string
enum: ["Cookie", "Header", "Path", "Query"]
name:
type: string
minLength: 1
required:
- scope
op:
type: string
enum:
- Equal
- NotEqual
- GreaterThan
- LessThan
- In
- NotIn
- RegexMatch
- RegexNotMatch
- RegexMatchCaseInsensitive
- RegexNotMatchCaseInsensitive
value:
type: string
set:
type: array
items:
type: string
oneOf:
- required: ["subject", "op", "value"]
- required: ["subject", "op", "set"]
websocket:
type: boolean
backend:
type: object
properties:
serviceName:
type: string
minLength: 1
servicePort:
type: integer
minimum: 1
maximum: 65535
resolveGranualrity:
type: string
enum: ["endpoint", "service"]
weight:
type: integer
minimum: 0
subset:
type: string
required:
- serviceName
- servicePort
backends:
type: array
minItems: 1
items:
type: object
properties:
serviceName:
type: string
minLength: 1
servicePort:
type: integer
minimum: 1
maximum: 65535
resolveGranualrity:
type: string
enum: ["endpoint", "service"]
weight:
type: integer
minimum: 0
subset:
type: string
required:
- serviceName
- servicePort
plugins:
type: array
items:
type: object
properties:
name:
type: string
minLength: 1
enable:
type: boolean
config:
type: object
required:
- name
- enable
authentication:
type: object
properties:
enable:
type: boolean
type:
type: string
enum: ["basicAuth", "keyAuth"]
keyAuth:
type: object
properties:
header:
type: string
required:
- enable
tcp:
type: array
minItems: 1
items:
type: object
required: ["name", "match", "backend"]
properties:
name:
type: string
minLength: 1
match:
type: object
properties:
ingressPort:
type: integer
minimum: 1
maximum: 65535
required:
- ingressPort
backend:
type: object
properties:
serviceName:
type: string
minLength: 1
servicePort:
type: integer
minimum: 1
maximum: 65535
resolveGranualrity:
type: string
enum: ["endpoint", "service"]
subset:
type: string
required:
- serviceName
- servicePort
stream:
type: array
minItems: 1
items:
type: object
required: [ "name", "match", "backend", "protocol" ]
properties:
"protocol":
type: string
enum: [ "TCP", "UDP" ]
name:
type: string
minLength: 1
match:
type: object
properties:
ingressPort:
type: integer
minimum: 1
maximum: 65535
required:
- ingressPort
backend:
type: object
properties:
serviceName:
type: string
minLength: 1
servicePort:
type: integer
minimum: 1
maximum: 65535
resolveGranualrity:
type: string
enum: [ "endpoint", "service" ]
subset:
type: string
required:
- serviceName
- servicePort