Traefik & Kubernetes with Gateway API

The Kubernetes Gateway API, The Experimental Way.

Gateway API is the evolution of Kubernetes APIs that relate to Services, such as Ingress. The Gateway API project is part of Kubernetes, working under SIG-NETWORK.

The Kubernetes Gateway provider is a Traefik implementation of the Gateway API specifications from the Kubernetes Special Interest Groups (SIGs).

This provider is proposed as an experimental feature and partially supports Gateway API v1.0.0 specification.

Enabling The Experimental Kubernetes Gateway Provider

Since this provider is still experimental, it needs to be activated in the experimental section of the static configuration.

File (YAML)

  1. experimental:
  2. kubernetesGateway: true
  3. providers:
  4. kubernetesGateway: {}
  5. #...

File (TOML)

  1. [experimental]
  2. kubernetesGateway = true
  3. [providers.kubernetesGateway]
  4. #...

CLI

  1. --experimental.kubernetesgateway=true --providers.kubernetesgateway=true #...

Requirements

Traefik follows the Kubernetes support policy, and supports at least the latest three minor versions of Kubernetes. General functionality cannot be guaranteed for versions older than that.

All Steps for a Successful Deployment

  • Add/update the Kubernetes Gateway API definitions.
  • Add/update the RBAC for the Traefik custom resources.
  • Add all needed Kubernetes Gateway API resources.

Examples

Kubernetes Gateway Provider Basic Example

Gateway API

  1. ---
  2. apiVersion: gateway.networking.k8s.io/v1
  3. kind: GatewayClass
  4. metadata:
  5. name: my-gateway-class
  6. spec:
  7. controllerName: traefik.io/gateway-controller
  8. ---
  9. apiVersion: gateway.networking.k8s.io/v1
  10. kind: Gateway
  11. metadata:
  12. name: my-gateway
  13. spec:
  14. gatewayClassName: my-gateway-class
  15. listeners:
  16. - name: https
  17. protocol: HTTPS
  18. port: 443
  19. tls:
  20. certificateRefs:
  21. - kind: Secret
  22. name: mysecret
  23. ---
  24. apiVersion: gateway.networking.k8s.io/v1
  25. kind: HTTPRoute
  26. metadata:
  27. name: http-app
  28. namespace: default
  29. spec:
  30. parentRefs:
  31. - name: my-gateway
  32. hostnames:
  33. - whoami
  34. rules:
  35. - matches:
  36. - path:
  37. type: Exact
  38. value: /foo
  39. backendRefs:
  40. - name: whoami
  41. port: 80
  42. weight: 1

Whoami Service

  1. ---
  2. apiVersion: apps/v1
  3. kind: Deployment
  4. metadata:
  5. name: whoami
  6. spec:
  7. replicas: 2
  8. selector:
  9. matchLabels:
  10. app: whoami
  11. template:
  12. metadata:
  13. labels:
  14. app: whoami
  15. spec:
  16. containers:
  17. - name: whoami
  18. image: traefik/whoami
  19. ---
  20. apiVersion: v1
  21. kind: Service
  22. metadata:
  23. name: whoami
  24. spec:
  25. selector:
  26. app: whoami
  27. ports:
  28. - protocol: TCP
  29. port: 80

Traefik Service

  1. ---
  2. apiVersion: v1
  3. kind: ServiceAccount
  4. metadata:
  5. name: traefik-controller
  6. ---
  7. apiVersion: apps/v1
  8. kind: Deployment
  9. metadata:
  10. name: traefik
  11. spec:
  12. replicas: 1
  13. selector:
  14. matchLabels:
  15. app: traefik-lb
  16. template:
  17. metadata:
  18. labels:
  19. app: traefik-lb
  20. spec:
  21. serviceAccountName: traefik-controller
  22. containers:
  23. - name: traefik
  24. image: traefik:v3.0
  25. args:
  26. - --entryPoints.web.address=:80
  27. - --entryPoints.websecure.address=:443
  28. - --experimental.kubernetesgateway
  29. - --providers.kubernetesgateway
  30. ports:
  31. - name: web
  32. containerPort: 80
  33. - name: websecure
  34. containerPort: 443
  35. ---
  36. apiVersion: v1
  37. kind: Service
  38. metadata:
  39. name: traefik
  40. spec:
  41. type: LoadBalancer
  42. selector:
  43. app: traefik-lb
  44. ports:
  45. - protocol: TCP
  46. port: 80
  47. targetPort: web
  48. name: web
  49. - protocol: TCP
  50. port: 443
  51. targetPort: websecure
  52. name: websecure

Gateway API CRDs

  1. # All resources definition must be declared
  2. #
  3. # config/crd/experimental/gateway.networking.k8s.io_gatewayclasses.yaml
  4. #
  5. apiVersion: apiextensions.k8s.io/v1
  6. kind: CustomResourceDefinition
  7. metadata:
  8. annotations:
  9. api-approved.kubernetes.io: https://github.com/kubernetes-sigs/gateway-api/pull/2466
  10. gateway.networking.k8s.io/bundle-version: v1.0.0
  11. gateway.networking.k8s.io/channel: experimental
  12. creationTimestamp: null
  13. name: gatewayclasses.gateway.networking.k8s.io
  14. spec:
  15. group: gateway.networking.k8s.io
  16. names:
  17. categories:
  18. - gateway-api
  19. kind: GatewayClass
  20. listKind: GatewayClassList
  21. plural: gatewayclasses
  22. shortNames:
  23. - gc
  24. singular: gatewayclass
  25. scope: Cluster
  26. versions:
  27. - additionalPrinterColumns:
  28. - jsonPath: .spec.controllerName
  29. name: Controller
  30. type: string
  31. - jsonPath: .status.conditions[?(@.type=="Accepted")].status
  32. name: Accepted
  33. type: string
  34. - jsonPath: .metadata.creationTimestamp
  35. name: Age
  36. type: date
  37. - jsonPath: .spec.description
  38. name: Description
  39. priority: 1
  40. type: string
  41. name: v1
  42. schema:
  43. openAPIV3Schema:
  44. description: "GatewayClass describes a class of Gateways available to the user for creating Gateway resources. \n It is recommended that this resource be used as a template for Gateways. This means that a Gateway is based on the state of the GatewayClass at the time it was created and changes to the GatewayClass or associated parameters are not propagated down to existing Gateways. This recommendation is intended to limit the blast radius of changes to GatewayClass or associated parameters. If implementations choose to propagate GatewayClass changes to existing Gateways, that MUST be clearly documented by the implementation. \n Whenever one or more Gateways are using a GatewayClass, implementations SHOULD add the `gateway-exists-finalizer.gateway.networking.k8s.io` finalizer on the associated GatewayClass. This ensures that a GatewayClass associated with a Gateway is not deleted while in use. \n GatewayClass is a Cluster level resource."
  45. properties:
  46. apiVersion:
  47. description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
  48. type: string
  49. kind:
  50. description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
  51. type: string
  52. metadata:
  53. type: object
  54. spec:
  55. description: Spec defines the desired state of GatewayClass.
  56. properties:
  57. controllerName:
  58. description: "ControllerName is the name of the controller that is managing Gateways of this class. The value of this field MUST be a domain prefixed path. \n Example: \"example.net/gateway-controller\". \n This field is not mutable and cannot be empty. \n Support: Core"
  59. maxLength: 253
  60. minLength: 1
  61. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$
  62. type: string
  63. x-kubernetes-validations:
  64. - message: Value is immutable
  65. rule: self == oldSelf
  66. description:
  67. description: Description helps describe a GatewayClass with more details.
  68. maxLength: 64
  69. type: string
  70. parametersRef:
  71. description: "ParametersRef is a reference to a resource that contains the configuration parameters corresponding to the GatewayClass. This is optional if the controller does not require any additional configuration. \n ParametersRef can reference a standard Kubernetes resource, i.e. ConfigMap, or an implementation-specific custom resource. The resource can be cluster-scoped or namespace-scoped. \n If the referent cannot be found, the GatewayClass's \"InvalidParameters\" status condition will be true. \n Support: Implementation-specific"
  72. properties:
  73. group:
  74. description: Group is the group of the referent.
  75. maxLength: 253
  76. pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  77. type: string
  78. kind:
  79. description: Kind is kind of the referent.
  80. maxLength: 63
  81. minLength: 1
  82. pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
  83. type: string
  84. name:
  85. description: Name is the name of the referent.
  86. maxLength: 253
  87. minLength: 1
  88. type: string
  89. namespace:
  90. description: Namespace is the namespace of the referent. This field is required when referring to a Namespace-scoped resource and MUST be unset when referring to a Cluster-scoped resource.
  91. maxLength: 63
  92. minLength: 1
  93. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
  94. type: string
  95. required:
  96. - group
  97. - kind
  98. - name
  99. type: object
  100. required:
  101. - controllerName
  102. type: object
  103. status:
  104. default:
  105. conditions:
  106. - lastTransitionTime: "1970-01-01T00:00:00Z"
  107. message: Waiting for controller
  108. reason: Waiting
  109. status: Unknown
  110. type: Accepted
  111. description: "Status defines the current state of GatewayClass. \n Implementations MUST populate status on all GatewayClass resources which specify their controller name."
  112. properties:
  113. conditions:
  114. default:
  115. - lastTransitionTime: "1970-01-01T00:00:00Z"
  116. message: Waiting for controller
  117. reason: Pending
  118. status: Unknown
  119. type: Accepted
  120. description: "Conditions is the current status from the controller for this GatewayClass. \n Controllers should prefer to publish conditions using values of GatewayClassConditionType for the type of each Condition."
  121. items:
  122. description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, \n type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
  123. properties:
  124. lastTransitionTime:
  125. description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
  126. format: date-time
  127. type: string
  128. message:
  129. description: message is a human readable message indicating details about the transition. This may be an empty string.
  130. maxLength: 32768
  131. type: string
  132. observedGeneration:
  133. description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.
  134. format: int64
  135. minimum: 0
  136. type: integer
  137. reason:
  138. description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.
  139. maxLength: 1024
  140. minLength: 1
  141. pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
  142. type: string
  143. status:
  144. description: status of the condition, one of True, False, Unknown.
  145. enum:
  146. - "True"
  147. - "False"
  148. - Unknown
  149. type: string
  150. type:
  151. description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
  152. maxLength: 316
  153. pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
  154. type: string
  155. required:
  156. - lastTransitionTime
  157. - message
  158. - reason
  159. - status
  160. - type
  161. type: object
  162. maxItems: 8
  163. type: array
  164. x-kubernetes-list-map-keys:
  165. - type
  166. x-kubernetes-list-type: map
  167. supportedFeatures:
  168. description: 'SupportedFeatures is the set of features the GatewayClass support. It MUST be sorted in ascending alphabetical order. '
  169. items:
  170. description: SupportedFeature is used to describe distinct features that are covered by conformance tests.
  171. enum:
  172. - Gateway
  173. - GatewayPort8080
  174. - GatewayStaticAddresses
  175. - HTTPRoute
  176. - HTTPRouteDestinationPortMatching
  177. - HTTPRouteHostRewrite
  178. - HTTPRouteMethodMatching
  179. - HTTPRoutePathRedirect
  180. - HTTPRoutePathRewrite
  181. - HTTPRoutePortRedirect
  182. - HTTPRouteQueryParamMatching
  183. - HTTPRouteRequestMirror
  184. - HTTPRouteRequestMultipleMirrors
  185. - HTTPRouteResponseHeaderModification
  186. - HTTPRouteSchemeRedirect
  187. - Mesh
  188. - ReferenceGrant
  189. - TLSRoute
  190. type: string
  191. maxItems: 64
  192. type: array
  193. x-kubernetes-list-type: set
  194. type: object
  195. required:
  196. - spec
  197. type: object
  198. served: true
  199. storage: false
  200. subresources:
  201. status: {}
  202. - additionalPrinterColumns:
  203. - jsonPath: .spec.controllerName
  204. name: Controller
  205. type: string
  206. - jsonPath: .status.conditions[?(@.type=="Accepted")].status
  207. name: Accepted
  208. type: string
  209. - jsonPath: .metadata.creationTimestamp
  210. name: Age
  211. type: date
  212. - jsonPath: .spec.description
  213. name: Description
  214. priority: 1
  215. type: string
  216. name: v1beta1
  217. schema:
  218. openAPIV3Schema:
  219. description: "GatewayClass describes a class of Gateways available to the user for creating Gateway resources. \n It is recommended that this resource be used as a template for Gateways. This means that a Gateway is based on the state of the GatewayClass at the time it was created and changes to the GatewayClass or associated parameters are not propagated down to existing Gateways. This recommendation is intended to limit the blast radius of changes to GatewayClass or associated parameters. If implementations choose to propagate GatewayClass changes to existing Gateways, that MUST be clearly documented by the implementation. \n Whenever one or more Gateways are using a GatewayClass, implementations SHOULD add the `gateway-exists-finalizer.gateway.networking.k8s.io` finalizer on the associated GatewayClass. This ensures that a GatewayClass associated with a Gateway is not deleted while in use. \n GatewayClass is a Cluster level resource."
  220. properties:
  221. apiVersion:
  222. description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
  223. type: string
  224. kind:
  225. description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
  226. type: string
  227. metadata:
  228. type: object
  229. spec:
  230. description: Spec defines the desired state of GatewayClass.
  231. properties:
  232. controllerName:
  233. description: "ControllerName is the name of the controller that is managing Gateways of this class. The value of this field MUST be a domain prefixed path. \n Example: \"example.net/gateway-controller\". \n This field is not mutable and cannot be empty. \n Support: Core"
  234. maxLength: 253
  235. minLength: 1
  236. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$
  237. type: string
  238. x-kubernetes-validations:
  239. - message: Value is immutable
  240. rule: self == oldSelf
  241. description:
  242. description: Description helps describe a GatewayClass with more details.
  243. maxLength: 64
  244. type: string
  245. parametersRef:
  246. description: "ParametersRef is a reference to a resource that contains the configuration parameters corresponding to the GatewayClass. This is optional if the controller does not require any additional configuration. \n ParametersRef can reference a standard Kubernetes resource, i.e. ConfigMap, or an implementation-specific custom resource. The resource can be cluster-scoped or namespace-scoped. \n If the referent cannot be found, the GatewayClass's \"InvalidParameters\" status condition will be true. \n Support: Implementation-specific"
  247. properties:
  248. group:
  249. description: Group is the group of the referent.
  250. maxLength: 253
  251. pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  252. type: string
  253. kind:
  254. description: Kind is kind of the referent.
  255. maxLength: 63
  256. minLength: 1
  257. pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
  258. type: string
  259. name:
  260. description: Name is the name of the referent.
  261. maxLength: 253
  262. minLength: 1
  263. type: string
  264. namespace:
  265. description: Namespace is the namespace of the referent. This field is required when referring to a Namespace-scoped resource and MUST be unset when referring to a Cluster-scoped resource.
  266. maxLength: 63
  267. minLength: 1
  268. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
  269. type: string
  270. required:
  271. - group
  272. - kind
  273. - name
  274. type: object
  275. required:
  276. - controllerName
  277. type: object
  278. status:
  279. default:
  280. conditions:
  281. - lastTransitionTime: "1970-01-01T00:00:00Z"
  282. message: Waiting for controller
  283. reason: Waiting
  284. status: Unknown
  285. type: Accepted
  286. description: "Status defines the current state of GatewayClass. \n Implementations MUST populate status on all GatewayClass resources which specify their controller name."
  287. properties:
  288. conditions:
  289. default:
  290. - lastTransitionTime: "1970-01-01T00:00:00Z"
  291. message: Waiting for controller
  292. reason: Pending
  293. status: Unknown
  294. type: Accepted
  295. description: "Conditions is the current status from the controller for this GatewayClass. \n Controllers should prefer to publish conditions using values of GatewayClassConditionType for the type of each Condition."
  296. items:
  297. description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, \n type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
  298. properties:
  299. lastTransitionTime:
  300. description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
  301. format: date-time
  302. type: string
  303. message:
  304. description: message is a human readable message indicating details about the transition. This may be an empty string.
  305. maxLength: 32768
  306. type: string
  307. observedGeneration:
  308. description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.
  309. format: int64
  310. minimum: 0
  311. type: integer
  312. reason:
  313. description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.
  314. maxLength: 1024
  315. minLength: 1
  316. pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
  317. type: string
  318. status:
  319. description: status of the condition, one of True, False, Unknown.
  320. enum:
  321. - "True"
  322. - "False"
  323. - Unknown
  324. type: string
  325. type:
  326. description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
  327. maxLength: 316
  328. pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
  329. type: string
  330. required:
  331. - lastTransitionTime
  332. - message
  333. - reason
  334. - status
  335. - type
  336. type: object
  337. maxItems: 8
  338. type: array
  339. x-kubernetes-list-map-keys:
  340. - type
  341. x-kubernetes-list-type: map
  342. supportedFeatures:
  343. description: 'SupportedFeatures is the set of features the GatewayClass support. It MUST be sorted in ascending alphabetical order. '
  344. items:
  345. description: SupportedFeature is used to describe distinct features that are covered by conformance tests.
  346. enum:
  347. - Gateway
  348. - GatewayPort8080
  349. - GatewayStaticAddresses
  350. - HTTPRoute
  351. - HTTPRouteDestinationPortMatching
  352. - HTTPRouteHostRewrite
  353. - HTTPRouteMethodMatching
  354. - HTTPRoutePathRedirect
  355. - HTTPRoutePathRewrite
  356. - HTTPRoutePortRedirect
  357. - HTTPRouteQueryParamMatching
  358. - HTTPRouteRequestMirror
  359. - HTTPRouteRequestMultipleMirrors
  360. - HTTPRouteResponseHeaderModification
  361. - HTTPRouteSchemeRedirect
  362. - Mesh
  363. - ReferenceGrant
  364. - TLSRoute
  365. type: string
  366. maxItems: 64
  367. type: array
  368. x-kubernetes-list-type: set
  369. type: object
  370. required:
  371. - spec
  372. type: object
  373. served: true
  374. storage: true
  375. subresources:
  376. status: {}
  377. status:
  378. acceptedNames:
  379. kind: ""
  380. plural: ""
  381. conditions: null
  382. storedVersions: null
  383. #
  384. # config/crd/experimental/gateway.networking.k8s.io_gateways.yaml
  385. #
  386. apiVersion: apiextensions.k8s.io/v1
  387. kind: CustomResourceDefinition
  388. metadata:
  389. annotations:
  390. api-approved.kubernetes.io: https://github.com/kubernetes-sigs/gateway-api/pull/2466
  391. gateway.networking.k8s.io/bundle-version: v1.0.0
  392. gateway.networking.k8s.io/channel: experimental
  393. creationTimestamp: null
  394. name: gateways.gateway.networking.k8s.io
  395. spec:
  396. group: gateway.networking.k8s.io
  397. names:
  398. categories:
  399. - gateway-api
  400. kind: Gateway
  401. listKind: GatewayList
  402. plural: gateways
  403. shortNames:
  404. - gtw
  405. singular: gateway
  406. scope: Namespaced
  407. versions:
  408. - additionalPrinterColumns:
  409. - jsonPath: .spec.gatewayClassName
  410. name: Class
  411. type: string
  412. - jsonPath: .status.addresses[*].value
  413. name: Address
  414. type: string
  415. - jsonPath: .status.conditions[?(@.type=="Programmed")].status
  416. name: Programmed
  417. type: string
  418. - jsonPath: .metadata.creationTimestamp
  419. name: Age
  420. type: date
  421. name: v1
  422. schema:
  423. openAPIV3Schema:
  424. description: Gateway represents an instance of a service-traffic handling infrastructure by binding Listeners to a set of IP addresses.
  425. properties:
  426. apiVersion:
  427. description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
  428. type: string
  429. kind:
  430. description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
  431. type: string
  432. metadata:
  433. type: object
  434. spec:
  435. description: Spec defines the desired state of Gateway.
  436. properties:
  437. addresses:
  438. description: "Addresses requested for this Gateway. This is optional and behavior can depend on the implementation. If a value is set in the spec and the requested address is invalid or unavailable, the implementation MUST indicate this in the associated entry in GatewayStatus.Addresses. \n The Addresses field represents a request for the address(es) on the \"outside of the Gateway\", that traffic bound for this Gateway will use. This could be the IP address or hostname of an external load balancer or other networking infrastructure, or some other address that traffic will be sent to. \n If no Addresses are specified, the implementation MAY schedule the Gateway in an implementation-specific manner, assigning an appropriate set of Addresses. \n The implementation MUST bind all Listeners to every GatewayAddress that it assigns to the Gateway and add a corresponding entry in GatewayStatus.Addresses. \n Support: Extended \n "
  439. items:
  440. description: GatewayAddress describes an address that can be bound to a Gateway.
  441. oneOf:
  442. - properties:
  443. type:
  444. enum:
  445. - IPAddress
  446. value:
  447. anyOf:
  448. - format: ipv4
  449. - format: ipv6
  450. - properties:
  451. type:
  452. not:
  453. enum:
  454. - IPAddress
  455. properties:
  456. type:
  457. default: IPAddress
  458. description: Type of the address.
  459. maxLength: 253
  460. minLength: 1
  461. pattern: ^Hostname|IPAddress|NamedAddress|[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$
  462. type: string
  463. value:
  464. description: "Value of the address. The validity of the values will depend on the type and support by the controller. \n Examples: `1.2.3.4`, `128::1`, `my-ip-address`."
  465. maxLength: 253
  466. minLength: 1
  467. type: string
  468. required:
  469. - value
  470. type: object
  471. x-kubernetes-validations:
  472. - message: Hostname value must only contain valid characters (matching ^(\*\.)?[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$)
  473. rule: 'self.type == ''Hostname'' ? self.value.matches(r"""^(\*\.)?[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$"""): true'
  474. maxItems: 16
  475. type: array
  476. x-kubernetes-validations:
  477. - message: IPAddress values must be unique
  478. rule: 'self.all(a1, a1.type == ''IPAddress'' ? self.exists_one(a2, a2.type == a1.type && a2.value == a1.value) : true )'
  479. - message: Hostname values must be unique
  480. rule: 'self.all(a1, a1.type == ''Hostname'' ? self.exists_one(a2, a2.type == a1.type && a2.value == a1.value) : true )'
  481. gatewayClassName:
  482. description: GatewayClassName used for this Gateway. This is the name of a GatewayClass resource.
  483. maxLength: 253
  484. minLength: 1
  485. type: string
  486. infrastructure:
  487. description: "Infrastructure defines infrastructure level attributes about this Gateway instance. \n Support: Core \n "
  488. properties:
  489. annotations:
  490. additionalProperties:
  491. description: AnnotationValue is the value of an annotation in Gateway API. This is used for validation of maps such as TLS options. This roughly matches Kubernetes annotation validation, although the length validation in that case is based on the entire size of the annotations struct.
  492. maxLength: 4096
  493. minLength: 0
  494. type: string
  495. description: "Annotations that SHOULD be applied to any resources created in response to this Gateway. \n For implementations creating other Kubernetes objects, this should be the `metadata.annotations` field on resources. For other implementations, this refers to any relevant (implementation specific) \"annotations\" concepts. \n An implementation may chose to add additional implementation-specific annotations as they see fit. \n Support: Extended"
  496. maxProperties: 8
  497. type: object
  498. labels:
  499. additionalProperties:
  500. description: AnnotationValue is the value of an annotation in Gateway API. This is used for validation of maps such as TLS options. This roughly matches Kubernetes annotation validation, although the length validation in that case is based on the entire size of the annotations struct.
  501. maxLength: 4096
  502. minLength: 0
  503. type: string
  504. description: "Labels that SHOULD be applied to any resources created in response to this Gateway. \n For implementations creating other Kubernetes objects, this should be the `metadata.labels` field on resources. For other implementations, this refers to any relevant (implementation specific) \"labels\" concepts. \n An implementation may chose to add additional implementation-specific labels as they see fit. \n Support: Extended"
  505. maxProperties: 8
  506. type: object
  507. type: object
  508. listeners:
  509. description: "Listeners associated with this Gateway. Listeners define logical endpoints that are bound on this Gateway's addresses. At least one Listener MUST be specified. \n Each Listener in a set of Listeners (for example, in a single Gateway) MUST be _distinct_, in that a traffic flow MUST be able to be assigned to exactly one listener. (This section uses \"set of Listeners\" rather than \"Listeners in a single Gateway\" because implementations MAY merge configuration from multiple Gateways onto a single data plane, and these rules _also_ apply in that case). \n Practically, this means that each listener in a set MUST have a unique combination of Port, Protocol, and, if supported by the protocol, Hostname. \n Some combinations of port, protocol, and TLS settings are considered Core support and MUST be supported by implementations based on their targeted conformance profile: \n HTTP Profile \n 1. HTTPRoute, Port: 80, Protocol: HTTP 2. HTTPRoute, Port: 443, Protocol: HTTPS, TLS Mode: Terminate, TLS keypair provided \n TLS Profile \n 1. TLSRoute, Port: 443, Protocol: TLS, TLS Mode: Passthrough \n \"Distinct\" Listeners have the following property: \n The implementation can match inbound requests to a single distinct Listener. When multiple Listeners share values for fields (for example, two Listeners with the same Port value), the implementation can match requests to only one of the Listeners using other Listener fields. \n For example, the following Listener scenarios are distinct: \n 1. Multiple Listeners with the same Port that all use the \"HTTP\" Protocol that all have unique Hostname values. 2. Multiple Listeners with the same Port that use either the \"HTTPS\" or \"TLS\" Protocol that all have unique Hostname values. 3. A mixture of \"TCP\" and \"UDP\" Protocol Listeners, where no Listener with the same Protocol has the same Port value. \n Some fields in the Listener struct have possible values that affect whether the Listener is distinct. Hostname is particularly relevant for HTTP or HTTPS protocols. \n When using the Hostname value to select between same-Port, same-Protocol Listeners, the Hostname value must be different on each Listener for the Listener to be distinct. \n When the Listeners are distinct based on Hostname, inbound request hostnames MUST match from the most specific to least specific Hostname values to choose the correct Listener and its associated set of Routes. \n Exact matches must be processed before wildcard matches, and wildcard matches must be processed before fallback (empty Hostname value) matches. For example, `\"foo.example.com\"` takes precedence over `\"*.example.com\"`, and `\"*.example.com\"` takes precedence over `\"\"`. \n Additionally, if there are multiple wildcard entries, more specific wildcard entries must be processed before less specific wildcard entries. For example, `\"*.foo.example.com\"` takes precedence over `\"*.example.com\"`. The precise definition here is that the higher the number of dots in the hostname to the right of the wildcard character, the higher the precedence. \n The wildcard character will match any number of characters _and dots_ to the left, however, so `\"*.example.com\"` will match both `\"foo.bar.example.com\"` _and_ `\"bar.example.com\"`. \n If a set of Listeners contains Listeners that are not distinct, then those Listeners are Conflicted, and the implementation MUST set the \"Conflicted\" condition in the Listener Status to \"True\". \n Implementations MAY choose to accept a Gateway with some Conflicted Listeners only if they only accept the partial Listener set that contains no Conflicted Listeners. To put this another way, implementations may accept a partial Listener set only if they throw out *all* the conflicting Listeners. No picking one of the conflicting listeners as the winner. This also means that the Gateway must have at least one non-conflicting Listener in this case, otherwise it violates the requirement that at least one Listener must be present. \n The implementation MUST set a \"ListenersNotValid\" condition on the Gateway Status when the Gateway contains Conflicted Listeners whether or not they accept the Gateway. That Condition SHOULD clearly indicate in the Message which Listeners are conflicted, and which are Accepted. Additionally, the Listener status for those listeners SHOULD indicate which Listeners are conflicted and not Accepted. \n A Gateway's Listeners are considered \"compatible\" if: \n 1. They are distinct. 2. The implementation can serve them in compliance with the Addresses requirement that all Listeners are available on all assigned addresses. \n Compatible combinations in Extended support are expected to vary across implementations. A combination that is compatible for one implementation may not be compatible for another. \n For example, an implementation that cannot serve both TCP and UDP listeners on the same address, or cannot mix HTTPS and generic TLS listens on the same port would not consider those cases compatible, even though they are distinct. \n Note that requests SHOULD match at most one Listener. For example, if Listeners are defined for \"foo.example.com\" and \"*.example.com\", a request to \"foo.example.com\" SHOULD only be routed using routes attached to the \"foo.example.com\" Listener (and not the \"*.example.com\" Listener). This concept is known as \"Listener Isolation\". Implementations that do not support Listener Isolation MUST clearly document this. \n Implementations MAY merge separate Gateways onto a single set of Addresses if all Listeners across all Gateways are compatible. \n Support: Core"
  510. items:
  511. description: Listener embodies the concept of a logical endpoint where a Gateway accepts network connections.
  512. properties:
  513. allowedRoutes:
  514. default:
  515. namespaces:
  516. from: Same
  517. description: "AllowedRoutes defines the types of routes that MAY be attached to a Listener and the trusted namespaces where those Route resources MAY be present. \n Although a client request may match multiple route rules, only one rule may ultimately receive the request. Matching precedence MUST be determined in order of the following criteria: \n * The most specific match as defined by the Route type. * The oldest Route based on creation timestamp. For example, a Route with a creation timestamp of \"2020-09-08 01:02:03\" is given precedence over a Route with a creation timestamp of \"2020-09-08 01:02:04\". * If everything else is equivalent, the Route appearing first in alphabetical order (namespace/name) should be given precedence. For example, foo/bar is given precedence over foo/baz. \n All valid rules within a Route attached to this Listener should be implemented. Invalid Route rules can be ignored (sometimes that will mean the full Route). If a Route rule transitions from valid to invalid, support for that Route rule should be dropped to ensure consistency. For example, even if a filter specified by a Route rule is invalid, the rest of the rules within that Route should still be supported. \n Support: Core"
  518. properties:
  519. kinds:
  520. description: "Kinds specifies the groups and kinds of Routes that are allowed to bind to this Gateway Listener. When unspecified or empty, the kinds of Routes selected are determined using the Listener protocol. \n A RouteGroupKind MUST correspond to kinds of Routes that are compatible with the application protocol specified in the Listener's Protocol field. If an implementation does not support or recognize this resource type, it MUST set the \"ResolvedRefs\" condition to False for this Listener with the \"InvalidRouteKinds\" reason. \n Support: Core"
  521. items:
  522. description: RouteGroupKind indicates the group and kind of a Route resource.
  523. properties:
  524. group:
  525. default: gateway.networking.k8s.io
  526. description: Group is the group of the Route.
  527. maxLength: 253
  528. pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  529. type: string
  530. kind:
  531. description: Kind is the kind of the Route.
  532. maxLength: 63
  533. minLength: 1
  534. pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
  535. type: string
  536. required:
  537. - kind
  538. type: object
  539. maxItems: 8
  540. type: array
  541. namespaces:
  542. default:
  543. from: Same
  544. description: "Namespaces indicates namespaces from which Routes may be attached to this Listener. This is restricted to the namespace of this Gateway by default. \n Support: Core"
  545. properties:
  546. from:
  547. default: Same
  548. description: "From indicates where Routes will be selected for this Gateway. Possible values are: \n * All: Routes in all namespaces may be used by this Gateway. * Selector: Routes in namespaces selected by the selector may be used by this Gateway. * Same: Only Routes in the same namespace may be used by this Gateway. \n Support: Core"
  549. enum:
  550. - All
  551. - Selector
  552. - Same
  553. type: string
  554. selector:
  555. description: "Selector must be specified when From is set to \"Selector\". In that case, only Routes in Namespaces matching this Selector will be selected by this Gateway. This field is ignored for other values of \"From\". \n Support: Core"
  556. properties:
  557. matchExpressions:
  558. description: matchExpressions is a list of label selector requirements. The requirements are ANDed.
  559. items:
  560. description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
  561. properties:
  562. key:
  563. description: key is the label key that the selector applies to.
  564. type: string
  565. operator:
  566. description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
  567. type: string
  568. values:
  569. description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
  570. items:
  571. type: string
  572. type: array
  573. required:
  574. - key
  575. - operator
  576. type: object
  577. type: array
  578. matchLabels:
  579. additionalProperties:
  580. type: string
  581. description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed.
  582. type: object
  583. type: object
  584. x-kubernetes-map-type: atomic
  585. type: object
  586. type: object
  587. hostname:
  588. description: "Hostname specifies the virtual hostname to match for protocol types that define this concept. When unspecified, all hostnames are matched. This field is ignored for protocols that don't require hostname based matching. \n Implementations MUST apply Hostname matching appropriately for each of the following protocols: \n * TLS: The Listener Hostname MUST match the SNI. * HTTP: The Listener Hostname MUST match the Host header of the request. * HTTPS: The Listener Hostname SHOULD match at both the TLS and HTTP protocol layers as described above. If an implementation does not ensure that both the SNI and Host header match the Listener hostname, it MUST clearly document that. \n For HTTPRoute and TLSRoute resources, there is an interaction with the `spec.hostnames` array. When both listener and route specify hostnames, there MUST be an intersection between the values for a Route to be accepted. For more information, refer to the Route specific Hostnames documentation. \n Hostnames that are prefixed with a wildcard label (`*.`) are interpreted as a suffix match. That means that a match for `*.example.com` would match both `test.example.com`, and `foo.test.example.com`, but not `example.com`. \n Support: Core"
  589. maxLength: 253
  590. minLength: 1
  591. pattern: ^(\*\.)?[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  592. type: string
  593. name:
  594. description: "Name is the name of the Listener. This name MUST be unique within a Gateway. \n Support: Core"
  595. maxLength: 253
  596. minLength: 1
  597. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  598. type: string
  599. port:
  600. description: "Port is the network port. Multiple listeners may use the same port, subject to the Listener compatibility rules. \n Support: Core"
  601. format: int32
  602. maximum: 65535
  603. minimum: 1
  604. type: integer
  605. protocol:
  606. description: "Protocol specifies the network protocol this listener expects to receive. \n Support: Core"
  607. maxLength: 255
  608. minLength: 1
  609. pattern: ^[a-zA-Z0-9]([-a-zSA-Z0-9]*[a-zA-Z0-9])?$|[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9]+$
  610. type: string
  611. tls:
  612. description: "TLS is the TLS configuration for the Listener. This field is required if the Protocol field is \"HTTPS\" or \"TLS\". It is invalid to set this field if the Protocol field is \"HTTP\", \"TCP\", or \"UDP\". \n The association of SNIs to Certificate defined in GatewayTLSConfig is defined based on the Hostname field for this listener. \n The GatewayClass MUST use the longest matching SNI out of all available certificates for any TLS handshake. \n Support: Core"
  613. properties:
  614. certificateRefs:
  615. description: "CertificateRefs contains a series of references to Kubernetes objects that contains TLS certificates and private keys. These certificates are used to establish a TLS handshake for requests that match the hostname of the associated listener. \n A single CertificateRef to a Kubernetes Secret has \"Core\" support. Implementations MAY choose to support attaching multiple certificates to a Listener, but this behavior is implementation-specific. \n References to a resource in different namespace are invalid UNLESS there is a ReferenceGrant in the target namespace that allows the certificate to be attached. If a ReferenceGrant does not allow this reference, the \"ResolvedRefs\" condition MUST be set to False for this listener with the \"RefNotPermitted\" reason. \n This field is required to have at least one element when the mode is set to \"Terminate\" (default) and is optional otherwise. \n CertificateRefs can reference to standard Kubernetes resources, i.e. Secret, or implementation-specific custom resources. \n Support: Core - A single reference to a Kubernetes Secret of type kubernetes.io/tls \n Support: Implementation-specific (More than one reference or other resource types)"
  616. items:
  617. description: "SecretObjectReference identifies an API object including its namespace, defaulting to Secret. \n The API object must be valid in the cluster; the Group and Kind must be registered in the cluster for this reference to be valid. \n References to objects with invalid Group and Kind are not valid, and must be rejected by the implementation, with appropriate Conditions set on the containing object."
  618. properties:
  619. group:
  620. default: ""
  621. description: Group is the group of the referent. For example, "gateway.networking.k8s.io". When unspecified or empty string, core API group is inferred.
  622. maxLength: 253
  623. pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  624. type: string
  625. kind:
  626. default: Secret
  627. description: Kind is kind of the referent. For example "Secret".
  628. maxLength: 63
  629. minLength: 1
  630. pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
  631. type: string
  632. name:
  633. description: Name is the name of the referent.
  634. maxLength: 253
  635. minLength: 1
  636. type: string
  637. namespace:
  638. description: "Namespace is the namespace of the referenced object. When unspecified, the local namespace is inferred. \n Note that when a namespace different than the local namespace is specified, a ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. \n Support: Core"
  639. maxLength: 63
  640. minLength: 1
  641. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
  642. type: string
  643. required:
  644. - name
  645. type: object
  646. maxItems: 64
  647. type: array
  648. mode:
  649. default: Terminate
  650. description: "Mode defines the TLS behavior for the TLS session initiated by the client. There are two possible modes: \n - Terminate: The TLS session between the downstream client and the Gateway is terminated at the Gateway. This mode requires certificateRefs to be set and contain at least one element. - Passthrough: The TLS session is NOT terminated by the Gateway. This implies that the Gateway can't decipher the TLS stream except for the ClientHello message of the TLS protocol. CertificateRefs field is ignored in this mode. \n Support: Core"
  651. enum:
  652. - Terminate
  653. - Passthrough
  654. type: string
  655. options:
  656. additionalProperties:
  657. description: AnnotationValue is the value of an annotation in Gateway API. This is used for validation of maps such as TLS options. This roughly matches Kubernetes annotation validation, although the length validation in that case is based on the entire size of the annotations struct.
  658. maxLength: 4096
  659. minLength: 0
  660. type: string
  661. description: "Options are a list of key/value pairs to enable extended TLS configuration for each implementation. For example, configuring the minimum TLS version or supported cipher suites. \n A set of common keys MAY be defined by the API in the future. To avoid any ambiguity, implementation-specific definitions MUST use domain-prefixed names, such as `example.com/my-custom-option`. Un-prefixed names are reserved for key names defined by Gateway API. \n Support: Implementation-specific"
  662. maxProperties: 16
  663. type: object
  664. type: object
  665. x-kubernetes-validations:
  666. - message: certificateRefs must be specified when TLSModeType is Terminate
  667. rule: 'self.mode == ''Terminate'' ? size(self.certificateRefs) > 0 : true'
  668. required:
  669. - name
  670. - port
  671. - protocol
  672. type: object
  673. maxItems: 64
  674. minItems: 1
  675. type: array
  676. x-kubernetes-list-map-keys:
  677. - name
  678. x-kubernetes-list-type: map
  679. x-kubernetes-validations:
  680. - message: tls must be specified for protocols ['HTTPS', 'TLS']
  681. rule: 'self.all(l, l.protocol in [''HTTPS'', ''TLS''] ? has(l.tls) : true)'
  682. - message: tls must not be specified for protocols ['HTTP', 'TCP', 'UDP']
  683. rule: 'self.all(l, l.protocol in [''HTTP'', ''TCP'', ''UDP''] ? !has(l.tls) : true)'
  684. - message: hostname must not be specified for protocols ['TCP', 'UDP']
  685. rule: 'self.all(l, l.protocol in [''TCP'', ''UDP''] ? (!has(l.hostname) || l.hostname == '''') : true)'
  686. - message: Listener name must be unique within the Gateway
  687. rule: self.all(l1, self.exists_one(l2, l1.name == l2.name))
  688. - message: Combination of port, protocol and hostname must be unique for each listener
  689. rule: 'self.all(l1, self.exists_one(l2, l1.port == l2.port && l1.protocol == l2.protocol && (has(l1.hostname) && has(l2.hostname) ? l1.hostname == l2.hostname : !has(l1.hostname) && !has(l2.hostname))))'
  690. required:
  691. - gatewayClassName
  692. - listeners
  693. type: object
  694. status:
  695. default:
  696. conditions:
  697. - lastTransitionTime: "1970-01-01T00:00:00Z"
  698. message: Waiting for controller
  699. reason: Pending
  700. status: Unknown
  701. type: Accepted
  702. - lastTransitionTime: "1970-01-01T00:00:00Z"
  703. message: Waiting for controller
  704. reason: Pending
  705. status: Unknown
  706. type: Programmed
  707. description: Status defines the current state of Gateway.
  708. properties:
  709. addresses:
  710. description: "Addresses lists the network addresses that have been bound to the Gateway. \n This list may differ from the addresses provided in the spec under some conditions: \n * no addresses are specified, all addresses are dynamically assigned * a combination of specified and dynamic addresses are assigned * a specified address was unusable (e.g. already in use) \n "
  711. items:
  712. description: GatewayStatusAddress describes a network address that is bound to a Gateway.
  713. oneOf:
  714. - properties:
  715. type:
  716. enum:
  717. - IPAddress
  718. value:
  719. anyOf:
  720. - format: ipv4
  721. - format: ipv6
  722. - properties:
  723. type:
  724. not:
  725. enum:
  726. - IPAddress
  727. properties:
  728. type:
  729. default: IPAddress
  730. description: Type of the address.
  731. maxLength: 253
  732. minLength: 1
  733. pattern: ^Hostname|IPAddress|NamedAddress|[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$
  734. type: string
  735. value:
  736. description: "Value of the address. The validity of the values will depend on the type and support by the controller. \n Examples: `1.2.3.4`, `128::1`, `my-ip-address`."
  737. maxLength: 253
  738. minLength: 1
  739. type: string
  740. required:
  741. - value
  742. type: object
  743. x-kubernetes-validations:
  744. - message: Hostname value must only contain valid characters (matching ^(\*\.)?[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$)
  745. rule: 'self.type == ''Hostname'' ? self.value.matches(r"""^(\*\.)?[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$"""): true'
  746. maxItems: 16
  747. type: array
  748. conditions:
  749. default:
  750. - lastTransitionTime: "1970-01-01T00:00:00Z"
  751. message: Waiting for controller
  752. reason: Pending
  753. status: Unknown
  754. type: Accepted
  755. - lastTransitionTime: "1970-01-01T00:00:00Z"
  756. message: Waiting for controller
  757. reason: Pending
  758. status: Unknown
  759. type: Programmed
  760. description: "Conditions describe the current conditions of the Gateway. \n Implementations should prefer to express Gateway conditions using the `GatewayConditionType` and `GatewayConditionReason` constants so that operators and tools can converge on a common vocabulary to describe Gateway state. \n Known condition types are: \n * \"Accepted\" * \"Programmed\" * \"Ready\""
  761. items:
  762. description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, \n type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
  763. properties:
  764. lastTransitionTime:
  765. description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
  766. format: date-time
  767. type: string
  768. message:
  769. description: message is a human readable message indicating details about the transition. This may be an empty string.
  770. maxLength: 32768
  771. type: string
  772. observedGeneration:
  773. description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.
  774. format: int64
  775. minimum: 0
  776. type: integer
  777. reason:
  778. description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.
  779. maxLength: 1024
  780. minLength: 1
  781. pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
  782. type: string
  783. status:
  784. description: status of the condition, one of True, False, Unknown.
  785. enum:
  786. - "True"
  787. - "False"
  788. - Unknown
  789. type: string
  790. type:
  791. description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
  792. maxLength: 316
  793. pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
  794. type: string
  795. required:
  796. - lastTransitionTime
  797. - message
  798. - reason
  799. - status
  800. - type
  801. type: object
  802. maxItems: 8
  803. type: array
  804. x-kubernetes-list-map-keys:
  805. - type
  806. x-kubernetes-list-type: map
  807. listeners:
  808. description: Listeners provide status for each unique listener port defined in the Spec.
  809. items:
  810. description: ListenerStatus is the status associated with a Listener.
  811. properties:
  812. attachedRoutes:
  813. description: "AttachedRoutes represents the total number of Routes that have been successfully attached to this Listener. \n Successful attachment of a Route to a Listener is based solely on the combination of the AllowedRoutes field on the corresponding Listener and the Route's ParentRefs field. A Route is successfully attached to a Listener when it is selected by the Listener's AllowedRoutes field AND the Route has a valid ParentRef selecting the whole Gateway resource or a specific Listener as a parent resource (more detail on attachment semantics can be found in the documentation on the various Route kinds ParentRefs fields). Listener or Route status does not impact successful attachment, i.e. the AttachedRoutes field count MUST be set for Listeners with condition Accepted: false and MUST count successfully attached Routes that may themselves have Accepted: false conditions. \n Uses for this field include troubleshooting Route attachment and measuring blast radius/impact of changes to a Listener."
  814. format: int32
  815. type: integer
  816. conditions:
  817. description: Conditions describe the current condition of this listener.
  818. items:
  819. description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, \n type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
  820. properties:
  821. lastTransitionTime:
  822. description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
  823. format: date-time
  824. type: string
  825. message:
  826. description: message is a human readable message indicating details about the transition. This may be an empty string.
  827. maxLength: 32768
  828. type: string
  829. observedGeneration:
  830. description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.
  831. format: int64
  832. minimum: 0
  833. type: integer
  834. reason:
  835. description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.
  836. maxLength: 1024
  837. minLength: 1
  838. pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
  839. type: string
  840. status:
  841. description: status of the condition, one of True, False, Unknown.
  842. enum:
  843. - "True"
  844. - "False"
  845. - Unknown
  846. type: string
  847. type:
  848. description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
  849. maxLength: 316
  850. pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
  851. type: string
  852. required:
  853. - lastTransitionTime
  854. - message
  855. - reason
  856. - status
  857. - type
  858. type: object
  859. maxItems: 8
  860. type: array
  861. x-kubernetes-list-map-keys:
  862. - type
  863. x-kubernetes-list-type: map
  864. name:
  865. description: Name is the name of the Listener that this status corresponds to.
  866. maxLength: 253
  867. minLength: 1
  868. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  869. type: string
  870. supportedKinds:
  871. description: "SupportedKinds is the list indicating the Kinds supported by this listener. This MUST represent the kinds an implementation supports for that Listener configuration. \n If kinds are specified in Spec that are not supported, they MUST NOT appear in this list and an implementation MUST set the \"ResolvedRefs\" condition to \"False\" with the \"InvalidRouteKinds\" reason. If both valid and invalid Route kinds are specified, the implementation MUST reference the valid Route kinds that have been specified."
  872. items:
  873. description: RouteGroupKind indicates the group and kind of a Route resource.
  874. properties:
  875. group:
  876. default: gateway.networking.k8s.io
  877. description: Group is the group of the Route.
  878. maxLength: 253
  879. pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  880. type: string
  881. kind:
  882. description: Kind is the kind of the Route.
  883. maxLength: 63
  884. minLength: 1
  885. pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
  886. type: string
  887. required:
  888. - kind
  889. type: object
  890. maxItems: 8
  891. type: array
  892. required:
  893. - attachedRoutes
  894. - conditions
  895. - name
  896. - supportedKinds
  897. type: object
  898. maxItems: 64
  899. type: array
  900. x-kubernetes-list-map-keys:
  901. - name
  902. x-kubernetes-list-type: map
  903. type: object
  904. required:
  905. - spec
  906. type: object
  907. served: true
  908. storage: false
  909. subresources:
  910. status: {}
  911. - additionalPrinterColumns:
  912. - jsonPath: .spec.gatewayClassName
  913. name: Class
  914. type: string
  915. - jsonPath: .status.addresses[*].value
  916. name: Address
  917. type: string
  918. - jsonPath: .status.conditions[?(@.type=="Programmed")].status
  919. name: Programmed
  920. type: string
  921. - jsonPath: .metadata.creationTimestamp
  922. name: Age
  923. type: date
  924. name: v1beta1
  925. schema:
  926. openAPIV3Schema:
  927. description: Gateway represents an instance of a service-traffic handling infrastructure by binding Listeners to a set of IP addresses.
  928. properties:
  929. apiVersion:
  930. description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
  931. type: string
  932. kind:
  933. description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
  934. type: string
  935. metadata:
  936. type: object
  937. spec:
  938. description: Spec defines the desired state of Gateway.
  939. properties:
  940. addresses:
  941. description: "Addresses requested for this Gateway. This is optional and behavior can depend on the implementation. If a value is set in the spec and the requested address is invalid or unavailable, the implementation MUST indicate this in the associated entry in GatewayStatus.Addresses. \n The Addresses field represents a request for the address(es) on the \"outside of the Gateway\", that traffic bound for this Gateway will use. This could be the IP address or hostname of an external load balancer or other networking infrastructure, or some other address that traffic will be sent to. \n If no Addresses are specified, the implementation MAY schedule the Gateway in an implementation-specific manner, assigning an appropriate set of Addresses. \n The implementation MUST bind all Listeners to every GatewayAddress that it assigns to the Gateway and add a corresponding entry in GatewayStatus.Addresses. \n Support: Extended \n "
  942. items:
  943. description: GatewayAddress describes an address that can be bound to a Gateway.
  944. oneOf:
  945. - properties:
  946. type:
  947. enum:
  948. - IPAddress
  949. value:
  950. anyOf:
  951. - format: ipv4
  952. - format: ipv6
  953. - properties:
  954. type:
  955. not:
  956. enum:
  957. - IPAddress
  958. properties:
  959. type:
  960. default: IPAddress
  961. description: Type of the address.
  962. maxLength: 253
  963. minLength: 1
  964. pattern: ^Hostname|IPAddress|NamedAddress|[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$
  965. type: string
  966. value:
  967. description: "Value of the address. The validity of the values will depend on the type and support by the controller. \n Examples: `1.2.3.4`, `128::1`, `my-ip-address`."
  968. maxLength: 253
  969. minLength: 1
  970. type: string
  971. required:
  972. - value
  973. type: object
  974. x-kubernetes-validations:
  975. - message: Hostname value must only contain valid characters (matching ^(\*\.)?[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$)
  976. rule: 'self.type == ''Hostname'' ? self.value.matches(r"""^(\*\.)?[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$"""): true'
  977. maxItems: 16
  978. type: array
  979. x-kubernetes-validations:
  980. - message: IPAddress values must be unique
  981. rule: 'self.all(a1, a1.type == ''IPAddress'' ? self.exists_one(a2, a2.type == a1.type && a2.value == a1.value) : true )'
  982. - message: Hostname values must be unique
  983. rule: 'self.all(a1, a1.type == ''Hostname'' ? self.exists_one(a2, a2.type == a1.type && a2.value == a1.value) : true )'
  984. gatewayClassName:
  985. description: GatewayClassName used for this Gateway. This is the name of a GatewayClass resource.
  986. maxLength: 253
  987. minLength: 1
  988. type: string
  989. infrastructure:
  990. description: "Infrastructure defines infrastructure level attributes about this Gateway instance. \n Support: Core \n "
  991. properties:
  992. annotations:
  993. additionalProperties:
  994. description: AnnotationValue is the value of an annotation in Gateway API. This is used for validation of maps such as TLS options. This roughly matches Kubernetes annotation validation, although the length validation in that case is based on the entire size of the annotations struct.
  995. maxLength: 4096
  996. minLength: 0
  997. type: string
  998. description: "Annotations that SHOULD be applied to any resources created in response to this Gateway. \n For implementations creating other Kubernetes objects, this should be the `metadata.annotations` field on resources. For other implementations, this refers to any relevant (implementation specific) \"annotations\" concepts. \n An implementation may chose to add additional implementation-specific annotations as they see fit. \n Support: Extended"
  999. maxProperties: 8
  1000. type: object
  1001. labels:
  1002. additionalProperties:
  1003. description: AnnotationValue is the value of an annotation in Gateway API. This is used for validation of maps such as TLS options. This roughly matches Kubernetes annotation validation, although the length validation in that case is based on the entire size of the annotations struct.
  1004. maxLength: 4096
  1005. minLength: 0
  1006. type: string
  1007. description: "Labels that SHOULD be applied to any resources created in response to this Gateway. \n For implementations creating other Kubernetes objects, this should be the `metadata.labels` field on resources. For other implementations, this refers to any relevant (implementation specific) \"labels\" concepts. \n An implementation may chose to add additional implementation-specific labels as they see fit. \n Support: Extended"
  1008. maxProperties: 8
  1009. type: object
  1010. type: object
  1011. listeners:
  1012. description: "Listeners associated with this Gateway. Listeners define logical endpoints that are bound on this Gateway's addresses. At least one Listener MUST be specified. \n Each Listener in a set of Listeners (for example, in a single Gateway) MUST be _distinct_, in that a traffic flow MUST be able to be assigned to exactly one listener. (This section uses \"set of Listeners\" rather than \"Listeners in a single Gateway\" because implementations MAY merge configuration from multiple Gateways onto a single data plane, and these rules _also_ apply in that case). \n Practically, this means that each listener in a set MUST have a unique combination of Port, Protocol, and, if supported by the protocol, Hostname. \n Some combinations of port, protocol, and TLS settings are considered Core support and MUST be supported by implementations based on their targeted conformance profile: \n HTTP Profile \n 1. HTTPRoute, Port: 80, Protocol: HTTP 2. HTTPRoute, Port: 443, Protocol: HTTPS, TLS Mode: Terminate, TLS keypair provided \n TLS Profile \n 1. TLSRoute, Port: 443, Protocol: TLS, TLS Mode: Passthrough \n \"Distinct\" Listeners have the following property: \n The implementation can match inbound requests to a single distinct Listener. When multiple Listeners share values for fields (for example, two Listeners with the same Port value), the implementation can match requests to only one of the Listeners using other Listener fields. \n For example, the following Listener scenarios are distinct: \n 1. Multiple Listeners with the same Port that all use the \"HTTP\" Protocol that all have unique Hostname values. 2. Multiple Listeners with the same Port that use either the \"HTTPS\" or \"TLS\" Protocol that all have unique Hostname values. 3. A mixture of \"TCP\" and \"UDP\" Protocol Listeners, where no Listener with the same Protocol has the same Port value. \n Some fields in the Listener struct have possible values that affect whether the Listener is distinct. Hostname is particularly relevant for HTTP or HTTPS protocols. \n When using the Hostname value to select between same-Port, same-Protocol Listeners, the Hostname value must be different on each Listener for the Listener to be distinct. \n When the Listeners are distinct based on Hostname, inbound request hostnames MUST match from the most specific to least specific Hostname values to choose the correct Listener and its associated set of Routes. \n Exact matches must be processed before wildcard matches, and wildcard matches must be processed before fallback (empty Hostname value) matches. For example, `\"foo.example.com\"` takes precedence over `\"*.example.com\"`, and `\"*.example.com\"` takes precedence over `\"\"`. \n Additionally, if there are multiple wildcard entries, more specific wildcard entries must be processed before less specific wildcard entries. For example, `\"*.foo.example.com\"` takes precedence over `\"*.example.com\"`. The precise definition here is that the higher the number of dots in the hostname to the right of the wildcard character, the higher the precedence. \n The wildcard character will match any number of characters _and dots_ to the left, however, so `\"*.example.com\"` will match both `\"foo.bar.example.com\"` _and_ `\"bar.example.com\"`. \n If a set of Listeners contains Listeners that are not distinct, then those Listeners are Conflicted, and the implementation MUST set the \"Conflicted\" condition in the Listener Status to \"True\". \n Implementations MAY choose to accept a Gateway with some Conflicted Listeners only if they only accept the partial Listener set that contains no Conflicted Listeners. To put this another way, implementations may accept a partial Listener set only if they throw out *all* the conflicting Listeners. No picking one of the conflicting listeners as the winner. This also means that the Gateway must have at least one non-conflicting Listener in this case, otherwise it violates the requirement that at least one Listener must be present. \n The implementation MUST set a \"ListenersNotValid\" condition on the Gateway Status when the Gateway contains Conflicted Listeners whether or not they accept the Gateway. That Condition SHOULD clearly indicate in the Message which Listeners are conflicted, and which are Accepted. Additionally, the Listener status for those listeners SHOULD indicate which Listeners are conflicted and not Accepted. \n A Gateway's Listeners are considered \"compatible\" if: \n 1. They are distinct. 2. The implementation can serve them in compliance with the Addresses requirement that all Listeners are available on all assigned addresses. \n Compatible combinations in Extended support are expected to vary across implementations. A combination that is compatible for one implementation may not be compatible for another. \n For example, an implementation that cannot serve both TCP and UDP listeners on the same address, or cannot mix HTTPS and generic TLS listens on the same port would not consider those cases compatible, even though they are distinct. \n Note that requests SHOULD match at most one Listener. For example, if Listeners are defined for \"foo.example.com\" and \"*.example.com\", a request to \"foo.example.com\" SHOULD only be routed using routes attached to the \"foo.example.com\" Listener (and not the \"*.example.com\" Listener). This concept is known as \"Listener Isolation\". Implementations that do not support Listener Isolation MUST clearly document this. \n Implementations MAY merge separate Gateways onto a single set of Addresses if all Listeners across all Gateways are compatible. \n Support: Core"
  1013. items:
  1014. description: Listener embodies the concept of a logical endpoint where a Gateway accepts network connections.
  1015. properties:
  1016. allowedRoutes:
  1017. default:
  1018. namespaces:
  1019. from: Same
  1020. description: "AllowedRoutes defines the types of routes that MAY be attached to a Listener and the trusted namespaces where those Route resources MAY be present. \n Although a client request may match multiple route rules, only one rule may ultimately receive the request. Matching precedence MUST be determined in order of the following criteria: \n * The most specific match as defined by the Route type. * The oldest Route based on creation timestamp. For example, a Route with a creation timestamp of \"2020-09-08 01:02:03\" is given precedence over a Route with a creation timestamp of \"2020-09-08 01:02:04\". * If everything else is equivalent, the Route appearing first in alphabetical order (namespace/name) should be given precedence. For example, foo/bar is given precedence over foo/baz. \n All valid rules within a Route attached to this Listener should be implemented. Invalid Route rules can be ignored (sometimes that will mean the full Route). If a Route rule transitions from valid to invalid, support for that Route rule should be dropped to ensure consistency. For example, even if a filter specified by a Route rule is invalid, the rest of the rules within that Route should still be supported. \n Support: Core"
  1021. properties:
  1022. kinds:
  1023. description: "Kinds specifies the groups and kinds of Routes that are allowed to bind to this Gateway Listener. When unspecified or empty, the kinds of Routes selected are determined using the Listener protocol. \n A RouteGroupKind MUST correspond to kinds of Routes that are compatible with the application protocol specified in the Listener's Protocol field. If an implementation does not support or recognize this resource type, it MUST set the \"ResolvedRefs\" condition to False for this Listener with the \"InvalidRouteKinds\" reason. \n Support: Core"
  1024. items:
  1025. description: RouteGroupKind indicates the group and kind of a Route resource.
  1026. properties:
  1027. group:
  1028. default: gateway.networking.k8s.io
  1029. description: Group is the group of the Route.
  1030. maxLength: 253
  1031. pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  1032. type: string
  1033. kind:
  1034. description: Kind is the kind of the Route.
  1035. maxLength: 63
  1036. minLength: 1
  1037. pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
  1038. type: string
  1039. required:
  1040. - kind
  1041. type: object
  1042. maxItems: 8
  1043. type: array
  1044. namespaces:
  1045. default:
  1046. from: Same
  1047. description: "Namespaces indicates namespaces from which Routes may be attached to this Listener. This is restricted to the namespace of this Gateway by default. \n Support: Core"
  1048. properties:
  1049. from:
  1050. default: Same
  1051. description: "From indicates where Routes will be selected for this Gateway. Possible values are: \n * All: Routes in all namespaces may be used by this Gateway. * Selector: Routes in namespaces selected by the selector may be used by this Gateway. * Same: Only Routes in the same namespace may be used by this Gateway. \n Support: Core"
  1052. enum:
  1053. - All
  1054. - Selector
  1055. - Same
  1056. type: string
  1057. selector:
  1058. description: "Selector must be specified when From is set to \"Selector\". In that case, only Routes in Namespaces matching this Selector will be selected by this Gateway. This field is ignored for other values of \"From\". \n Support: Core"
  1059. properties:
  1060. matchExpressions:
  1061. description: matchExpressions is a list of label selector requirements. The requirements are ANDed.
  1062. items:
  1063. description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
  1064. properties:
  1065. key:
  1066. description: key is the label key that the selector applies to.
  1067. type: string
  1068. operator:
  1069. description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
  1070. type: string
  1071. values:
  1072. description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
  1073. items:
  1074. type: string
  1075. type: array
  1076. required:
  1077. - key
  1078. - operator
  1079. type: object
  1080. type: array
  1081. matchLabels:
  1082. additionalProperties:
  1083. type: string
  1084. description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed.
  1085. type: object
  1086. type: object
  1087. x-kubernetes-map-type: atomic
  1088. type: object
  1089. type: object
  1090. hostname:
  1091. description: "Hostname specifies the virtual hostname to match for protocol types that define this concept. When unspecified, all hostnames are matched. This field is ignored for protocols that don't require hostname based matching. \n Implementations MUST apply Hostname matching appropriately for each of the following protocols: \n * TLS: The Listener Hostname MUST match the SNI. * HTTP: The Listener Hostname MUST match the Host header of the request. * HTTPS: The Listener Hostname SHOULD match at both the TLS and HTTP protocol layers as described above. If an implementation does not ensure that both the SNI and Host header match the Listener hostname, it MUST clearly document that. \n For HTTPRoute and TLSRoute resources, there is an interaction with the `spec.hostnames` array. When both listener and route specify hostnames, there MUST be an intersection between the values for a Route to be accepted. For more information, refer to the Route specific Hostnames documentation. \n Hostnames that are prefixed with a wildcard label (`*.`) are interpreted as a suffix match. That means that a match for `*.example.com` would match both `test.example.com`, and `foo.test.example.com`, but not `example.com`. \n Support: Core"
  1092. maxLength: 253
  1093. minLength: 1
  1094. pattern: ^(\*\.)?[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  1095. type: string
  1096. name:
  1097. description: "Name is the name of the Listener. This name MUST be unique within a Gateway. \n Support: Core"
  1098. maxLength: 253
  1099. minLength: 1
  1100. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  1101. type: string
  1102. port:
  1103. description: "Port is the network port. Multiple listeners may use the same port, subject to the Listener compatibility rules. \n Support: Core"
  1104. format: int32
  1105. maximum: 65535
  1106. minimum: 1
  1107. type: integer
  1108. protocol:
  1109. description: "Protocol specifies the network protocol this listener expects to receive. \n Support: Core"
  1110. maxLength: 255
  1111. minLength: 1
  1112. pattern: ^[a-zA-Z0-9]([-a-zSA-Z0-9]*[a-zA-Z0-9])?$|[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9]+$
  1113. type: string
  1114. tls:
  1115. description: "TLS is the TLS configuration for the Listener. This field is required if the Protocol field is \"HTTPS\" or \"TLS\". It is invalid to set this field if the Protocol field is \"HTTP\", \"TCP\", or \"UDP\". \n The association of SNIs to Certificate defined in GatewayTLSConfig is defined based on the Hostname field for this listener. \n The GatewayClass MUST use the longest matching SNI out of all available certificates for any TLS handshake. \n Support: Core"
  1116. properties:
  1117. certificateRefs:
  1118. description: "CertificateRefs contains a series of references to Kubernetes objects that contains TLS certificates and private keys. These certificates are used to establish a TLS handshake for requests that match the hostname of the associated listener. \n A single CertificateRef to a Kubernetes Secret has \"Core\" support. Implementations MAY choose to support attaching multiple certificates to a Listener, but this behavior is implementation-specific. \n References to a resource in different namespace are invalid UNLESS there is a ReferenceGrant in the target namespace that allows the certificate to be attached. If a ReferenceGrant does not allow this reference, the \"ResolvedRefs\" condition MUST be set to False for this listener with the \"RefNotPermitted\" reason. \n This field is required to have at least one element when the mode is set to \"Terminate\" (default) and is optional otherwise. \n CertificateRefs can reference to standard Kubernetes resources, i.e. Secret, or implementation-specific custom resources. \n Support: Core - A single reference to a Kubernetes Secret of type kubernetes.io/tls \n Support: Implementation-specific (More than one reference or other resource types)"
  1119. items:
  1120. description: "SecretObjectReference identifies an API object including its namespace, defaulting to Secret. \n The API object must be valid in the cluster; the Group and Kind must be registered in the cluster for this reference to be valid. \n References to objects with invalid Group and Kind are not valid, and must be rejected by the implementation, with appropriate Conditions set on the containing object."
  1121. properties:
  1122. group:
  1123. default: ""
  1124. description: Group is the group of the referent. For example, "gateway.networking.k8s.io". When unspecified or empty string, core API group is inferred.
  1125. maxLength: 253
  1126. pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  1127. type: string
  1128. kind:
  1129. default: Secret
  1130. description: Kind is kind of the referent. For example "Secret".
  1131. maxLength: 63
  1132. minLength: 1
  1133. pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
  1134. type: string
  1135. name:
  1136. description: Name is the name of the referent.
  1137. maxLength: 253
  1138. minLength: 1
  1139. type: string
  1140. namespace:
  1141. description: "Namespace is the namespace of the referenced object. When unspecified, the local namespace is inferred. \n Note that when a namespace different than the local namespace is specified, a ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. \n Support: Core"
  1142. maxLength: 63
  1143. minLength: 1
  1144. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
  1145. type: string
  1146. required:
  1147. - name
  1148. type: object
  1149. maxItems: 64
  1150. type: array
  1151. mode:
  1152. default: Terminate
  1153. description: "Mode defines the TLS behavior for the TLS session initiated by the client. There are two possible modes: \n - Terminate: The TLS session between the downstream client and the Gateway is terminated at the Gateway. This mode requires certificateRefs to be set and contain at least one element. - Passthrough: The TLS session is NOT terminated by the Gateway. This implies that the Gateway can't decipher the TLS stream except for the ClientHello message of the TLS protocol. CertificateRefs field is ignored in this mode. \n Support: Core"
  1154. enum:
  1155. - Terminate
  1156. - Passthrough
  1157. type: string
  1158. options:
  1159. additionalProperties:
  1160. description: AnnotationValue is the value of an annotation in Gateway API. This is used for validation of maps such as TLS options. This roughly matches Kubernetes annotation validation, although the length validation in that case is based on the entire size of the annotations struct.
  1161. maxLength: 4096
  1162. minLength: 0
  1163. type: string
  1164. description: "Options are a list of key/value pairs to enable extended TLS configuration for each implementation. For example, configuring the minimum TLS version or supported cipher suites. \n A set of common keys MAY be defined by the API in the future. To avoid any ambiguity, implementation-specific definitions MUST use domain-prefixed names, such as `example.com/my-custom-option`. Un-prefixed names are reserved for key names defined by Gateway API. \n Support: Implementation-specific"
  1165. maxProperties: 16
  1166. type: object
  1167. type: object
  1168. x-kubernetes-validations:
  1169. - message: certificateRefs must be specified when TLSModeType is Terminate
  1170. rule: 'self.mode == ''Terminate'' ? size(self.certificateRefs) > 0 : true'
  1171. required:
  1172. - name
  1173. - port
  1174. - protocol
  1175. type: object
  1176. maxItems: 64
  1177. minItems: 1
  1178. type: array
  1179. x-kubernetes-list-map-keys:
  1180. - name
  1181. x-kubernetes-list-type: map
  1182. x-kubernetes-validations:
  1183. - message: tls must be specified for protocols ['HTTPS', 'TLS']
  1184. rule: 'self.all(l, l.protocol in [''HTTPS'', ''TLS''] ? has(l.tls) : true)'
  1185. - message: tls must not be specified for protocols ['HTTP', 'TCP', 'UDP']
  1186. rule: 'self.all(l, l.protocol in [''HTTP'', ''TCP'', ''UDP''] ? !has(l.tls) : true)'
  1187. - message: hostname must not be specified for protocols ['TCP', 'UDP']
  1188. rule: 'self.all(l, l.protocol in [''TCP'', ''UDP''] ? (!has(l.hostname) || l.hostname == '''') : true)'
  1189. - message: Listener name must be unique within the Gateway
  1190. rule: self.all(l1, self.exists_one(l2, l1.name == l2.name))
  1191. - message: Combination of port, protocol and hostname must be unique for each listener
  1192. rule: 'self.all(l1, self.exists_one(l2, l1.port == l2.port && l1.protocol == l2.protocol && (has(l1.hostname) && has(l2.hostname) ? l1.hostname == l2.hostname : !has(l1.hostname) && !has(l2.hostname))))'
  1193. required:
  1194. - gatewayClassName
  1195. - listeners
  1196. type: object
  1197. status:
  1198. default:
  1199. conditions:
  1200. - lastTransitionTime: "1970-01-01T00:00:00Z"
  1201. message: Waiting for controller
  1202. reason: Pending
  1203. status: Unknown
  1204. type: Accepted
  1205. - lastTransitionTime: "1970-01-01T00:00:00Z"
  1206. message: Waiting for controller
  1207. reason: Pending
  1208. status: Unknown
  1209. type: Programmed
  1210. description: Status defines the current state of Gateway.
  1211. properties:
  1212. addresses:
  1213. description: "Addresses lists the network addresses that have been bound to the Gateway. \n This list may differ from the addresses provided in the spec under some conditions: \n * no addresses are specified, all addresses are dynamically assigned * a combination of specified and dynamic addresses are assigned * a specified address was unusable (e.g. already in use) \n "
  1214. items:
  1215. description: GatewayStatusAddress describes a network address that is bound to a Gateway.
  1216. oneOf:
  1217. - properties:
  1218. type:
  1219. enum:
  1220. - IPAddress
  1221. value:
  1222. anyOf:
  1223. - format: ipv4
  1224. - format: ipv6
  1225. - properties:
  1226. type:
  1227. not:
  1228. enum:
  1229. - IPAddress
  1230. properties:
  1231. type:
  1232. default: IPAddress
  1233. description: Type of the address.
  1234. maxLength: 253
  1235. minLength: 1
  1236. pattern: ^Hostname|IPAddress|NamedAddress|[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$
  1237. type: string
  1238. value:
  1239. description: "Value of the address. The validity of the values will depend on the type and support by the controller. \n Examples: `1.2.3.4`, `128::1`, `my-ip-address`."
  1240. maxLength: 253
  1241. minLength: 1
  1242. type: string
  1243. required:
  1244. - value
  1245. type: object
  1246. x-kubernetes-validations:
  1247. - message: Hostname value must only contain valid characters (matching ^(\*\.)?[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$)
  1248. rule: 'self.type == ''Hostname'' ? self.value.matches(r"""^(\*\.)?[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$"""): true'
  1249. maxItems: 16
  1250. type: array
  1251. conditions:
  1252. default:
  1253. - lastTransitionTime: "1970-01-01T00:00:00Z"
  1254. message: Waiting for controller
  1255. reason: Pending
  1256. status: Unknown
  1257. type: Accepted
  1258. - lastTransitionTime: "1970-01-01T00:00:00Z"
  1259. message: Waiting for controller
  1260. reason: Pending
  1261. status: Unknown
  1262. type: Programmed
  1263. description: "Conditions describe the current conditions of the Gateway. \n Implementations should prefer to express Gateway conditions using the `GatewayConditionType` and `GatewayConditionReason` constants so that operators and tools can converge on a common vocabulary to describe Gateway state. \n Known condition types are: \n * \"Accepted\" * \"Programmed\" * \"Ready\""
  1264. items:
  1265. description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, \n type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
  1266. properties:
  1267. lastTransitionTime:
  1268. description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
  1269. format: date-time
  1270. type: string
  1271. message:
  1272. description: message is a human readable message indicating details about the transition. This may be an empty string.
  1273. maxLength: 32768
  1274. type: string
  1275. observedGeneration:
  1276. description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.
  1277. format: int64
  1278. minimum: 0
  1279. type: integer
  1280. reason:
  1281. description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.
  1282. maxLength: 1024
  1283. minLength: 1
  1284. pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
  1285. type: string
  1286. status:
  1287. description: status of the condition, one of True, False, Unknown.
  1288. enum:
  1289. - "True"
  1290. - "False"
  1291. - Unknown
  1292. type: string
  1293. type:
  1294. description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
  1295. maxLength: 316
  1296. pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
  1297. type: string
  1298. required:
  1299. - lastTransitionTime
  1300. - message
  1301. - reason
  1302. - status
  1303. - type
  1304. type: object
  1305. maxItems: 8
  1306. type: array
  1307. x-kubernetes-list-map-keys:
  1308. - type
  1309. x-kubernetes-list-type: map
  1310. listeners:
  1311. description: Listeners provide status for each unique listener port defined in the Spec.
  1312. items:
  1313. description: ListenerStatus is the status associated with a Listener.
  1314. properties:
  1315. attachedRoutes:
  1316. description: "AttachedRoutes represents the total number of Routes that have been successfully attached to this Listener. \n Successful attachment of a Route to a Listener is based solely on the combination of the AllowedRoutes field on the corresponding Listener and the Route's ParentRefs field. A Route is successfully attached to a Listener when it is selected by the Listener's AllowedRoutes field AND the Route has a valid ParentRef selecting the whole Gateway resource or a specific Listener as a parent resource (more detail on attachment semantics can be found in the documentation on the various Route kinds ParentRefs fields). Listener or Route status does not impact successful attachment, i.e. the AttachedRoutes field count MUST be set for Listeners with condition Accepted: false and MUST count successfully attached Routes that may themselves have Accepted: false conditions. \n Uses for this field include troubleshooting Route attachment and measuring blast radius/impact of changes to a Listener."
  1317. format: int32
  1318. type: integer
  1319. conditions:
  1320. description: Conditions describe the current condition of this listener.
  1321. items:
  1322. description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, \n type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
  1323. properties:
  1324. lastTransitionTime:
  1325. description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
  1326. format: date-time
  1327. type: string
  1328. message:
  1329. description: message is a human readable message indicating details about the transition. This may be an empty string.
  1330. maxLength: 32768
  1331. type: string
  1332. observedGeneration:
  1333. description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.
  1334. format: int64
  1335. minimum: 0
  1336. type: integer
  1337. reason:
  1338. description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.
  1339. maxLength: 1024
  1340. minLength: 1
  1341. pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
  1342. type: string
  1343. status:
  1344. description: status of the condition, one of True, False, Unknown.
  1345. enum:
  1346. - "True"
  1347. - "False"
  1348. - Unknown
  1349. type: string
  1350. type:
  1351. description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
  1352. maxLength: 316
  1353. pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
  1354. type: string
  1355. required:
  1356. - lastTransitionTime
  1357. - message
  1358. - reason
  1359. - status
  1360. - type
  1361. type: object
  1362. maxItems: 8
  1363. type: array
  1364. x-kubernetes-list-map-keys:
  1365. - type
  1366. x-kubernetes-list-type: map
  1367. name:
  1368. description: Name is the name of the Listener that this status corresponds to.
  1369. maxLength: 253
  1370. minLength: 1
  1371. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  1372. type: string
  1373. supportedKinds:
  1374. description: "SupportedKinds is the list indicating the Kinds supported by this listener. This MUST represent the kinds an implementation supports for that Listener configuration. \n If kinds are specified in Spec that are not supported, they MUST NOT appear in this list and an implementation MUST set the \"ResolvedRefs\" condition to \"False\" with the \"InvalidRouteKinds\" reason. If both valid and invalid Route kinds are specified, the implementation MUST reference the valid Route kinds that have been specified."
  1375. items:
  1376. description: RouteGroupKind indicates the group and kind of a Route resource.
  1377. properties:
  1378. group:
  1379. default: gateway.networking.k8s.io
  1380. description: Group is the group of the Route.
  1381. maxLength: 253
  1382. pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  1383. type: string
  1384. kind:
  1385. description: Kind is the kind of the Route.
  1386. maxLength: 63
  1387. minLength: 1
  1388. pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
  1389. type: string
  1390. required:
  1391. - kind
  1392. type: object
  1393. maxItems: 8
  1394. type: array
  1395. required:
  1396. - attachedRoutes
  1397. - conditions
  1398. - name
  1399. - supportedKinds
  1400. type: object
  1401. maxItems: 64
  1402. type: array
  1403. x-kubernetes-list-map-keys:
  1404. - name
  1405. x-kubernetes-list-type: map
  1406. type: object
  1407. required:
  1408. - spec
  1409. type: object
  1410. served: true
  1411. storage: true
  1412. subresources:
  1413. status: {}
  1414. status:
  1415. acceptedNames:
  1416. kind: ""
  1417. plural: ""
  1418. conditions: null
  1419. storedVersions: null
  1420. #
  1421. # config/crd/experimental/gateway.networking.k8s.io_httproutes.yaml
  1422. #
  1423. apiVersion: apiextensions.k8s.io/v1
  1424. kind: CustomResourceDefinition
  1425. metadata:
  1426. annotations:
  1427. api-approved.kubernetes.io: https://github.com/kubernetes-sigs/gateway-api/pull/2466
  1428. gateway.networking.k8s.io/bundle-version: v1.0.0
  1429. gateway.networking.k8s.io/channel: experimental
  1430. creationTimestamp: null
  1431. name: httproutes.gateway.networking.k8s.io
  1432. spec:
  1433. group: gateway.networking.k8s.io
  1434. names:
  1435. categories:
  1436. - gateway-api
  1437. kind: HTTPRoute
  1438. listKind: HTTPRouteList
  1439. plural: httproutes
  1440. singular: httproute
  1441. scope: Namespaced
  1442. versions:
  1443. - additionalPrinterColumns:
  1444. - jsonPath: .spec.hostnames
  1445. name: Hostnames
  1446. type: string
  1447. - jsonPath: .metadata.creationTimestamp
  1448. name: Age
  1449. type: date
  1450. name: v1
  1451. schema:
  1452. openAPIV3Schema:
  1453. description: HTTPRoute provides a way to route HTTP requests. This includes the capability to match requests by hostname, path, header, or query param. Filters can be used to specify additional processing steps. Backends specify where matching requests should be routed.
  1454. properties:
  1455. apiVersion:
  1456. description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
  1457. type: string
  1458. kind:
  1459. description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
  1460. type: string
  1461. metadata:
  1462. type: object
  1463. spec:
  1464. description: Spec defines the desired state of HTTPRoute.
  1465. properties:
  1466. hostnames:
  1467. description: "Hostnames defines a set of hostnames that should match against the HTTP Host header to select a HTTPRoute used to process the request. Implementations MUST ignore any port value specified in the HTTP Host header while performing a match and (absent of any applicable header modification configuration) MUST forward this header unmodified to the backend. \n Valid values for Hostnames are determined by RFC 1123 definition of a hostname with 2 notable exceptions: \n 1. IPs are not allowed. 2. A hostname may be prefixed with a wildcard label (`*.`). The wildcard label must appear by itself as the first label. \n If a hostname is specified by both the Listener and HTTPRoute, there must be at least one intersecting hostname for the HTTPRoute to be attached to the Listener. For example: \n * A Listener with `test.example.com` as the hostname matches HTTPRoutes that have either not specified any hostnames, or have specified at least one of `test.example.com` or `*.example.com`. * A Listener with `*.example.com` as the hostname matches HTTPRoutes that have either not specified any hostnames or have specified at least one hostname that matches the Listener hostname. For example, `*.example.com`, `test.example.com`, and `foo.test.example.com` would all match. On the other hand, `example.com` and `test.example.net` would not match. \n Hostnames that are prefixed with a wildcard label (`*.`) are interpreted as a suffix match. That means that a match for `*.example.com` would match both `test.example.com`, and `foo.test.example.com`, but not `example.com`. \n If both the Listener and HTTPRoute have specified hostnames, any HTTPRoute hostnames that do not match the Listener hostname MUST be ignored. For example, if a Listener specified `*.example.com`, and the HTTPRoute specified `test.example.com` and `test.example.net`, `test.example.net` must not be considered for a match. \n If both the Listener and HTTPRoute have specified hostnames, and none match with the criteria above, then the HTTPRoute is not accepted. The implementation must raise an 'Accepted' Condition with a status of `False` in the corresponding RouteParentStatus. \n In the event that multiple HTTPRoutes specify intersecting hostnames (e.g. overlapping wildcard matching and exact matching hostnames), precedence must be given to rules from the HTTPRoute with the largest number of: \n * Characters in a matching non-wildcard hostname. * Characters in a matching hostname. \n If ties exist across multiple Routes, the matching precedence rules for HTTPRouteMatches takes over. \n Support: Core"
  1468. items:
  1469. description: "Hostname is the fully qualified domain name of a network host. This matches the RFC 1123 definition of a hostname with 2 notable exceptions: \n 1. IPs are not allowed. 2. A hostname may be prefixed with a wildcard label (`*.`). The wildcard label must appear by itself as the first label. \n Hostname can be \"precise\" which is a domain name without the terminating dot of a network host (e.g. \"foo.example.com\") or \"wildcard\", which is a domain name prefixed with a single wildcard label (e.g. `*.example.com`). \n Note that as per RFC1035 and RFC1123, a *label* must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character. No other punctuation is allowed."
  1470. maxLength: 253
  1471. minLength: 1
  1472. pattern: ^(\*\.)?[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  1473. type: string
  1474. maxItems: 16
  1475. type: array
  1476. parentRefs:
  1477. description: "ParentRefs references the resources (usually Gateways) that a Route wants to be attached to. Note that the referenced parent resource needs to allow this for the attachment to be complete. For Gateways, that means the Gateway needs to allow attachment from Routes of this kind and namespace. For Services, that means the Service must either be in the same namespace for a \"producer\" route, or the mesh implementation must support and allow \"consumer\" routes for the referenced Service. ReferenceGrant is not applicable for governing ParentRefs to Services - it is not possible to create a \"producer\" route for a Service in a different namespace from the Route. \n There are two kinds of parent resources with \"Core\" support: \n * Gateway (Gateway conformance profile) * Service (Mesh conformance profile, experimental, ClusterIP Services only) This API may be extended in the future to support additional kinds of parent resources. \n ParentRefs must be _distinct_. This means either that: \n * They select different objects. If this is the case, then parentRef entries are distinct. In terms of fields, this means that the multi-part key defined by `group`, `kind`, `namespace`, and `name` must be unique across all parentRef entries in the Route. * They do not select different objects, but for each optional field used, each ParentRef that selects the same object must set the same set of optional fields to different values. If one ParentRef sets a combination of optional fields, all must set the same combination. \n Some examples: \n * If one ParentRef sets `sectionName`, all ParentRefs referencing the same object must also set `sectionName`. * If one ParentRef sets `port`, all ParentRefs referencing the same object must also set `port`. * If one ParentRef sets `sectionName` and `port`, all ParentRefs referencing the same object must also set `sectionName` and `port`. \n It is possible to separately reference multiple distinct objects that may be collapsed by an implementation. For example, some implementations may choose to merge compatible Gateway Listeners together. If that is the case, the list of routes attached to those resources should also be merged. \n Note that for ParentRefs that cross namespace boundaries, there are specific rules. Cross-namespace references are only valid if they are explicitly allowed by something in the namespace they are referring to. For example, Gateway has the AllowedRoutes field, and ReferenceGrant provides a generic way to enable other kinds of cross-namespace reference. \n ParentRefs from a Route to a Service in the same namespace are \"producer\" routes, which apply default routing rules to inbound connections from any namespace to the Service. \n ParentRefs from a Route to a Service in a different namespace are \"consumer\" routes, and these routing rules are only applied to outbound connections originating from the same namespace as the Route, for which the intended destination of the connections are a Service targeted as a ParentRef of the Route. \n "
  1478. items:
  1479. description: "ParentReference identifies an API object (usually a Gateway) that can be considered a parent of this resource (usually a route). There are two kinds of parent resources with \"Core\" support: \n * Gateway (Gateway conformance profile) * Service (Mesh conformance profile, experimental, ClusterIP Services only) \n This API may be extended in the future to support additional kinds of parent resources. \n The API object must be valid in the cluster; the Group and Kind must be registered in the cluster for this reference to be valid."
  1480. properties:
  1481. group:
  1482. default: gateway.networking.k8s.io
  1483. description: "Group is the group of the referent. When unspecified, \"gateway.networking.k8s.io\" is inferred. To set the core API group (such as for a \"Service\" kind referent), Group must be explicitly set to \"\" (empty string). \n Support: Core"
  1484. maxLength: 253
  1485. pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  1486. type: string
  1487. kind:
  1488. default: Gateway
  1489. description: "Kind is kind of the referent. \n There are two kinds of parent resources with \"Core\" support: \n * Gateway (Gateway conformance profile) * Service (Mesh conformance profile, experimental, ClusterIP Services only) \n Support for other resources is Implementation-Specific."
  1490. maxLength: 63
  1491. minLength: 1
  1492. pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
  1493. type: string
  1494. name:
  1495. description: "Name is the name of the referent. \n Support: Core"
  1496. maxLength: 253
  1497. minLength: 1
  1498. type: string
  1499. namespace:
  1500. description: "Namespace is the namespace of the referent. When unspecified, this refers to the local namespace of the Route. \n Note that there are specific rules for ParentRefs which cross namespace boundaries. Cross-namespace references are only valid if they are explicitly allowed by something in the namespace they are referring to. For example: Gateway has the AllowedRoutes field, and ReferenceGrant provides a generic way to enable any other kind of cross-namespace reference. \n ParentRefs from a Route to a Service in the same namespace are \"producer\" routes, which apply default routing rules to inbound connections from any namespace to the Service. \n ParentRefs from a Route to a Service in a different namespace are \"consumer\" routes, and these routing rules are only applied to outbound connections originating from the same namespace as the Route, for which the intended destination of the connections are a Service targeted as a ParentRef of the Route. \n Support: Core"
  1501. maxLength: 63
  1502. minLength: 1
  1503. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
  1504. type: string
  1505. port:
  1506. description: "Port is the network port this Route targets. It can be interpreted differently based on the type of parent resource. \n When the parent resource is a Gateway, this targets all listeners listening on the specified port that also support this kind of Route(and select this Route). It's not recommended to set `Port` unless the networking behaviors specified in a Route must apply to a specific port as opposed to a listener(s) whose port(s) may be changed. When both Port and SectionName are specified, the name and port of the selected listener must match both specified values. \n When the parent resource is a Service, this targets a specific port in the Service spec. When both Port (experimental) and SectionName are specified, the name and port of the selected port must match both specified values. \n Implementations MAY choose to support other parent resources. Implementations supporting other types of parent resources MUST clearly document how/if Port is interpreted. \n For the purpose of status, an attachment is considered successful as long as the parent resource accepts it partially. For example, Gateway listeners can restrict which Routes can attach to them by Route kind, namespace, or hostname. If 1 of 2 Gateway listeners accept attachment from the referencing Route, the Route MUST be considered successfully attached. If no Gateway listeners accept attachment from this Route, the Route MUST be considered detached from the Gateway. \n Support: Extended \n "
  1507. format: int32
  1508. maximum: 65535
  1509. minimum: 1
  1510. type: integer
  1511. sectionName:
  1512. description: "SectionName is the name of a section within the target resource. In the following resources, SectionName is interpreted as the following: \n * Gateway: Listener Name. When both Port (experimental) and SectionName are specified, the name and port of the selected listener must match both specified values. * Service: Port Name. When both Port (experimental) and SectionName are specified, the name and port of the selected listener must match both specified values. Note that attaching Routes to Services as Parents is part of experimental Mesh support and is not supported for any other purpose. \n Implementations MAY choose to support attaching Routes to other resources. If that is the case, they MUST clearly document how SectionName is interpreted. \n When unspecified (empty string), this will reference the entire resource. For the purpose of status, an attachment is considered successful if at least one section in the parent resource accepts it. For example, Gateway listeners can restrict which Routes can attach to them by Route kind, namespace, or hostname. If 1 of 2 Gateway listeners accept attachment from the referencing Route, the Route MUST be considered successfully attached. If no Gateway listeners accept attachment from this Route, the Route MUST be considered detached from the Gateway. \n Support: Core"
  1513. maxLength: 253
  1514. minLength: 1
  1515. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  1516. type: string
  1517. required:
  1518. - name
  1519. type: object
  1520. maxItems: 32
  1521. type: array
  1522. x-kubernetes-validations:
  1523. - message: sectionName or port must be specified when parentRefs includes 2 or more references to the same parent
  1524. rule: 'self.all(p1, self.all(p2, p1.group == p2.group && p1.kind == p2.kind && p1.name == p2.name && (((!has(p1.__namespace__) || p1.__namespace__ == '''') && (!has(p2.__namespace__) || p2.__namespace__ == '''')) || (has(p1.__namespace__) && has(p2.__namespace__) && p1.__namespace__ == p2.__namespace__)) ? ((!has(p1.sectionName) || p1.sectionName == '''') == (!has(p2.sectionName) || p2.sectionName == '''') && (!has(p1.port) || p1.port == 0) == (!has(p2.port) || p2.port == 0)): true))'
  1525. - message: sectionName or port must be unique when parentRefs includes 2 or more references to the same parent
  1526. rule: self.all(p1, self.exists_one(p2, p1.group == p2.group && p1.kind == p2.kind && p1.name == p2.name && (((!has(p1.__namespace__) || p1.__namespace__ == '') && (!has(p2.__namespace__) || p2.__namespace__ == '')) || (has(p1.__namespace__) && has(p2.__namespace__) && p1.__namespace__ == p2.__namespace__ )) && (((!has(p1.sectionName) || p1.sectionName == '') && (!has(p2.sectionName) || p2.sectionName == '')) || ( has(p1.sectionName) && has(p2.sectionName) && p1.sectionName == p2.sectionName)) && (((!has(p1.port) || p1.port == 0) && (!has(p2.port) || p2.port == 0)) || (has(p1.port) && has(p2.port) && p1.port == p2.port))))
  1527. rules:
  1528. default:
  1529. - matches:
  1530. - path:
  1531. type: PathPrefix
  1532. value: /
  1533. description: Rules are a list of HTTP matchers, filters and actions.
  1534. items:
  1535. description: HTTPRouteRule defines semantics for matching an HTTP request based on conditions (matches), processing it (filters), and forwarding the request to an API object (backendRefs).
  1536. properties:
  1537. backendRefs:
  1538. description: "BackendRefs defines the backend(s) where matching requests should be sent. \n Failure behavior here depends on how many BackendRefs are specified and how many are invalid. \n If *all* entries in BackendRefs are invalid, and there are also no filters specified in this route rule, *all* traffic which matches this rule MUST receive a 500 status code. \n See the HTTPBackendRef definition for the rules about what makes a single HTTPBackendRef invalid. \n When a HTTPBackendRef is invalid, 500 status codes MUST be returned for requests that would have otherwise been routed to an invalid backend. If multiple backends are specified, and some are invalid, the proportion of requests that would otherwise have been routed to an invalid backend MUST receive a 500 status code. \n For example, if two backends are specified with equal weights, and one is invalid, 50 percent of traffic must receive a 500. Implementations may choose how that 50 percent is determined. \n Support: Core for Kubernetes Service \n Support: Extended for Kubernetes ServiceImport \n Support: Implementation-specific for any other resource \n Support for weight: Core"
  1539. items:
  1540. description: "HTTPBackendRef defines how a HTTPRoute forwards a HTTP request. \n Note that when a namespace different than the local namespace is specified, a ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. \n <gateway:experimental:description> \n When the BackendRef points to a Kubernetes Service, implementations SHOULD honor the appProtocol field if it is set for the target Service Port. \n Implementations supporting appProtocol SHOULD recognize the Kubernetes Standard Application Protocols defined in KEP-3726. \n If a Service appProtocol isn't specified, an implementation MAY infer the backend protocol through its own means. Implementations MAY infer the protocol from the Route type referring to the backend Service. \n If a Route is not able to send traffic to the backend using the specified protocol then the backend is considered invalid. Implementations MUST set the \"ResolvedRefs\" condition to \"False\" with the \"UnsupportedProtocol\" reason. \n </gateway:experimental:description>"
  1541. properties:
  1542. filters:
  1543. description: "Filters defined at this level should be executed if and only if the request is being forwarded to the backend defined here. \n Support: Implementation-specific (For broader support of filters, use the Filters field in HTTPRouteRule.)"
  1544. items:
  1545. description: HTTPRouteFilter defines processing steps that must be completed during the request or response lifecycle. HTTPRouteFilters are meant as an extension point to express processing that may be done in Gateway implementations. Some examples include request or response modification, implementing authentication strategies, rate-limiting, and traffic shaping. API guarantee/conformance is defined based on the type of the filter.
  1546. properties:
  1547. extensionRef:
  1548. description: "ExtensionRef is an optional, implementation-specific extension to the \"filter\" behavior. For example, resource \"myroutefilter\" in group \"networking.example.net\"). ExtensionRef MUST NOT be used for core and extended filters. \n This filter can be used multiple times within the same rule. \n Support: Implementation-specific"
  1549. properties:
  1550. group:
  1551. description: Group is the group of the referent. For example, "gateway.networking.k8s.io". When unspecified or empty string, core API group is inferred.
  1552. maxLength: 253
  1553. pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  1554. type: string
  1555. kind:
  1556. description: Kind is kind of the referent. For example "HTTPRoute" or "Service".
  1557. maxLength: 63
  1558. minLength: 1
  1559. pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
  1560. type: string
  1561. name:
  1562. description: Name is the name of the referent.
  1563. maxLength: 253
  1564. minLength: 1
  1565. type: string
  1566. required:
  1567. - group
  1568. - kind
  1569. - name
  1570. type: object
  1571. requestHeaderModifier:
  1572. description: "RequestHeaderModifier defines a schema for a filter that modifies request headers. \n Support: Core"
  1573. properties:
  1574. add:
  1575. description: "Add adds the given header(s) (name, value) to the request before the action. It appends to any existing values associated with the header name. \n Input: GET /foo HTTP/1.1 my-header: foo \n Config: add: - name: \"my-header\" value: \"bar,baz\" \n Output: GET /foo HTTP/1.1 my-header: foo,bar,baz"
  1576. items:
  1577. description: HTTPHeader represents an HTTP Header name and value as defined by RFC 7230.
  1578. properties:
  1579. name:
  1580. description: "Name is the name of the HTTP Header to be matched. Name matching MUST be case insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2). \n If multiple entries specify equivalent header names, the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent header name MUST be ignored. Due to the case-insensitivity of header names, \"foo\" and \"Foo\" are considered equivalent."
  1581. maxLength: 256
  1582. minLength: 1
  1583. pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
  1584. type: string
  1585. value:
  1586. description: Value is the value of HTTP Header to be matched.
  1587. maxLength: 4096
  1588. minLength: 1
  1589. type: string
  1590. required:
  1591. - name
  1592. - value
  1593. type: object
  1594. maxItems: 16
  1595. type: array
  1596. x-kubernetes-list-map-keys:
  1597. - name
  1598. x-kubernetes-list-type: map
  1599. remove:
  1600. description: "Remove the given header(s) from the HTTP request before the action. The value of Remove is a list of HTTP header names. Note that the header names are case-insensitive (see https://datatracker.ietf.org/doc/html/rfc2616#section-4.2). \n Input: GET /foo HTTP/1.1 my-header1: foo my-header2: bar my-header3: baz \n Config: remove: [\"my-header1\", \"my-header3\"] \n Output: GET /foo HTTP/1.1 my-header2: bar"
  1601. items:
  1602. type: string
  1603. maxItems: 16
  1604. type: array
  1605. x-kubernetes-list-type: set
  1606. set:
  1607. description: "Set overwrites the request with the given header (name, value) before the action. \n Input: GET /foo HTTP/1.1 my-header: foo \n Config: set: - name: \"my-header\" value: \"bar\" \n Output: GET /foo HTTP/1.1 my-header: bar"
  1608. items:
  1609. description: HTTPHeader represents an HTTP Header name and value as defined by RFC 7230.
  1610. properties:
  1611. name:
  1612. description: "Name is the name of the HTTP Header to be matched. Name matching MUST be case insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2). \n If multiple entries specify equivalent header names, the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent header name MUST be ignored. Due to the case-insensitivity of header names, \"foo\" and \"Foo\" are considered equivalent."
  1613. maxLength: 256
  1614. minLength: 1
  1615. pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
  1616. type: string
  1617. value:
  1618. description: Value is the value of HTTP Header to be matched.
  1619. maxLength: 4096
  1620. minLength: 1
  1621. type: string
  1622. required:
  1623. - name
  1624. - value
  1625. type: object
  1626. maxItems: 16
  1627. type: array
  1628. x-kubernetes-list-map-keys:
  1629. - name
  1630. x-kubernetes-list-type: map
  1631. type: object
  1632. requestMirror:
  1633. description: "RequestMirror defines a schema for a filter that mirrors requests. Requests are sent to the specified destination, but responses from that destination are ignored. \n This filter can be used multiple times within the same rule. Note that not all implementations will be able to support mirroring to multiple backends. \n Support: Extended"
  1634. properties:
  1635. backendRef:
  1636. description: "BackendRef references a resource where mirrored requests are sent. \n Mirrored requests must be sent only to a single destination endpoint within this BackendRef, irrespective of how many endpoints are present within this BackendRef. \n If the referent cannot be found, this BackendRef is invalid and must be dropped from the Gateway. The controller must ensure the \"ResolvedRefs\" condition on the Route status is set to `status: False` and not configure this backend in the underlying implementation. \n If there is a cross-namespace reference to an *existing* object that is not allowed by a ReferenceGrant, the controller must ensure the \"ResolvedRefs\" condition on the Route is set to `status: False`, with the \"RefNotPermitted\" reason and not configure this backend in the underlying implementation. \n In either error case, the Message of the `ResolvedRefs` Condition should be used to provide more detail about the problem. \n Support: Extended for Kubernetes Service \n Support: Implementation-specific for any other resource"
  1637. properties:
  1638. group:
  1639. default: ""
  1640. description: Group is the group of the referent. For example, "gateway.networking.k8s.io". When unspecified or empty string, core API group is inferred.
  1641. maxLength: 253
  1642. pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  1643. type: string
  1644. kind:
  1645. default: Service
  1646. description: "Kind is the Kubernetes resource kind of the referent. For example \"Service\". \n Defaults to \"Service\" when not specified. \n ExternalName services can refer to CNAME DNS records that may live outside of the cluster and as such are difficult to reason about in terms of conformance. They also may not be safe to forward to (see CVE-2021-25740 for more information). Implementations SHOULD NOT support ExternalName Services. \n Support: Core (Services with a type other than ExternalName) \n Support: Implementation-specific (Services with type ExternalName)"
  1647. maxLength: 63
  1648. minLength: 1
  1649. pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
  1650. type: string
  1651. name:
  1652. description: Name is the name of the referent.
  1653. maxLength: 253
  1654. minLength: 1
  1655. type: string
  1656. namespace:
  1657. description: "Namespace is the namespace of the backend. When unspecified, the local namespace is inferred. \n Note that when a namespace different than the local namespace is specified, a ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. \n Support: Core"
  1658. maxLength: 63
  1659. minLength: 1
  1660. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
  1661. type: string
  1662. port:
  1663. description: Port specifies the destination port number to use for this resource. Port is required when the referent is a Kubernetes Service. In this case, the port number is the service port number, not the target port. For other resources, destination port might be derived from the referent resource or this field.
  1664. format: int32
  1665. maximum: 65535
  1666. minimum: 1
  1667. type: integer
  1668. required:
  1669. - name
  1670. type: object
  1671. x-kubernetes-validations:
  1672. - message: Must have port for Service reference
  1673. rule: '(size(self.group) == 0 && self.kind == ''Service'') ? has(self.port) : true'
  1674. required:
  1675. - backendRef
  1676. type: object
  1677. requestRedirect:
  1678. description: "RequestRedirect defines a schema for a filter that responds to the request with an HTTP redirection. \n Support: Core"
  1679. properties:
  1680. hostname:
  1681. description: "Hostname is the hostname to be used in the value of the `Location` header in the response. When empty, the hostname in the `Host` header of the request is used. \n Support: Core"
  1682. maxLength: 253
  1683. minLength: 1
  1684. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  1685. type: string
  1686. path:
  1687. description: "Path defines parameters used to modify the path of the incoming request. The modified path is then used to construct the `Location` header. When empty, the request path is used as-is. \n Support: Extended"
  1688. properties:
  1689. replaceFullPath:
  1690. description: ReplaceFullPath specifies the value with which to replace the full path of a request during a rewrite or redirect.
  1691. maxLength: 1024
  1692. type: string
  1693. replacePrefixMatch:
  1694. description: "ReplacePrefixMatch specifies the value with which to replace the prefix match of a request during a rewrite or redirect. For example, a request to \"/foo/bar\" with a prefix match of \"/foo\" and a ReplacePrefixMatch of \"/xyz\" would be modified to \"/xyz/bar\". \n Note that this matches the behavior of the PathPrefix match type. This matches full path elements. A path element refers to the list of labels in the path split by the `/` separator. When specified, a trailing `/` is ignored. For example, the paths `/abc`, `/abc/`, and `/abc/def` would all match the prefix `/abc`, but the path `/abcd` would not. \n ReplacePrefixMatch is only compatible with a `PathPrefix` HTTPRouteMatch. Using any other HTTPRouteMatch type on the same HTTPRouteRule will result in the implementation setting the Accepted Condition for the Route to `status: False`. \n Request Path | Prefix Match | Replace Prefix | Modified Path -------------|--------------|----------------|---------- /foo/bar | /foo | /xyz | /xyz/bar /foo/bar | /foo | /xyz/ | /xyz/bar /foo/bar | /foo/ | /xyz | /xyz/bar /foo/bar | /foo/ | /xyz/ | /xyz/bar /foo | /foo | /xyz | /xyz /foo/ | /foo | /xyz | /xyz/ /foo/bar | /foo | <empty string> | /bar /foo/ | /foo | <empty string> | / /foo | /foo | <empty string> | / /foo/ | /foo | / | / /foo | /foo | / | /"
  1695. maxLength: 1024
  1696. type: string
  1697. type:
  1698. description: "Type defines the type of path modifier. Additional types may be added in a future release of the API. \n Note that values may be added to this enum, implementations must ensure that unknown values will not cause a crash. \n Unknown values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason of `UnsupportedValue`."
  1699. enum:
  1700. - ReplaceFullPath
  1701. - ReplacePrefixMatch
  1702. type: string
  1703. required:
  1704. - type
  1705. type: object
  1706. x-kubernetes-validations:
  1707. - message: replaceFullPath must be specified when type is set to 'ReplaceFullPath'
  1708. rule: 'self.type == ''ReplaceFullPath'' ? has(self.replaceFullPath) : true'
  1709. - message: type must be 'ReplaceFullPath' when replaceFullPath is set
  1710. rule: 'has(self.replaceFullPath) ? self.type == ''ReplaceFullPath'' : true'
  1711. - message: replacePrefixMatch must be specified when type is set to 'ReplacePrefixMatch'
  1712. rule: 'self.type == ''ReplacePrefixMatch'' ? has(self.replacePrefixMatch) : true'
  1713. - message: type must be 'ReplacePrefixMatch' when replacePrefixMatch is set
  1714. rule: 'has(self.replacePrefixMatch) ? self.type == ''ReplacePrefixMatch'' : true'
  1715. port:
  1716. description: "Port is the port to be used in the value of the `Location` header in the response. \n If no port is specified, the redirect port MUST be derived using the following rules: \n * If redirect scheme is not-empty, the redirect port MUST be the well-known port associated with the redirect scheme. Specifically \"http\" to port 80 and \"https\" to port 443. If the redirect scheme does not have a well-known port, the listener port of the Gateway SHOULD be used. * If redirect scheme is empty, the redirect port MUST be the Gateway Listener port. \n Implementations SHOULD NOT add the port number in the 'Location' header in the following cases: \n * A Location header that will use HTTP (whether that is determined via the Listener protocol or the Scheme field) _and_ use port 80. * A Location header that will use HTTPS (whether that is determined via the Listener protocol or the Scheme field) _and_ use port 443. \n Support: Extended"
  1717. format: int32
  1718. maximum: 65535
  1719. minimum: 1
  1720. type: integer
  1721. scheme:
  1722. description: "Scheme is the scheme to be used in the value of the `Location` header in the response. When empty, the scheme of the request is used. \n Scheme redirects can affect the port of the redirect, for more information, refer to the documentation for the port field of this filter. \n Note that values may be added to this enum, implementations must ensure that unknown values will not cause a crash. \n Unknown values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason of `UnsupportedValue`. \n Support: Extended"
  1723. enum:
  1724. - http
  1725. - https
  1726. type: string
  1727. statusCode:
  1728. default: 302
  1729. description: "StatusCode is the HTTP status code to be used in response. \n Note that values may be added to this enum, implementations must ensure that unknown values will not cause a crash. \n Unknown values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason of `UnsupportedValue`. \n Support: Core"
  1730. enum:
  1731. - 301
  1732. - 302
  1733. type: integer
  1734. type: object
  1735. responseHeaderModifier:
  1736. description: "ResponseHeaderModifier defines a schema for a filter that modifies response headers. \n Support: Extended"
  1737. properties:
  1738. add:
  1739. description: "Add adds the given header(s) (name, value) to the request before the action. It appends to any existing values associated with the header name. \n Input: GET /foo HTTP/1.1 my-header: foo \n Config: add: - name: \"my-header\" value: \"bar,baz\" \n Output: GET /foo HTTP/1.1 my-header: foo,bar,baz"
  1740. items:
  1741. description: HTTPHeader represents an HTTP Header name and value as defined by RFC 7230.
  1742. properties:
  1743. name:
  1744. description: "Name is the name of the HTTP Header to be matched. Name matching MUST be case insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2). \n If multiple entries specify equivalent header names, the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent header name MUST be ignored. Due to the case-insensitivity of header names, \"foo\" and \"Foo\" are considered equivalent."
  1745. maxLength: 256
  1746. minLength: 1
  1747. pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
  1748. type: string
  1749. value:
  1750. description: Value is the value of HTTP Header to be matched.
  1751. maxLength: 4096
  1752. minLength: 1
  1753. type: string
  1754. required:
  1755. - name
  1756. - value
  1757. type: object
  1758. maxItems: 16
  1759. type: array
  1760. x-kubernetes-list-map-keys:
  1761. - name
  1762. x-kubernetes-list-type: map
  1763. remove:
  1764. description: "Remove the given header(s) from the HTTP request before the action. The value of Remove is a list of HTTP header names. Note that the header names are case-insensitive (see https://datatracker.ietf.org/doc/html/rfc2616#section-4.2). \n Input: GET /foo HTTP/1.1 my-header1: foo my-header2: bar my-header3: baz \n Config: remove: [\"my-header1\", \"my-header3\"] \n Output: GET /foo HTTP/1.1 my-header2: bar"
  1765. items:
  1766. type: string
  1767. maxItems: 16
  1768. type: array
  1769. x-kubernetes-list-type: set
  1770. set:
  1771. description: "Set overwrites the request with the given header (name, value) before the action. \n Input: GET /foo HTTP/1.1 my-header: foo \n Config: set: - name: \"my-header\" value: \"bar\" \n Output: GET /foo HTTP/1.1 my-header: bar"
  1772. items:
  1773. description: HTTPHeader represents an HTTP Header name and value as defined by RFC 7230.
  1774. properties:
  1775. name:
  1776. description: "Name is the name of the HTTP Header to be matched. Name matching MUST be case insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2). \n If multiple entries specify equivalent header names, the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent header name MUST be ignored. Due to the case-insensitivity of header names, \"foo\" and \"Foo\" are considered equivalent."
  1777. maxLength: 256
  1778. minLength: 1
  1779. pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
  1780. type: string
  1781. value:
  1782. description: Value is the value of HTTP Header to be matched.
  1783. maxLength: 4096
  1784. minLength: 1
  1785. type: string
  1786. required:
  1787. - name
  1788. - value
  1789. type: object
  1790. maxItems: 16
  1791. type: array
  1792. x-kubernetes-list-map-keys:
  1793. - name
  1794. x-kubernetes-list-type: map
  1795. type: object
  1796. type:
  1797. description: "Type identifies the type of filter to apply. As with other API fields, types are classified into three conformance levels: \n - Core: Filter types and their corresponding configuration defined by \"Support: Core\" in this package, e.g. \"RequestHeaderModifier\". All implementations must support core filters. \n - Extended: Filter types and their corresponding configuration defined by \"Support: Extended\" in this package, e.g. \"RequestMirror\". Implementers are encouraged to support extended filters. \n - Implementation-specific: Filters that are defined and supported by specific vendors. In the future, filters showing convergence in behavior across multiple implementations will be considered for inclusion in extended or core conformance levels. Filter-specific configuration for such filters is specified using the ExtensionRef field. `Type` should be set to \"ExtensionRef\" for custom filters. \n Implementers are encouraged to define custom implementation types to extend the core API with implementation-specific behavior. \n If a reference to a custom filter type cannot be resolved, the filter MUST NOT be skipped. Instead, requests that would have been processed by that filter MUST receive a HTTP error response. \n Note that values may be added to this enum, implementations must ensure that unknown values will not cause a crash. \n Unknown values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason of `UnsupportedValue`."
  1798. enum:
  1799. - RequestHeaderModifier
  1800. - ResponseHeaderModifier
  1801. - RequestMirror
  1802. - RequestRedirect
  1803. - URLRewrite
  1804. - ExtensionRef
  1805. type: string
  1806. urlRewrite:
  1807. description: "URLRewrite defines a schema for a filter that modifies a request during forwarding. \n Support: Extended"
  1808. properties:
  1809. hostname:
  1810. description: "Hostname is the value to be used to replace the Host header value during forwarding. \n Support: Extended"
  1811. maxLength: 253
  1812. minLength: 1
  1813. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  1814. type: string
  1815. path:
  1816. description: "Path defines a path rewrite. \n Support: Extended"
  1817. properties:
  1818. replaceFullPath:
  1819. description: ReplaceFullPath specifies the value with which to replace the full path of a request during a rewrite or redirect.
  1820. maxLength: 1024
  1821. type: string
  1822. replacePrefixMatch:
  1823. description: "ReplacePrefixMatch specifies the value with which to replace the prefix match of a request during a rewrite or redirect. For example, a request to \"/foo/bar\" with a prefix match of \"/foo\" and a ReplacePrefixMatch of \"/xyz\" would be modified to \"/xyz/bar\". \n Note that this matches the behavior of the PathPrefix match type. This matches full path elements. A path element refers to the list of labels in the path split by the `/` separator. When specified, a trailing `/` is ignored. For example, the paths `/abc`, `/abc/`, and `/abc/def` would all match the prefix `/abc`, but the path `/abcd` would not. \n ReplacePrefixMatch is only compatible with a `PathPrefix` HTTPRouteMatch. Using any other HTTPRouteMatch type on the same HTTPRouteRule will result in the implementation setting the Accepted Condition for the Route to `status: False`. \n Request Path | Prefix Match | Replace Prefix | Modified Path -------------|--------------|----------------|---------- /foo/bar | /foo | /xyz | /xyz/bar /foo/bar | /foo | /xyz/ | /xyz/bar /foo/bar | /foo/ | /xyz | /xyz/bar /foo/bar | /foo/ | /xyz/ | /xyz/bar /foo | /foo | /xyz | /xyz /foo/ | /foo | /xyz | /xyz/ /foo/bar | /foo | <empty string> | /bar /foo/ | /foo | <empty string> | / /foo | /foo | <empty string> | / /foo/ | /foo | / | / /foo | /foo | / | /"
  1824. maxLength: 1024
  1825. type: string
  1826. type:
  1827. description: "Type defines the type of path modifier. Additional types may be added in a future release of the API. \n Note that values may be added to this enum, implementations must ensure that unknown values will not cause a crash. \n Unknown values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason of `UnsupportedValue`."
  1828. enum:
  1829. - ReplaceFullPath
  1830. - ReplacePrefixMatch
  1831. type: string
  1832. required:
  1833. - type
  1834. type: object
  1835. x-kubernetes-validations:
  1836. - message: replaceFullPath must be specified when type is set to 'ReplaceFullPath'
  1837. rule: 'self.type == ''ReplaceFullPath'' ? has(self.replaceFullPath) : true'
  1838. - message: type must be 'ReplaceFullPath' when replaceFullPath is set
  1839. rule: 'has(self.replaceFullPath) ? self.type == ''ReplaceFullPath'' : true'
  1840. - message: replacePrefixMatch must be specified when type is set to 'ReplacePrefixMatch'
  1841. rule: 'self.type == ''ReplacePrefixMatch'' ? has(self.replacePrefixMatch) : true'
  1842. - message: type must be 'ReplacePrefixMatch' when replacePrefixMatch is set
  1843. rule: 'has(self.replacePrefixMatch) ? self.type == ''ReplacePrefixMatch'' : true'
  1844. type: object
  1845. required:
  1846. - type
  1847. type: object
  1848. x-kubernetes-validations:
  1849. - message: filter.requestHeaderModifier must be nil if the filter.type is not RequestHeaderModifier
  1850. rule: '!(has(self.requestHeaderModifier) && self.type != ''RequestHeaderModifier'')'
  1851. - message: filter.requestHeaderModifier must be specified for RequestHeaderModifier filter.type
  1852. rule: '!(!has(self.requestHeaderModifier) && self.type == ''RequestHeaderModifier'')'
  1853. - message: filter.responseHeaderModifier must be nil if the filter.type is not ResponseHeaderModifier
  1854. rule: '!(has(self.responseHeaderModifier) && self.type != ''ResponseHeaderModifier'')'
  1855. - message: filter.responseHeaderModifier must be specified for ResponseHeaderModifier filter.type
  1856. rule: '!(!has(self.responseHeaderModifier) && self.type == ''ResponseHeaderModifier'')'
  1857. - message: filter.requestMirror must be nil if the filter.type is not RequestMirror
  1858. rule: '!(has(self.requestMirror) && self.type != ''RequestMirror'')'
  1859. - message: filter.requestMirror must be specified for RequestMirror filter.type
  1860. rule: '!(!has(self.requestMirror) && self.type == ''RequestMirror'')'
  1861. - message: filter.requestRedirect must be nil if the filter.type is not RequestRedirect
  1862. rule: '!(has(self.requestRedirect) && self.type != ''RequestRedirect'')'
  1863. - message: filter.requestRedirect must be specified for RequestRedirect filter.type
  1864. rule: '!(!has(self.requestRedirect) && self.type == ''RequestRedirect'')'
  1865. - message: filter.urlRewrite must be nil if the filter.type is not URLRewrite
  1866. rule: '!(has(self.urlRewrite) && self.type != ''URLRewrite'')'
  1867. - message: filter.urlRewrite must be specified for URLRewrite filter.type
  1868. rule: '!(!has(self.urlRewrite) && self.type == ''URLRewrite'')'
  1869. - message: filter.extensionRef must be nil if the filter.type is not ExtensionRef
  1870. rule: '!(has(self.extensionRef) && self.type != ''ExtensionRef'')'
  1871. - message: filter.extensionRef must be specified for ExtensionRef filter.type
  1872. rule: '!(!has(self.extensionRef) && self.type == ''ExtensionRef'')'
  1873. maxItems: 16
  1874. type: array
  1875. x-kubernetes-validations:
  1876. - message: May specify either httpRouteFilterRequestRedirect or httpRouteFilterRequestRewrite, but not both
  1877. rule: '!(self.exists(f, f.type == ''RequestRedirect'') && self.exists(f, f.type == ''URLRewrite''))'
  1878. - message: May specify either httpRouteFilterRequestRedirect or httpRouteFilterRequestRewrite, but not both
  1879. rule: '!(self.exists(f, f.type == ''RequestRedirect'') && self.exists(f, f.type == ''URLRewrite''))'
  1880. - message: RequestHeaderModifier filter cannot be repeated
  1881. rule: self.filter(f, f.type == 'RequestHeaderModifier').size() <= 1
  1882. - message: ResponseHeaderModifier filter cannot be repeated
  1883. rule: self.filter(f, f.type == 'ResponseHeaderModifier').size() <= 1
  1884. - message: RequestRedirect filter cannot be repeated
  1885. rule: self.filter(f, f.type == 'RequestRedirect').size() <= 1
  1886. - message: URLRewrite filter cannot be repeated
  1887. rule: self.filter(f, f.type == 'URLRewrite').size() <= 1
  1888. group:
  1889. default: ""
  1890. description: Group is the group of the referent. For example, "gateway.networking.k8s.io". When unspecified or empty string, core API group is inferred.
  1891. maxLength: 253
  1892. pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  1893. type: string
  1894. kind:
  1895. default: Service
  1896. description: "Kind is the Kubernetes resource kind of the referent. For example \"Service\". \n Defaults to \"Service\" when not specified. \n ExternalName services can refer to CNAME DNS records that may live outside of the cluster and as such are difficult to reason about in terms of conformance. They also may not be safe to forward to (see CVE-2021-25740 for more information). Implementations SHOULD NOT support ExternalName Services. \n Support: Core (Services with a type other than ExternalName) \n Support: Implementation-specific (Services with type ExternalName)"
  1897. maxLength: 63
  1898. minLength: 1
  1899. pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
  1900. type: string
  1901. name:
  1902. description: Name is the name of the referent.
  1903. maxLength: 253
  1904. minLength: 1
  1905. type: string
  1906. namespace:
  1907. description: "Namespace is the namespace of the backend. When unspecified, the local namespace is inferred. \n Note that when a namespace different than the local namespace is specified, a ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. \n Support: Core"
  1908. maxLength: 63
  1909. minLength: 1
  1910. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
  1911. type: string
  1912. port:
  1913. description: Port specifies the destination port number to use for this resource. Port is required when the referent is a Kubernetes Service. In this case, the port number is the service port number, not the target port. For other resources, destination port might be derived from the referent resource or this field.
  1914. format: int32
  1915. maximum: 65535
  1916. minimum: 1
  1917. type: integer
  1918. weight:
  1919. default: 1
  1920. description: "Weight specifies the proportion of requests forwarded to the referenced backend. This is computed as weight/(sum of all weights in this BackendRefs list). For non-zero values, there may be some epsilon from the exact proportion defined here depending on the precision an implementation supports. Weight is not a percentage and the sum of weights does not need to equal 100. \n If only one backend is specified and it has a weight greater than 0, 100% of the traffic is forwarded to that backend. If weight is set to 0, no traffic should be forwarded for this entry. If unspecified, weight defaults to 1. \n Support for this field varies based on the context where used."
  1921. format: int32
  1922. maximum: 1000000
  1923. minimum: 0
  1924. type: integer
  1925. required:
  1926. - name
  1927. type: object
  1928. x-kubernetes-validations:
  1929. - message: Must have port for Service reference
  1930. rule: '(size(self.group) == 0 && self.kind == ''Service'') ? has(self.port) : true'
  1931. maxItems: 16
  1932. type: array
  1933. filters:
  1934. description: "Filters define the filters that are applied to requests that match this rule. \n The effects of ordering of multiple behaviors are currently unspecified. This can change in the future based on feedback during the alpha stage. \n Conformance-levels at this level are defined based on the type of filter: \n - ALL core filters MUST be supported by all implementations. - Implementers are encouraged to support extended filters. - Implementation-specific custom filters have no API guarantees across implementations. \n Specifying the same filter multiple times is not supported unless explicitly indicated in the filter. \n All filters are expected to be compatible with each other except for the URLRewrite and RequestRedirect filters, which may not be combined. If an implementation can not support other combinations of filters, they must clearly document that limitation. In cases where incompatible or unsupported filters are specified and cause the `Accepted` condition to be set to status `False`, implementations may use the `IncompatibleFilters` reason to specify this configuration error. \n Support: Core"
  1935. items:
  1936. description: HTTPRouteFilter defines processing steps that must be completed during the request or response lifecycle. HTTPRouteFilters are meant as an extension point to express processing that may be done in Gateway implementations. Some examples include request or response modification, implementing authentication strategies, rate-limiting, and traffic shaping. API guarantee/conformance is defined based on the type of the filter.
  1937. properties:
  1938. extensionRef:
  1939. description: "ExtensionRef is an optional, implementation-specific extension to the \"filter\" behavior. For example, resource \"myroutefilter\" in group \"networking.example.net\"). ExtensionRef MUST NOT be used for core and extended filters. \n This filter can be used multiple times within the same rule. \n Support: Implementation-specific"
  1940. properties:
  1941. group:
  1942. description: Group is the group of the referent. For example, "gateway.networking.k8s.io". When unspecified or empty string, core API group is inferred.
  1943. maxLength: 253
  1944. pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  1945. type: string
  1946. kind:
  1947. description: Kind is kind of the referent. For example "HTTPRoute" or "Service".
  1948. maxLength: 63
  1949. minLength: 1
  1950. pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
  1951. type: string
  1952. name:
  1953. description: Name is the name of the referent.
  1954. maxLength: 253
  1955. minLength: 1
  1956. type: string
  1957. required:
  1958. - group
  1959. - kind
  1960. - name
  1961. type: object
  1962. requestHeaderModifier:
  1963. description: "RequestHeaderModifier defines a schema for a filter that modifies request headers. \n Support: Core"
  1964. properties:
  1965. add:
  1966. description: "Add adds the given header(s) (name, value) to the request before the action. It appends to any existing values associated with the header name. \n Input: GET /foo HTTP/1.1 my-header: foo \n Config: add: - name: \"my-header\" value: \"bar,baz\" \n Output: GET /foo HTTP/1.1 my-header: foo,bar,baz"
  1967. items:
  1968. description: HTTPHeader represents an HTTP Header name and value as defined by RFC 7230.
  1969. properties:
  1970. name:
  1971. description: "Name is the name of the HTTP Header to be matched. Name matching MUST be case insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2). \n If multiple entries specify equivalent header names, the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent header name MUST be ignored. Due to the case-insensitivity of header names, \"foo\" and \"Foo\" are considered equivalent."
  1972. maxLength: 256
  1973. minLength: 1
  1974. pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
  1975. type: string
  1976. value:
  1977. description: Value is the value of HTTP Header to be matched.
  1978. maxLength: 4096
  1979. minLength: 1
  1980. type: string
  1981. required:
  1982. - name
  1983. - value
  1984. type: object
  1985. maxItems: 16
  1986. type: array
  1987. x-kubernetes-list-map-keys:
  1988. - name
  1989. x-kubernetes-list-type: map
  1990. remove:
  1991. description: "Remove the given header(s) from the HTTP request before the action. The value of Remove is a list of HTTP header names. Note that the header names are case-insensitive (see https://datatracker.ietf.org/doc/html/rfc2616#section-4.2). \n Input: GET /foo HTTP/1.1 my-header1: foo my-header2: bar my-header3: baz \n Config: remove: [\"my-header1\", \"my-header3\"] \n Output: GET /foo HTTP/1.1 my-header2: bar"
  1992. items:
  1993. type: string
  1994. maxItems: 16
  1995. type: array
  1996. x-kubernetes-list-type: set
  1997. set:
  1998. description: "Set overwrites the request with the given header (name, value) before the action. \n Input: GET /foo HTTP/1.1 my-header: foo \n Config: set: - name: \"my-header\" value: \"bar\" \n Output: GET /foo HTTP/1.1 my-header: bar"
  1999. items:
  2000. description: HTTPHeader represents an HTTP Header name and value as defined by RFC 7230.
  2001. properties:
  2002. name:
  2003. description: "Name is the name of the HTTP Header to be matched. Name matching MUST be case insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2). \n If multiple entries specify equivalent header names, the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent header name MUST be ignored. Due to the case-insensitivity of header names, \"foo\" and \"Foo\" are considered equivalent."
  2004. maxLength: 256
  2005. minLength: 1
  2006. pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
  2007. type: string
  2008. value:
  2009. description: Value is the value of HTTP Header to be matched.
  2010. maxLength: 4096
  2011. minLength: 1
  2012. type: string
  2013. required:
  2014. - name
  2015. - value
  2016. type: object
  2017. maxItems: 16
  2018. type: array
  2019. x-kubernetes-list-map-keys:
  2020. - name
  2021. x-kubernetes-list-type: map
  2022. type: object
  2023. requestMirror:
  2024. description: "RequestMirror defines a schema for a filter that mirrors requests. Requests are sent to the specified destination, but responses from that destination are ignored. \n This filter can be used multiple times within the same rule. Note that not all implementations will be able to support mirroring to multiple backends. \n Support: Extended"
  2025. properties:
  2026. backendRef:
  2027. description: "BackendRef references a resource where mirrored requests are sent. \n Mirrored requests must be sent only to a single destination endpoint within this BackendRef, irrespective of how many endpoints are present within this BackendRef. \n If the referent cannot be found, this BackendRef is invalid and must be dropped from the Gateway. The controller must ensure the \"ResolvedRefs\" condition on the Route status is set to `status: False` and not configure this backend in the underlying implementation. \n If there is a cross-namespace reference to an *existing* object that is not allowed by a ReferenceGrant, the controller must ensure the \"ResolvedRefs\" condition on the Route is set to `status: False`, with the \"RefNotPermitted\" reason and not configure this backend in the underlying implementation. \n In either error case, the Message of the `ResolvedRefs` Condition should be used to provide more detail about the problem. \n Support: Extended for Kubernetes Service \n Support: Implementation-specific for any other resource"
  2028. properties:
  2029. group:
  2030. default: ""
  2031. description: Group is the group of the referent. For example, "gateway.networking.k8s.io". When unspecified or empty string, core API group is inferred.
  2032. maxLength: 253
  2033. pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  2034. type: string
  2035. kind:
  2036. default: Service
  2037. description: "Kind is the Kubernetes resource kind of the referent. For example \"Service\". \n Defaults to \"Service\" when not specified. \n ExternalName services can refer to CNAME DNS records that may live outside of the cluster and as such are difficult to reason about in terms of conformance. They also may not be safe to forward to (see CVE-2021-25740 for more information). Implementations SHOULD NOT support ExternalName Services. \n Support: Core (Services with a type other than ExternalName) \n Support: Implementation-specific (Services with type ExternalName)"
  2038. maxLength: 63
  2039. minLength: 1
  2040. pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
  2041. type: string
  2042. name:
  2043. description: Name is the name of the referent.
  2044. maxLength: 253
  2045. minLength: 1
  2046. type: string
  2047. namespace:
  2048. description: "Namespace is the namespace of the backend. When unspecified, the local namespace is inferred. \n Note that when a namespace different than the local namespace is specified, a ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. \n Support: Core"
  2049. maxLength: 63
  2050. minLength: 1
  2051. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
  2052. type: string
  2053. port:
  2054. description: Port specifies the destination port number to use for this resource. Port is required when the referent is a Kubernetes Service. In this case, the port number is the service port number, not the target port. For other resources, destination port might be derived from the referent resource or this field.
  2055. format: int32
  2056. maximum: 65535
  2057. minimum: 1
  2058. type: integer
  2059. required:
  2060. - name
  2061. type: object
  2062. x-kubernetes-validations:
  2063. - message: Must have port for Service reference
  2064. rule: '(size(self.group) == 0 && self.kind == ''Service'') ? has(self.port) : true'
  2065. required:
  2066. - backendRef
  2067. type: object
  2068. requestRedirect:
  2069. description: "RequestRedirect defines a schema for a filter that responds to the request with an HTTP redirection. \n Support: Core"
  2070. properties:
  2071. hostname:
  2072. description: "Hostname is the hostname to be used in the value of the `Location` header in the response. When empty, the hostname in the `Host` header of the request is used. \n Support: Core"
  2073. maxLength: 253
  2074. minLength: 1
  2075. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  2076. type: string
  2077. path:
  2078. description: "Path defines parameters used to modify the path of the incoming request. The modified path is then used to construct the `Location` header. When empty, the request path is used as-is. \n Support: Extended"
  2079. properties:
  2080. replaceFullPath:
  2081. description: ReplaceFullPath specifies the value with which to replace the full path of a request during a rewrite or redirect.
  2082. maxLength: 1024
  2083. type: string
  2084. replacePrefixMatch:
  2085. description: "ReplacePrefixMatch specifies the value with which to replace the prefix match of a request during a rewrite or redirect. For example, a request to \"/foo/bar\" with a prefix match of \"/foo\" and a ReplacePrefixMatch of \"/xyz\" would be modified to \"/xyz/bar\". \n Note that this matches the behavior of the PathPrefix match type. This matches full path elements. A path element refers to the list of labels in the path split by the `/` separator. When specified, a trailing `/` is ignored. For example, the paths `/abc`, `/abc/`, and `/abc/def` would all match the prefix `/abc`, but the path `/abcd` would not. \n ReplacePrefixMatch is only compatible with a `PathPrefix` HTTPRouteMatch. Using any other HTTPRouteMatch type on the same HTTPRouteRule will result in the implementation setting the Accepted Condition for the Route to `status: False`. \n Request Path | Prefix Match | Replace Prefix | Modified Path -------------|--------------|----------------|---------- /foo/bar | /foo | /xyz | /xyz/bar /foo/bar | /foo | /xyz/ | /xyz/bar /foo/bar | /foo/ | /xyz | /xyz/bar /foo/bar | /foo/ | /xyz/ | /xyz/bar /foo | /foo | /xyz | /xyz /foo/ | /foo | /xyz | /xyz/ /foo/bar | /foo | <empty string> | /bar /foo/ | /foo | <empty string> | / /foo | /foo | <empty string> | / /foo/ | /foo | / | / /foo | /foo | / | /"
  2086. maxLength: 1024
  2087. type: string
  2088. type:
  2089. description: "Type defines the type of path modifier. Additional types may be added in a future release of the API. \n Note that values may be added to this enum, implementations must ensure that unknown values will not cause a crash. \n Unknown values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason of `UnsupportedValue`."
  2090. enum:
  2091. - ReplaceFullPath
  2092. - ReplacePrefixMatch
  2093. type: string
  2094. required:
  2095. - type
  2096. type: object
  2097. x-kubernetes-validations:
  2098. - message: replaceFullPath must be specified when type is set to 'ReplaceFullPath'
  2099. rule: 'self.type == ''ReplaceFullPath'' ? has(self.replaceFullPath) : true'
  2100. - message: type must be 'ReplaceFullPath' when replaceFullPath is set
  2101. rule: 'has(self.replaceFullPath) ? self.type == ''ReplaceFullPath'' : true'
  2102. - message: replacePrefixMatch must be specified when type is set to 'ReplacePrefixMatch'
  2103. rule: 'self.type == ''ReplacePrefixMatch'' ? has(self.replacePrefixMatch) : true'
  2104. - message: type must be 'ReplacePrefixMatch' when replacePrefixMatch is set
  2105. rule: 'has(self.replacePrefixMatch) ? self.type == ''ReplacePrefixMatch'' : true'
  2106. port:
  2107. description: "Port is the port to be used in the value of the `Location` header in the response. \n If no port is specified, the redirect port MUST be derived using the following rules: \n * If redirect scheme is not-empty, the redirect port MUST be the well-known port associated with the redirect scheme. Specifically \"http\" to port 80 and \"https\" to port 443. If the redirect scheme does not have a well-known port, the listener port of the Gateway SHOULD be used. * If redirect scheme is empty, the redirect port MUST be the Gateway Listener port. \n Implementations SHOULD NOT add the port number in the 'Location' header in the following cases: \n * A Location header that will use HTTP (whether that is determined via the Listener protocol or the Scheme field) _and_ use port 80. * A Location header that will use HTTPS (whether that is determined via the Listener protocol or the Scheme field) _and_ use port 443. \n Support: Extended"
  2108. format: int32
  2109. maximum: 65535
  2110. minimum: 1
  2111. type: integer
  2112. scheme:
  2113. description: "Scheme is the scheme to be used in the value of the `Location` header in the response. When empty, the scheme of the request is used. \n Scheme redirects can affect the port of the redirect, for more information, refer to the documentation for the port field of this filter. \n Note that values may be added to this enum, implementations must ensure that unknown values will not cause a crash. \n Unknown values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason of `UnsupportedValue`. \n Support: Extended"
  2114. enum:
  2115. - http
  2116. - https
  2117. type: string
  2118. statusCode:
  2119. default: 302
  2120. description: "StatusCode is the HTTP status code to be used in response. \n Note that values may be added to this enum, implementations must ensure that unknown values will not cause a crash. \n Unknown values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason of `UnsupportedValue`. \n Support: Core"
  2121. enum:
  2122. - 301
  2123. - 302
  2124. type: integer
  2125. type: object
  2126. responseHeaderModifier:
  2127. description: "ResponseHeaderModifier defines a schema for a filter that modifies response headers. \n Support: Extended"
  2128. properties:
  2129. add:
  2130. description: "Add adds the given header(s) (name, value) to the request before the action. It appends to any existing values associated with the header name. \n Input: GET /foo HTTP/1.1 my-header: foo \n Config: add: - name: \"my-header\" value: \"bar,baz\" \n Output: GET /foo HTTP/1.1 my-header: foo,bar,baz"
  2131. items:
  2132. description: HTTPHeader represents an HTTP Header name and value as defined by RFC 7230.
  2133. properties:
  2134. name:
  2135. description: "Name is the name of the HTTP Header to be matched. Name matching MUST be case insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2). \n If multiple entries specify equivalent header names, the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent header name MUST be ignored. Due to the case-insensitivity of header names, \"foo\" and \"Foo\" are considered equivalent."
  2136. maxLength: 256
  2137. minLength: 1
  2138. pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
  2139. type: string
  2140. value:
  2141. description: Value is the value of HTTP Header to be matched.
  2142. maxLength: 4096
  2143. minLength: 1
  2144. type: string
  2145. required:
  2146. - name
  2147. - value
  2148. type: object
  2149. maxItems: 16
  2150. type: array
  2151. x-kubernetes-list-map-keys:
  2152. - name
  2153. x-kubernetes-list-type: map
  2154. remove:
  2155. description: "Remove the given header(s) from the HTTP request before the action. The value of Remove is a list of HTTP header names. Note that the header names are case-insensitive (see https://datatracker.ietf.org/doc/html/rfc2616#section-4.2). \n Input: GET /foo HTTP/1.1 my-header1: foo my-header2: bar my-header3: baz \n Config: remove: [\"my-header1\", \"my-header3\"] \n Output: GET /foo HTTP/1.1 my-header2: bar"
  2156. items:
  2157. type: string
  2158. maxItems: 16
  2159. type: array
  2160. x-kubernetes-list-type: set
  2161. set:
  2162. description: "Set overwrites the request with the given header (name, value) before the action. \n Input: GET /foo HTTP/1.1 my-header: foo \n Config: set: - name: \"my-header\" value: \"bar\" \n Output: GET /foo HTTP/1.1 my-header: bar"
  2163. items:
  2164. description: HTTPHeader represents an HTTP Header name and value as defined by RFC 7230.
  2165. properties:
  2166. name:
  2167. description: "Name is the name of the HTTP Header to be matched. Name matching MUST be case insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2). \n If multiple entries specify equivalent header names, the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent header name MUST be ignored. Due to the case-insensitivity of header names, \"foo\" and \"Foo\" are considered equivalent."
  2168. maxLength: 256
  2169. minLength: 1
  2170. pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
  2171. type: string
  2172. value:
  2173. description: Value is the value of HTTP Header to be matched.
  2174. maxLength: 4096
  2175. minLength: 1
  2176. type: string
  2177. required:
  2178. - name
  2179. - value
  2180. type: object
  2181. maxItems: 16
  2182. type: array
  2183. x-kubernetes-list-map-keys:
  2184. - name
  2185. x-kubernetes-list-type: map
  2186. type: object
  2187. type:
  2188. description: "Type identifies the type of filter to apply. As with other API fields, types are classified into three conformance levels: \n - Core: Filter types and their corresponding configuration defined by \"Support: Core\" in this package, e.g. \"RequestHeaderModifier\". All implementations must support core filters. \n - Extended: Filter types and their corresponding configuration defined by \"Support: Extended\" in this package, e.g. \"RequestMirror\". Implementers are encouraged to support extended filters. \n - Implementation-specific: Filters that are defined and supported by specific vendors. In the future, filters showing convergence in behavior across multiple implementations will be considered for inclusion in extended or core conformance levels. Filter-specific configuration for such filters is specified using the ExtensionRef field. `Type` should be set to \"ExtensionRef\" for custom filters. \n Implementers are encouraged to define custom implementation types to extend the core API with implementation-specific behavior. \n If a reference to a custom filter type cannot be resolved, the filter MUST NOT be skipped. Instead, requests that would have been processed by that filter MUST receive a HTTP error response. \n Note that values may be added to this enum, implementations must ensure that unknown values will not cause a crash. \n Unknown values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason of `UnsupportedValue`."
  2189. enum:
  2190. - RequestHeaderModifier
  2191. - ResponseHeaderModifier
  2192. - RequestMirror
  2193. - RequestRedirect
  2194. - URLRewrite
  2195. - ExtensionRef
  2196. type: string
  2197. urlRewrite:
  2198. description: "URLRewrite defines a schema for a filter that modifies a request during forwarding. \n Support: Extended"
  2199. properties:
  2200. hostname:
  2201. description: "Hostname is the value to be used to replace the Host header value during forwarding. \n Support: Extended"
  2202. maxLength: 253
  2203. minLength: 1
  2204. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  2205. type: string
  2206. path:
  2207. description: "Path defines a path rewrite. \n Support: Extended"
  2208. properties:
  2209. replaceFullPath:
  2210. description: ReplaceFullPath specifies the value with which to replace the full path of a request during a rewrite or redirect.
  2211. maxLength: 1024
  2212. type: string
  2213. replacePrefixMatch:
  2214. description: "ReplacePrefixMatch specifies the value with which to replace the prefix match of a request during a rewrite or redirect. For example, a request to \"/foo/bar\" with a prefix match of \"/foo\" and a ReplacePrefixMatch of \"/xyz\" would be modified to \"/xyz/bar\". \n Note that this matches the behavior of the PathPrefix match type. This matches full path elements. A path element refers to the list of labels in the path split by the `/` separator. When specified, a trailing `/` is ignored. For example, the paths `/abc`, `/abc/`, and `/abc/def` would all match the prefix `/abc`, but the path `/abcd` would not. \n ReplacePrefixMatch is only compatible with a `PathPrefix` HTTPRouteMatch. Using any other HTTPRouteMatch type on the same HTTPRouteRule will result in the implementation setting the Accepted Condition for the Route to `status: False`. \n Request Path | Prefix Match | Replace Prefix | Modified Path -------------|--------------|----------------|---------- /foo/bar | /foo | /xyz | /xyz/bar /foo/bar | /foo | /xyz/ | /xyz/bar /foo/bar | /foo/ | /xyz | /xyz/bar /foo/bar | /foo/ | /xyz/ | /xyz/bar /foo | /foo | /xyz | /xyz /foo/ | /foo | /xyz | /xyz/ /foo/bar | /foo | <empty string> | /bar /foo/ | /foo | <empty string> | / /foo | /foo | <empty string> | / /foo/ | /foo | / | / /foo | /foo | / | /"
  2215. maxLength: 1024
  2216. type: string
  2217. type:
  2218. description: "Type defines the type of path modifier. Additional types may be added in a future release of the API. \n Note that values may be added to this enum, implementations must ensure that unknown values will not cause a crash. \n Unknown values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason of `UnsupportedValue`."
  2219. enum:
  2220. - ReplaceFullPath
  2221. - ReplacePrefixMatch
  2222. type: string
  2223. required:
  2224. - type
  2225. type: object
  2226. x-kubernetes-validations:
  2227. - message: replaceFullPath must be specified when type is set to 'ReplaceFullPath'
  2228. rule: 'self.type == ''ReplaceFullPath'' ? has(self.replaceFullPath) : true'
  2229. - message: type must be 'ReplaceFullPath' when replaceFullPath is set
  2230. rule: 'has(self.replaceFullPath) ? self.type == ''ReplaceFullPath'' : true'
  2231. - message: replacePrefixMatch must be specified when type is set to 'ReplacePrefixMatch'
  2232. rule: 'self.type == ''ReplacePrefixMatch'' ? has(self.replacePrefixMatch) : true'
  2233. - message: type must be 'ReplacePrefixMatch' when replacePrefixMatch is set
  2234. rule: 'has(self.replacePrefixMatch) ? self.type == ''ReplacePrefixMatch'' : true'
  2235. type: object
  2236. required:
  2237. - type
  2238. type: object
  2239. x-kubernetes-validations:
  2240. - message: filter.requestHeaderModifier must be nil if the filter.type is not RequestHeaderModifier
  2241. rule: '!(has(self.requestHeaderModifier) && self.type != ''RequestHeaderModifier'')'
  2242. - message: filter.requestHeaderModifier must be specified for RequestHeaderModifier filter.type
  2243. rule: '!(!has(self.requestHeaderModifier) && self.type == ''RequestHeaderModifier'')'
  2244. - message: filter.responseHeaderModifier must be nil if the filter.type is not ResponseHeaderModifier
  2245. rule: '!(has(self.responseHeaderModifier) && self.type != ''ResponseHeaderModifier'')'
  2246. - message: filter.responseHeaderModifier must be specified for ResponseHeaderModifier filter.type
  2247. rule: '!(!has(self.responseHeaderModifier) && self.type == ''ResponseHeaderModifier'')'
  2248. - message: filter.requestMirror must be nil if the filter.type is not RequestMirror
  2249. rule: '!(has(self.requestMirror) && self.type != ''RequestMirror'')'
  2250. - message: filter.requestMirror must be specified for RequestMirror filter.type
  2251. rule: '!(!has(self.requestMirror) && self.type == ''RequestMirror'')'
  2252. - message: filter.requestRedirect must be nil if the filter.type is not RequestRedirect
  2253. rule: '!(has(self.requestRedirect) && self.type != ''RequestRedirect'')'
  2254. - message: filter.requestRedirect must be specified for RequestRedirect filter.type
  2255. rule: '!(!has(self.requestRedirect) && self.type == ''RequestRedirect'')'
  2256. - message: filter.urlRewrite must be nil if the filter.type is not URLRewrite
  2257. rule: '!(has(self.urlRewrite) && self.type != ''URLRewrite'')'
  2258. - message: filter.urlRewrite must be specified for URLRewrite filter.type
  2259. rule: '!(!has(self.urlRewrite) && self.type == ''URLRewrite'')'
  2260. - message: filter.extensionRef must be nil if the filter.type is not ExtensionRef
  2261. rule: '!(has(self.extensionRef) && self.type != ''ExtensionRef'')'
  2262. - message: filter.extensionRef must be specified for ExtensionRef filter.type
  2263. rule: '!(!has(self.extensionRef) && self.type == ''ExtensionRef'')'
  2264. maxItems: 16
  2265. type: array
  2266. x-kubernetes-validations:
  2267. - message: May specify either httpRouteFilterRequestRedirect or httpRouteFilterRequestRewrite, but not both
  2268. rule: '!(self.exists(f, f.type == ''RequestRedirect'') && self.exists(f, f.type == ''URLRewrite''))'
  2269. - message: RequestHeaderModifier filter cannot be repeated
  2270. rule: self.filter(f, f.type == 'RequestHeaderModifier').size() <= 1
  2271. - message: ResponseHeaderModifier filter cannot be repeated
  2272. rule: self.filter(f, f.type == 'ResponseHeaderModifier').size() <= 1
  2273. - message: RequestRedirect filter cannot be repeated
  2274. rule: self.filter(f, f.type == 'RequestRedirect').size() <= 1
  2275. - message: URLRewrite filter cannot be repeated
  2276. rule: self.filter(f, f.type == 'URLRewrite').size() <= 1
  2277. matches:
  2278. default:
  2279. - path:
  2280. type: PathPrefix
  2281. value: /
  2282. description: "Matches define conditions used for matching the rule against incoming HTTP requests. Each match is independent, i.e. this rule will be matched if **any** one of the matches is satisfied. \n For example, take the following matches configuration: \n ``` matches: - path: value: \"/foo\" headers: - name: \"version\" value: \"v2\" - path: value: \"/v2/foo\" ``` \n For a request to match against this rule, a request must satisfy EITHER of the two conditions: \n - path prefixed with `/foo` AND contains the header `version: v2` - path prefix of `/v2/foo` \n See the documentation for HTTPRouteMatch on how to specify multiple match conditions that should be ANDed together. \n If no matches are specified, the default is a prefix path match on \"/\", which has the effect of matching every HTTP request. \n Proxy or Load Balancer routing configuration generated from HTTPRoutes MUST prioritize matches based on the following criteria, continuing on ties. Across all rules specified on applicable Routes, precedence must be given to the match having: \n * \"Exact\" path match. * \"Prefix\" path match with largest number of characters. * Method match. * Largest number of header matches. * Largest number of query param matches. \n Note: The precedence of RegularExpression path matches are implementation-specific. \n If ties still exist across multiple Routes, matching precedence MUST be determined in order of the following criteria, continuing on ties: \n * The oldest Route based on creation timestamp. * The Route appearing first in alphabetical order by \"{namespace}/{name}\". \n If ties still exist within an HTTPRoute, matching precedence MUST be granted to the FIRST matching rule (in list order) with a match meeting the above criteria. \n When no rules matching a request have been successfully attached to the parent a request is coming from, a HTTP 404 status code MUST be returned."
  2283. items:
  2284. description: "HTTPRouteMatch defines the predicate used to match requests to a given action. Multiple match types are ANDed together, i.e. the match will evaluate to true only if all conditions are satisfied. \n For example, the match below will match a HTTP request only if its path starts with `/foo` AND it contains the `version: v1` header: \n ``` match: \n path: value: \"/foo\" headers: - name: \"version\" value \"v1\" \n ```"
  2285. properties:
  2286. headers:
  2287. description: Headers specifies HTTP request header matchers. Multiple match values are ANDed together, meaning, a request must match all the specified headers to select the route.
  2288. items:
  2289. description: HTTPHeaderMatch describes how to select a HTTP route by matching HTTP request headers.
  2290. properties:
  2291. name:
  2292. description: "Name is the name of the HTTP Header to be matched. Name matching MUST be case insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2). \n If multiple entries specify equivalent header names, only the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent header name MUST be ignored. Due to the case-insensitivity of header names, \"foo\" and \"Foo\" are considered equivalent. \n When a header is repeated in an HTTP request, it is implementation-specific behavior as to how this is represented. Generally, proxies should follow the guidance from the RFC: https://www.rfc-editor.org/rfc/rfc7230.html#section-3.2.2 regarding processing a repeated header, with special handling for \"Set-Cookie\"."
  2293. maxLength: 256
  2294. minLength: 1
  2295. pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
  2296. type: string
  2297. type:
  2298. default: Exact
  2299. description: "Type specifies how to match against the value of the header. \n Support: Core (Exact) \n Support: Implementation-specific (RegularExpression) \n Since RegularExpression HeaderMatchType has implementation-specific conformance, implementations can support POSIX, PCRE or any other dialects of regular expressions. Please read the implementation's documentation to determine the supported dialect."
  2300. enum:
  2301. - Exact
  2302. - RegularExpression
  2303. type: string
  2304. value:
  2305. description: Value is the value of HTTP Header to be matched.
  2306. maxLength: 4096
  2307. minLength: 1
  2308. type: string
  2309. required:
  2310. - name
  2311. - value
  2312. type: object
  2313. maxItems: 16
  2314. type: array
  2315. x-kubernetes-list-map-keys:
  2316. - name
  2317. x-kubernetes-list-type: map
  2318. method:
  2319. description: "Method specifies HTTP method matcher. When specified, this route will be matched only if the request has the specified method. \n Support: Extended"
  2320. enum:
  2321. - GET
  2322. - HEAD
  2323. - POST
  2324. - PUT
  2325. - DELETE
  2326. - CONNECT
  2327. - OPTIONS
  2328. - TRACE
  2329. - PATCH
  2330. type: string
  2331. path:
  2332. default:
  2333. type: PathPrefix
  2334. value: /
  2335. description: Path specifies a HTTP request path matcher. If this field is not specified, a default prefix match on the "/" path is provided.
  2336. properties:
  2337. type:
  2338. default: PathPrefix
  2339. description: "Type specifies how to match against the path Value. \n Support: Core (Exact, PathPrefix) \n Support: Implementation-specific (RegularExpression)"
  2340. enum:
  2341. - Exact
  2342. - PathPrefix
  2343. - RegularExpression
  2344. type: string
  2345. value:
  2346. default: /
  2347. description: Value of the HTTP path to match against.
  2348. maxLength: 1024
  2349. type: string
  2350. type: object
  2351. x-kubernetes-validations:
  2352. - message: value must be an absolute path and start with '/' when type one of ['Exact', 'PathPrefix']
  2353. rule: '(self.type in [''Exact'',''PathPrefix'']) ? self.value.startsWith(''/'') : true'
  2354. - message: must not contain '//' when type one of ['Exact', 'PathPrefix']
  2355. rule: '(self.type in [''Exact'',''PathPrefix'']) ? !self.value.contains(''//'') : true'
  2356. - message: must not contain '/./' when type one of ['Exact', 'PathPrefix']
  2357. rule: '(self.type in [''Exact'',''PathPrefix'']) ? !self.value.contains(''/./'') : true'
  2358. - message: must not contain '/../' when type one of ['Exact', 'PathPrefix']
  2359. rule: '(self.type in [''Exact'',''PathPrefix'']) ? !self.value.contains(''/../'') : true'
  2360. - message: must not contain '%2f' when type one of ['Exact', 'PathPrefix']
  2361. rule: '(self.type in [''Exact'',''PathPrefix'']) ? !self.value.contains(''%2f'') : true'
  2362. - message: must not contain '%2F' when type one of ['Exact', 'PathPrefix']
  2363. rule: '(self.type in [''Exact'',''PathPrefix'']) ? !self.value.contains(''%2F'') : true'
  2364. - message: must not contain '#' when type one of ['Exact', 'PathPrefix']
  2365. rule: '(self.type in [''Exact'',''PathPrefix'']) ? !self.value.contains(''#'') : true'
  2366. - message: must not end with '/..' when type one of ['Exact', 'PathPrefix']
  2367. rule: '(self.type in [''Exact'',''PathPrefix'']) ? !self.value.endsWith(''/..'') : true'
  2368. - message: must not end with '/.' when type one of ['Exact', 'PathPrefix']
  2369. rule: '(self.type in [''Exact'',''PathPrefix'']) ? !self.value.endsWith(''/.'') : true'
  2370. - message: type must be one of ['Exact', 'PathPrefix', 'RegularExpression']
  2371. rule: self.type in ['Exact','PathPrefix'] || self.type == 'RegularExpression'
  2372. - message: must only contain valid characters (matching ^(?:[-A-Za-z0-9/._~!$&'()*+,;=:@]|[%][0-9a-fA-F]{2})+$) for types ['Exact', 'PathPrefix']
  2373. rule: '(self.type in [''Exact'',''PathPrefix'']) ? self.value.matches(r"""^(?:[-A-Za-z0-9/._~!$&''()*+,;=:@]|[%][0-9a-fA-F]{2})+$""") : true'
  2374. queryParams:
  2375. description: "QueryParams specifies HTTP query parameter matchers. Multiple match values are ANDed together, meaning, a request must match all the specified query parameters to select the route. \n Support: Extended"
  2376. items:
  2377. description: HTTPQueryParamMatch describes how to select a HTTP route by matching HTTP query parameters.
  2378. properties:
  2379. name:
  2380. description: "Name is the name of the HTTP query param to be matched. This must be an exact string match. (See https://tools.ietf.org/html/rfc7230#section-2.7.3). \n If multiple entries specify equivalent query param names, only the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent query param name MUST be ignored. \n If a query param is repeated in an HTTP request, the behavior is purposely left undefined, since different data planes have different capabilities. However, it is *recommended* that implementations should match against the first value of the param if the data plane supports it, as this behavior is expected in other load balancing contexts outside of the Gateway API. \n Users SHOULD NOT route traffic based on repeated query params to guard themselves against potential differences in the implementations."
  2381. maxLength: 256
  2382. minLength: 1
  2383. pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
  2384. type: string
  2385. type:
  2386. default: Exact
  2387. description: "Type specifies how to match against the value of the query parameter. \n Support: Extended (Exact) \n Support: Implementation-specific (RegularExpression) \n Since RegularExpression QueryParamMatchType has Implementation-specific conformance, implementations can support POSIX, PCRE or any other dialects of regular expressions. Please read the implementation's documentation to determine the supported dialect."
  2388. enum:
  2389. - Exact
  2390. - RegularExpression
  2391. type: string
  2392. value:
  2393. description: Value is the value of HTTP query param to be matched.
  2394. maxLength: 1024
  2395. minLength: 1
  2396. type: string
  2397. required:
  2398. - name
  2399. - value
  2400. type: object
  2401. maxItems: 16
  2402. type: array
  2403. x-kubernetes-list-map-keys:
  2404. - name
  2405. x-kubernetes-list-type: map
  2406. type: object
  2407. maxItems: 8
  2408. type: array
  2409. timeouts:
  2410. description: "Timeouts defines the timeouts that can be configured for an HTTP request. \n Support: Extended \n "
  2411. properties:
  2412. backendRequest:
  2413. description: "BackendRequest specifies a timeout for an individual request from the gateway to a backend. This covers the time from when the request first starts being sent from the gateway to when the full response has been received from the backend. \n An entire client HTTP transaction with a gateway, covered by the Request timeout, may result in more than one call from the gateway to the destination backend, for example, if automatic retries are supported. \n Because the Request timeout encompasses the BackendRequest timeout, the value of BackendRequest must be <= the value of Request timeout. \n Support: Extended"
  2414. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
  2415. type: string
  2416. request:
  2417. description: "Request specifies the maximum duration for a gateway to respond to an HTTP request. If the gateway has not been able to respond before this deadline is met, the gateway MUST return a timeout error. \n For example, setting the `rules.timeouts.request` field to the value `10s` in an `HTTPRoute` will cause a timeout if a client request is taking longer than 10 seconds to complete. \n This timeout is intended to cover as close to the whole request-response transaction as possible although an implementation MAY choose to start the timeout after the entire request stream has been received instead of immediately after the transaction is initiated by the client. \n When this field is unspecified, request timeout behavior is implementation-specific. \n Support: Extended"
  2418. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
  2419. type: string
  2420. type: object
  2421. x-kubernetes-validations:
  2422. - message: backendRequest timeout cannot be longer than request timeout
  2423. rule: '!(has(self.request) && has(self.backendRequest) && duration(self.request) != duration(''0s'') && duration(self.backendRequest) > duration(self.request))'
  2424. type: object
  2425. x-kubernetes-validations:
  2426. - message: RequestRedirect filter must not be used together with backendRefs
  2427. rule: '(has(self.backendRefs) && size(self.backendRefs) > 0) ? (!has(self.filters) || self.filters.all(f, !has(f.requestRedirect))): true'
  2428. - message: When using RequestRedirect filter with path.replacePrefixMatch, exactly one PathPrefix match must be specified
  2429. rule: '(has(self.filters) && self.filters.exists_one(f, has(f.requestRedirect) && has(f.requestRedirect.path) && f.requestRedirect.path.type == ''ReplacePrefixMatch'' && has(f.requestRedirect.path.replacePrefixMatch))) ? ((size(self.matches) != 1 || !has(self.matches[0].path) || self.matches[0].path.type != ''PathPrefix'') ? false : true) : true'
  2430. - message: When using URLRewrite filter with path.replacePrefixMatch, exactly one PathPrefix match must be specified
  2431. rule: '(has(self.filters) && self.filters.exists_one(f, has(f.urlRewrite) && has(f.urlRewrite.path) && f.urlRewrite.path.type == ''ReplacePrefixMatch'' && has(f.urlRewrite.path.replacePrefixMatch))) ? ((size(self.matches) != 1 || !has(self.matches[0].path) || self.matches[0].path.type != ''PathPrefix'') ? false : true) : true'
  2432. - message: Within backendRefs, when using RequestRedirect filter with path.replacePrefixMatch, exactly one PathPrefix match must be specified
  2433. rule: '(has(self.backendRefs) && self.backendRefs.exists_one(b, (has(b.filters) && b.filters.exists_one(f, has(f.requestRedirect) && has(f.requestRedirect.path) && f.requestRedirect.path.type == ''ReplacePrefixMatch'' && has(f.requestRedirect.path.replacePrefixMatch))) )) ? ((size(self.matches) != 1 || !has(self.matches[0].path) || self.matches[0].path.type != ''PathPrefix'') ? false : true) : true'
  2434. - message: Within backendRefs, When using URLRewrite filter with path.replacePrefixMatch, exactly one PathPrefix match must be specified
  2435. rule: '(has(self.backendRefs) && self.backendRefs.exists_one(b, (has(b.filters) && b.filters.exists_one(f, has(f.urlRewrite) && has(f.urlRewrite.path) && f.urlRewrite.path.type == ''ReplacePrefixMatch'' && has(f.urlRewrite.path.replacePrefixMatch))) )) ? ((size(self.matches) != 1 || !has(self.matches[0].path) || self.matches[0].path.type != ''PathPrefix'') ? false : true) : true'
  2436. maxItems: 16
  2437. type: array
  2438. type: object
  2439. status:
  2440. description: Status defines the current state of HTTPRoute.
  2441. properties:
  2442. parents:
  2443. description: "Parents is a list of parent resources (usually Gateways) that are associated with the route, and the status of the route with respect to each parent. When this route attaches to a parent, the controller that manages the parent must add an entry to this list when the controller first sees the route and should update the entry as appropriate when the route or gateway is modified. \n Note that parent references that cannot be resolved by an implementation of this API will not be added to this list. Implementations of this API can only populate Route status for the Gateways/parent resources they are responsible for. \n A maximum of 32 Gateways will be represented in this list. An empty list means the route has not been attached to any Gateway."
  2444. items:
  2445. description: RouteParentStatus describes the status of a route with respect to an associated Parent.
  2446. properties:
  2447. conditions:
  2448. description: "Conditions describes the status of the route with respect to the Gateway. Note that the route's availability is also subject to the Gateway's own status conditions and listener status. \n If the Route's ParentRef specifies an existing Gateway that supports Routes of this kind AND that Gateway's controller has sufficient access, then that Gateway's controller MUST set the \"Accepted\" condition on the Route, to indicate whether the route has been accepted or rejected by the Gateway, and why. \n A Route MUST be considered \"Accepted\" if at least one of the Route's rules is implemented by the Gateway. \n There are a number of cases where the \"Accepted\" condition may not be set due to lack of controller visibility, that includes when: \n * The Route refers to a non-existent parent. * The Route is of a type that the controller does not support. * The Route is in a namespace the controller does not have access to."
  2449. items:
  2450. description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, \n type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
  2451. properties:
  2452. lastTransitionTime:
  2453. description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
  2454. format: date-time
  2455. type: string
  2456. message:
  2457. description: message is a human readable message indicating details about the transition. This may be an empty string.
  2458. maxLength: 32768
  2459. type: string
  2460. observedGeneration:
  2461. description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.
  2462. format: int64
  2463. minimum: 0
  2464. type: integer
  2465. reason:
  2466. description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.
  2467. maxLength: 1024
  2468. minLength: 1
  2469. pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
  2470. type: string
  2471. status:
  2472. description: status of the condition, one of True, False, Unknown.
  2473. enum:
  2474. - "True"
  2475. - "False"
  2476. - Unknown
  2477. type: string
  2478. type:
  2479. description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
  2480. maxLength: 316
  2481. pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
  2482. type: string
  2483. required:
  2484. - lastTransitionTime
  2485. - message
  2486. - reason
  2487. - status
  2488. - type
  2489. type: object
  2490. maxItems: 8
  2491. minItems: 1
  2492. type: array
  2493. x-kubernetes-list-map-keys:
  2494. - type
  2495. x-kubernetes-list-type: map
  2496. controllerName:
  2497. description: "ControllerName is a domain/path string that indicates the name of the controller that wrote this status. This corresponds with the controllerName field on GatewayClass. \n Example: \"example.net/gateway-controller\". \n The format of this field is DOMAIN \"/\" PATH, where DOMAIN and PATH are valid Kubernetes names (https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). \n Controllers MUST populate this field when writing status. Controllers should ensure that entries to status populated with their ControllerName are cleaned up when they are no longer necessary."
  2498. maxLength: 253
  2499. minLength: 1
  2500. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$
  2501. type: string
  2502. parentRef:
  2503. description: ParentRef corresponds with a ParentRef in the spec that this RouteParentStatus struct describes the status of.
  2504. properties:
  2505. group:
  2506. default: gateway.networking.k8s.io
  2507. description: "Group is the group of the referent. When unspecified, \"gateway.networking.k8s.io\" is inferred. To set the core API group (such as for a \"Service\" kind referent), Group must be explicitly set to \"\" (empty string). \n Support: Core"
  2508. maxLength: 253
  2509. pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  2510. type: string
  2511. kind:
  2512. default: Gateway
  2513. description: "Kind is kind of the referent. \n There are two kinds of parent resources with \"Core\" support: \n * Gateway (Gateway conformance profile) * Service (Mesh conformance profile, experimental, ClusterIP Services only) \n Support for other resources is Implementation-Specific."
  2514. maxLength: 63
  2515. minLength: 1
  2516. pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
  2517. type: string
  2518. name:
  2519. description: "Name is the name of the referent. \n Support: Core"
  2520. maxLength: 253
  2521. minLength: 1
  2522. type: string
  2523. namespace:
  2524. description: "Namespace is the namespace of the referent. When unspecified, this refers to the local namespace of the Route. \n Note that there are specific rules for ParentRefs which cross namespace boundaries. Cross-namespace references are only valid if they are explicitly allowed by something in the namespace they are referring to. For example: Gateway has the AllowedRoutes field, and ReferenceGrant provides a generic way to enable any other kind of cross-namespace reference. \n ParentRefs from a Route to a Service in the same namespace are \"producer\" routes, which apply default routing rules to inbound connections from any namespace to the Service. \n ParentRefs from a Route to a Service in a different namespace are \"consumer\" routes, and these routing rules are only applied to outbound connections originating from the same namespace as the Route, for which the intended destination of the connections are a Service targeted as a ParentRef of the Route. \n Support: Core"
  2525. maxLength: 63
  2526. minLength: 1
  2527. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
  2528. type: string
  2529. port:
  2530. description: "Port is the network port this Route targets. It can be interpreted differently based on the type of parent resource. \n When the parent resource is a Gateway, this targets all listeners listening on the specified port that also support this kind of Route(and select this Route). It's not recommended to set `Port` unless the networking behaviors specified in a Route must apply to a specific port as opposed to a listener(s) whose port(s) may be changed. When both Port and SectionName are specified, the name and port of the selected listener must match both specified values. \n When the parent resource is a Service, this targets a specific port in the Service spec. When both Port (experimental) and SectionName are specified, the name and port of the selected port must match both specified values. \n Implementations MAY choose to support other parent resources. Implementations supporting other types of parent resources MUST clearly document how/if Port is interpreted. \n For the purpose of status, an attachment is considered successful as long as the parent resource accepts it partially. For example, Gateway listeners can restrict which Routes can attach to them by Route kind, namespace, or hostname. If 1 of 2 Gateway listeners accept attachment from the referencing Route, the Route MUST be considered successfully attached. If no Gateway listeners accept attachment from this Route, the Route MUST be considered detached from the Gateway. \n Support: Extended \n "
  2531. format: int32
  2532. maximum: 65535
  2533. minimum: 1
  2534. type: integer
  2535. sectionName:
  2536. description: "SectionName is the name of a section within the target resource. In the following resources, SectionName is interpreted as the following: \n * Gateway: Listener Name. When both Port (experimental) and SectionName are specified, the name and port of the selected listener must match both specified values. * Service: Port Name. When both Port (experimental) and SectionName are specified, the name and port of the selected listener must match both specified values. Note that attaching Routes to Services as Parents is part of experimental Mesh support and is not supported for any other purpose. \n Implementations MAY choose to support attaching Routes to other resources. If that is the case, they MUST clearly document how SectionName is interpreted. \n When unspecified (empty string), this will reference the entire resource. For the purpose of status, an attachment is considered successful if at least one section in the parent resource accepts it. For example, Gateway listeners can restrict which Routes can attach to them by Route kind, namespace, or hostname. If 1 of 2 Gateway listeners accept attachment from the referencing Route, the Route MUST be considered successfully attached. If no Gateway listeners accept attachment from this Route, the Route MUST be considered detached from the Gateway. \n Support: Core"
  2537. maxLength: 253
  2538. minLength: 1
  2539. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  2540. type: string
  2541. required:
  2542. - name
  2543. type: object
  2544. required:
  2545. - controllerName
  2546. - parentRef
  2547. type: object
  2548. maxItems: 32
  2549. type: array
  2550. required:
  2551. - parents
  2552. type: object
  2553. required:
  2554. - spec
  2555. type: object
  2556. served: true
  2557. storage: false
  2558. subresources:
  2559. status: {}
  2560. - additionalPrinterColumns:
  2561. - jsonPath: .spec.hostnames
  2562. name: Hostnames
  2563. type: string
  2564. - jsonPath: .metadata.creationTimestamp
  2565. name: Age
  2566. type: date
  2567. name: v1beta1
  2568. schema:
  2569. openAPIV3Schema:
  2570. description: HTTPRoute provides a way to route HTTP requests. This includes the capability to match requests by hostname, path, header, or query param. Filters can be used to specify additional processing steps. Backends specify where matching requests should be routed.
  2571. properties:
  2572. apiVersion:
  2573. description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
  2574. type: string
  2575. kind:
  2576. description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
  2577. type: string
  2578. metadata:
  2579. type: object
  2580. spec:
  2581. description: Spec defines the desired state of HTTPRoute.
  2582. properties:
  2583. hostnames:
  2584. description: "Hostnames defines a set of hostnames that should match against the HTTP Host header to select a HTTPRoute used to process the request. Implementations MUST ignore any port value specified in the HTTP Host header while performing a match and (absent of any applicable header modification configuration) MUST forward this header unmodified to the backend. \n Valid values for Hostnames are determined by RFC 1123 definition of a hostname with 2 notable exceptions: \n 1. IPs are not allowed. 2. A hostname may be prefixed with a wildcard label (`*.`). The wildcard label must appear by itself as the first label. \n If a hostname is specified by both the Listener and HTTPRoute, there must be at least one intersecting hostname for the HTTPRoute to be attached to the Listener. For example: \n * A Listener with `test.example.com` as the hostname matches HTTPRoutes that have either not specified any hostnames, or have specified at least one of `test.example.com` or `*.example.com`. * A Listener with `*.example.com` as the hostname matches HTTPRoutes that have either not specified any hostnames or have specified at least one hostname that matches the Listener hostname. For example, `*.example.com`, `test.example.com`, and `foo.test.example.com` would all match. On the other hand, `example.com` and `test.example.net` would not match. \n Hostnames that are prefixed with a wildcard label (`*.`) are interpreted as a suffix match. That means that a match for `*.example.com` would match both `test.example.com`, and `foo.test.example.com`, but not `example.com`. \n If both the Listener and HTTPRoute have specified hostnames, any HTTPRoute hostnames that do not match the Listener hostname MUST be ignored. For example, if a Listener specified `*.example.com`, and the HTTPRoute specified `test.example.com` and `test.example.net`, `test.example.net` must not be considered for a match. \n If both the Listener and HTTPRoute have specified hostnames, and none match with the criteria above, then the HTTPRoute is not accepted. The implementation must raise an 'Accepted' Condition with a status of `False` in the corresponding RouteParentStatus. \n In the event that multiple HTTPRoutes specify intersecting hostnames (e.g. overlapping wildcard matching and exact matching hostnames), precedence must be given to rules from the HTTPRoute with the largest number of: \n * Characters in a matching non-wildcard hostname. * Characters in a matching hostname. \n If ties exist across multiple Routes, the matching precedence rules for HTTPRouteMatches takes over. \n Support: Core"
  2585. items:
  2586. description: "Hostname is the fully qualified domain name of a network host. This matches the RFC 1123 definition of a hostname with 2 notable exceptions: \n 1. IPs are not allowed. 2. A hostname may be prefixed with a wildcard label (`*.`). The wildcard label must appear by itself as the first label. \n Hostname can be \"precise\" which is a domain name without the terminating dot of a network host (e.g. \"foo.example.com\") or \"wildcard\", which is a domain name prefixed with a single wildcard label (e.g. `*.example.com`). \n Note that as per RFC1035 and RFC1123, a *label* must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character. No other punctuation is allowed."
  2587. maxLength: 253
  2588. minLength: 1
  2589. pattern: ^(\*\.)?[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  2590. type: string
  2591. maxItems: 16
  2592. type: array
  2593. parentRefs:
  2594. description: "ParentRefs references the resources (usually Gateways) that a Route wants to be attached to. Note that the referenced parent resource needs to allow this for the attachment to be complete. For Gateways, that means the Gateway needs to allow attachment from Routes of this kind and namespace. For Services, that means the Service must either be in the same namespace for a \"producer\" route, or the mesh implementation must support and allow \"consumer\" routes for the referenced Service. ReferenceGrant is not applicable for governing ParentRefs to Services - it is not possible to create a \"producer\" route for a Service in a different namespace from the Route. \n There are two kinds of parent resources with \"Core\" support: \n * Gateway (Gateway conformance profile) * Service (Mesh conformance profile, experimental, ClusterIP Services only) This API may be extended in the future to support additional kinds of parent resources. \n ParentRefs must be _distinct_. This means either that: \n * They select different objects. If this is the case, then parentRef entries are distinct. In terms of fields, this means that the multi-part key defined by `group`, `kind`, `namespace`, and `name` must be unique across all parentRef entries in the Route. * They do not select different objects, but for each optional field used, each ParentRef that selects the same object must set the same set of optional fields to different values. If one ParentRef sets a combination of optional fields, all must set the same combination. \n Some examples: \n * If one ParentRef sets `sectionName`, all ParentRefs referencing the same object must also set `sectionName`. * If one ParentRef sets `port`, all ParentRefs referencing the same object must also set `port`. * If one ParentRef sets `sectionName` and `port`, all ParentRefs referencing the same object must also set `sectionName` and `port`. \n It is possible to separately reference multiple distinct objects that may be collapsed by an implementation. For example, some implementations may choose to merge compatible Gateway Listeners together. If that is the case, the list of routes attached to those resources should also be merged. \n Note that for ParentRefs that cross namespace boundaries, there are specific rules. Cross-namespace references are only valid if they are explicitly allowed by something in the namespace they are referring to. For example, Gateway has the AllowedRoutes field, and ReferenceGrant provides a generic way to enable other kinds of cross-namespace reference. \n ParentRefs from a Route to a Service in the same namespace are \"producer\" routes, which apply default routing rules to inbound connections from any namespace to the Service. \n ParentRefs from a Route to a Service in a different namespace are \"consumer\" routes, and these routing rules are only applied to outbound connections originating from the same namespace as the Route, for which the intended destination of the connections are a Service targeted as a ParentRef of the Route. \n "
  2595. items:
  2596. description: "ParentReference identifies an API object (usually a Gateway) that can be considered a parent of this resource (usually a route). There are two kinds of parent resources with \"Core\" support: \n * Gateway (Gateway conformance profile) * Service (Mesh conformance profile, experimental, ClusterIP Services only) \n This API may be extended in the future to support additional kinds of parent resources. \n The API object must be valid in the cluster; the Group and Kind must be registered in the cluster for this reference to be valid."
  2597. properties:
  2598. group:
  2599. default: gateway.networking.k8s.io
  2600. description: "Group is the group of the referent. When unspecified, \"gateway.networking.k8s.io\" is inferred. To set the core API group (such as for a \"Service\" kind referent), Group must be explicitly set to \"\" (empty string). \n Support: Core"
  2601. maxLength: 253
  2602. pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  2603. type: string
  2604. kind:
  2605. default: Gateway
  2606. description: "Kind is kind of the referent. \n There are two kinds of parent resources with \"Core\" support: \n * Gateway (Gateway conformance profile) * Service (Mesh conformance profile, experimental, ClusterIP Services only) \n Support for other resources is Implementation-Specific."
  2607. maxLength: 63
  2608. minLength: 1
  2609. pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
  2610. type: string
  2611. name:
  2612. description: "Name is the name of the referent. \n Support: Core"
  2613. maxLength: 253
  2614. minLength: 1
  2615. type: string
  2616. namespace:
  2617. description: "Namespace is the namespace of the referent. When unspecified, this refers to the local namespace of the Route. \n Note that there are specific rules for ParentRefs which cross namespace boundaries. Cross-namespace references are only valid if they are explicitly allowed by something in the namespace they are referring to. For example: Gateway has the AllowedRoutes field, and ReferenceGrant provides a generic way to enable any other kind of cross-namespace reference. \n ParentRefs from a Route to a Service in the same namespace are \"producer\" routes, which apply default routing rules to inbound connections from any namespace to the Service. \n ParentRefs from a Route to a Service in a different namespace are \"consumer\" routes, and these routing rules are only applied to outbound connections originating from the same namespace as the Route, for which the intended destination of the connections are a Service targeted as a ParentRef of the Route. \n Support: Core"
  2618. maxLength: 63
  2619. minLength: 1
  2620. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
  2621. type: string
  2622. port:
  2623. description: "Port is the network port this Route targets. It can be interpreted differently based on the type of parent resource. \n When the parent resource is a Gateway, this targets all listeners listening on the specified port that also support this kind of Route(and select this Route). It's not recommended to set `Port` unless the networking behaviors specified in a Route must apply to a specific port as opposed to a listener(s) whose port(s) may be changed. When both Port and SectionName are specified, the name and port of the selected listener must match both specified values. \n When the parent resource is a Service, this targets a specific port in the Service spec. When both Port (experimental) and SectionName are specified, the name and port of the selected port must match both specified values. \n Implementations MAY choose to support other parent resources. Implementations supporting other types of parent resources MUST clearly document how/if Port is interpreted. \n For the purpose of status, an attachment is considered successful as long as the parent resource accepts it partially. For example, Gateway listeners can restrict which Routes can attach to them by Route kind, namespace, or hostname. If 1 of 2 Gateway listeners accept attachment from the referencing Route, the Route MUST be considered successfully attached. If no Gateway listeners accept attachment from this Route, the Route MUST be considered detached from the Gateway. \n Support: Extended \n "
  2624. format: int32
  2625. maximum: 65535
  2626. minimum: 1
  2627. type: integer
  2628. sectionName:
  2629. description: "SectionName is the name of a section within the target resource. In the following resources, SectionName is interpreted as the following: \n * Gateway: Listener Name. When both Port (experimental) and SectionName are specified, the name and port of the selected listener must match both specified values. * Service: Port Name. When both Port (experimental) and SectionName are specified, the name and port of the selected listener must match both specified values. Note that attaching Routes to Services as Parents is part of experimental Mesh support and is not supported for any other purpose. \n Implementations MAY choose to support attaching Routes to other resources. If that is the case, they MUST clearly document how SectionName is interpreted. \n When unspecified (empty string), this will reference the entire resource. For the purpose of status, an attachment is considered successful if at least one section in the parent resource accepts it. For example, Gateway listeners can restrict which Routes can attach to them by Route kind, namespace, or hostname. If 1 of 2 Gateway listeners accept attachment from the referencing Route, the Route MUST be considered successfully attached. If no Gateway listeners accept attachment from this Route, the Route MUST be considered detached from the Gateway. \n Support: Core"
  2630. maxLength: 253
  2631. minLength: 1
  2632. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  2633. type: string
  2634. required:
  2635. - name
  2636. type: object
  2637. maxItems: 32
  2638. type: array
  2639. x-kubernetes-validations:
  2640. - message: sectionName or port must be specified when parentRefs includes 2 or more references to the same parent
  2641. rule: 'self.all(p1, self.all(p2, p1.group == p2.group && p1.kind == p2.kind && p1.name == p2.name && (((!has(p1.__namespace__) || p1.__namespace__ == '''') && (!has(p2.__namespace__) || p2.__namespace__ == '''')) || (has(p1.__namespace__) && has(p2.__namespace__) && p1.__namespace__ == p2.__namespace__)) ? ((!has(p1.sectionName) || p1.sectionName == '''') == (!has(p2.sectionName) || p2.sectionName == '''') && (!has(p1.port) || p1.port == 0) == (!has(p2.port) || p2.port == 0)): true))'
  2642. - message: sectionName or port must be unique when parentRefs includes 2 or more references to the same parent
  2643. rule: self.all(p1, self.exists_one(p2, p1.group == p2.group && p1.kind == p2.kind && p1.name == p2.name && (((!has(p1.__namespace__) || p1.__namespace__ == '') && (!has(p2.__namespace__) || p2.__namespace__ == '')) || (has(p1.__namespace__) && has(p2.__namespace__) && p1.__namespace__ == p2.__namespace__ )) && (((!has(p1.sectionName) || p1.sectionName == '') && (!has(p2.sectionName) || p2.sectionName == '')) || ( has(p1.sectionName) && has(p2.sectionName) && p1.sectionName == p2.sectionName)) && (((!has(p1.port) || p1.port == 0) && (!has(p2.port) || p2.port == 0)) || (has(p1.port) && has(p2.port) && p1.port == p2.port))))
  2644. rules:
  2645. default:
  2646. - matches:
  2647. - path:
  2648. type: PathPrefix
  2649. value: /
  2650. description: Rules are a list of HTTP matchers, filters and actions.
  2651. items:
  2652. description: HTTPRouteRule defines semantics for matching an HTTP request based on conditions (matches), processing it (filters), and forwarding the request to an API object (backendRefs).
  2653. properties:
  2654. backendRefs:
  2655. description: "BackendRefs defines the backend(s) where matching requests should be sent. \n Failure behavior here depends on how many BackendRefs are specified and how many are invalid. \n If *all* entries in BackendRefs are invalid, and there are also no filters specified in this route rule, *all* traffic which matches this rule MUST receive a 500 status code. \n See the HTTPBackendRef definition for the rules about what makes a single HTTPBackendRef invalid. \n When a HTTPBackendRef is invalid, 500 status codes MUST be returned for requests that would have otherwise been routed to an invalid backend. If multiple backends are specified, and some are invalid, the proportion of requests that would otherwise have been routed to an invalid backend MUST receive a 500 status code. \n For example, if two backends are specified with equal weights, and one is invalid, 50 percent of traffic must receive a 500. Implementations may choose how that 50 percent is determined. \n Support: Core for Kubernetes Service \n Support: Extended for Kubernetes ServiceImport \n Support: Implementation-specific for any other resource \n Support for weight: Core"
  2656. items:
  2657. description: "HTTPBackendRef defines how a HTTPRoute forwards a HTTP request. \n Note that when a namespace different than the local namespace is specified, a ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. \n <gateway:experimental:description> \n When the BackendRef points to a Kubernetes Service, implementations SHOULD honor the appProtocol field if it is set for the target Service Port. \n Implementations supporting appProtocol SHOULD recognize the Kubernetes Standard Application Protocols defined in KEP-3726. \n If a Service appProtocol isn't specified, an implementation MAY infer the backend protocol through its own means. Implementations MAY infer the protocol from the Route type referring to the backend Service. \n If a Route is not able to send traffic to the backend using the specified protocol then the backend is considered invalid. Implementations MUST set the \"ResolvedRefs\" condition to \"False\" with the \"UnsupportedProtocol\" reason. \n </gateway:experimental:description>"
  2658. properties:
  2659. filters:
  2660. description: "Filters defined at this level should be executed if and only if the request is being forwarded to the backend defined here. \n Support: Implementation-specific (For broader support of filters, use the Filters field in HTTPRouteRule.)"
  2661. items:
  2662. description: HTTPRouteFilter defines processing steps that must be completed during the request or response lifecycle. HTTPRouteFilters are meant as an extension point to express processing that may be done in Gateway implementations. Some examples include request or response modification, implementing authentication strategies, rate-limiting, and traffic shaping. API guarantee/conformance is defined based on the type of the filter.
  2663. properties:
  2664. extensionRef:
  2665. description: "ExtensionRef is an optional, implementation-specific extension to the \"filter\" behavior. For example, resource \"myroutefilter\" in group \"networking.example.net\"). ExtensionRef MUST NOT be used for core and extended filters. \n This filter can be used multiple times within the same rule. \n Support: Implementation-specific"
  2666. properties:
  2667. group:
  2668. description: Group is the group of the referent. For example, "gateway.networking.k8s.io". When unspecified or empty string, core API group is inferred.
  2669. maxLength: 253
  2670. pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  2671. type: string
  2672. kind:
  2673. description: Kind is kind of the referent. For example "HTTPRoute" or "Service".
  2674. maxLength: 63
  2675. minLength: 1
  2676. pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
  2677. type: string
  2678. name:
  2679. description: Name is the name of the referent.
  2680. maxLength: 253
  2681. minLength: 1
  2682. type: string
  2683. required:
  2684. - group
  2685. - kind
  2686. - name
  2687. type: object
  2688. requestHeaderModifier:
  2689. description: "RequestHeaderModifier defines a schema for a filter that modifies request headers. \n Support: Core"
  2690. properties:
  2691. add:
  2692. description: "Add adds the given header(s) (name, value) to the request before the action. It appends to any existing values associated with the header name. \n Input: GET /foo HTTP/1.1 my-header: foo \n Config: add: - name: \"my-header\" value: \"bar,baz\" \n Output: GET /foo HTTP/1.1 my-header: foo,bar,baz"
  2693. items:
  2694. description: HTTPHeader represents an HTTP Header name and value as defined by RFC 7230.
  2695. properties:
  2696. name:
  2697. description: "Name is the name of the HTTP Header to be matched. Name matching MUST be case insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2). \n If multiple entries specify equivalent header names, the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent header name MUST be ignored. Due to the case-insensitivity of header names, \"foo\" and \"Foo\" are considered equivalent."
  2698. maxLength: 256
  2699. minLength: 1
  2700. pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
  2701. type: string
  2702. value:
  2703. description: Value is the value of HTTP Header to be matched.
  2704. maxLength: 4096
  2705. minLength: 1
  2706. type: string
  2707. required:
  2708. - name
  2709. - value
  2710. type: object
  2711. maxItems: 16
  2712. type: array
  2713. x-kubernetes-list-map-keys:
  2714. - name
  2715. x-kubernetes-list-type: map
  2716. remove:
  2717. description: "Remove the given header(s) from the HTTP request before the action. The value of Remove is a list of HTTP header names. Note that the header names are case-insensitive (see https://datatracker.ietf.org/doc/html/rfc2616#section-4.2). \n Input: GET /foo HTTP/1.1 my-header1: foo my-header2: bar my-header3: baz \n Config: remove: [\"my-header1\", \"my-header3\"] \n Output: GET /foo HTTP/1.1 my-header2: bar"
  2718. items:
  2719. type: string
  2720. maxItems: 16
  2721. type: array
  2722. x-kubernetes-list-type: set
  2723. set:
  2724. description: "Set overwrites the request with the given header (name, value) before the action. \n Input: GET /foo HTTP/1.1 my-header: foo \n Config: set: - name: \"my-header\" value: \"bar\" \n Output: GET /foo HTTP/1.1 my-header: bar"
  2725. items:
  2726. description: HTTPHeader represents an HTTP Header name and value as defined by RFC 7230.
  2727. properties:
  2728. name:
  2729. description: "Name is the name of the HTTP Header to be matched. Name matching MUST be case insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2). \n If multiple entries specify equivalent header names, the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent header name MUST be ignored. Due to the case-insensitivity of header names, \"foo\" and \"Foo\" are considered equivalent."
  2730. maxLength: 256
  2731. minLength: 1
  2732. pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
  2733. type: string
  2734. value:
  2735. description: Value is the value of HTTP Header to be matched.
  2736. maxLength: 4096
  2737. minLength: 1
  2738. type: string
  2739. required:
  2740. - name
  2741. - value
  2742. type: object
  2743. maxItems: 16
  2744. type: array
  2745. x-kubernetes-list-map-keys:
  2746. - name
  2747. x-kubernetes-list-type: map
  2748. type: object
  2749. requestMirror:
  2750. description: "RequestMirror defines a schema for a filter that mirrors requests. Requests are sent to the specified destination, but responses from that destination are ignored. \n This filter can be used multiple times within the same rule. Note that not all implementations will be able to support mirroring to multiple backends. \n Support: Extended"
  2751. properties:
  2752. backendRef:
  2753. description: "BackendRef references a resource where mirrored requests are sent. \n Mirrored requests must be sent only to a single destination endpoint within this BackendRef, irrespective of how many endpoints are present within this BackendRef. \n If the referent cannot be found, this BackendRef is invalid and must be dropped from the Gateway. The controller must ensure the \"ResolvedRefs\" condition on the Route status is set to `status: False` and not configure this backend in the underlying implementation. \n If there is a cross-namespace reference to an *existing* object that is not allowed by a ReferenceGrant, the controller must ensure the \"ResolvedRefs\" condition on the Route is set to `status: False`, with the \"RefNotPermitted\" reason and not configure this backend in the underlying implementation. \n In either error case, the Message of the `ResolvedRefs` Condition should be used to provide more detail about the problem. \n Support: Extended for Kubernetes Service \n Support: Implementation-specific for any other resource"
  2754. properties:
  2755. group:
  2756. default: ""
  2757. description: Group is the group of the referent. For example, "gateway.networking.k8s.io". When unspecified or empty string, core API group is inferred.
  2758. maxLength: 253
  2759. pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  2760. type: string
  2761. kind:
  2762. default: Service
  2763. description: "Kind is the Kubernetes resource kind of the referent. For example \"Service\". \n Defaults to \"Service\" when not specified. \n ExternalName services can refer to CNAME DNS records that may live outside of the cluster and as such are difficult to reason about in terms of conformance. They also may not be safe to forward to (see CVE-2021-25740 for more information). Implementations SHOULD NOT support ExternalName Services. \n Support: Core (Services with a type other than ExternalName) \n Support: Implementation-specific (Services with type ExternalName)"
  2764. maxLength: 63
  2765. minLength: 1
  2766. pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
  2767. type: string
  2768. name:
  2769. description: Name is the name of the referent.
  2770. maxLength: 253
  2771. minLength: 1
  2772. type: string
  2773. namespace:
  2774. description: "Namespace is the namespace of the backend. When unspecified, the local namespace is inferred. \n Note that when a namespace different than the local namespace is specified, a ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. \n Support: Core"
  2775. maxLength: 63
  2776. minLength: 1
  2777. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
  2778. type: string
  2779. port:
  2780. description: Port specifies the destination port number to use for this resource. Port is required when the referent is a Kubernetes Service. In this case, the port number is the service port number, not the target port. For other resources, destination port might be derived from the referent resource or this field.
  2781. format: int32
  2782. maximum: 65535
  2783. minimum: 1
  2784. type: integer
  2785. required:
  2786. - name
  2787. type: object
  2788. x-kubernetes-validations:
  2789. - message: Must have port for Service reference
  2790. rule: '(size(self.group) == 0 && self.kind == ''Service'') ? has(self.port) : true'
  2791. required:
  2792. - backendRef
  2793. type: object
  2794. requestRedirect:
  2795. description: "RequestRedirect defines a schema for a filter that responds to the request with an HTTP redirection. \n Support: Core"
  2796. properties:
  2797. hostname:
  2798. description: "Hostname is the hostname to be used in the value of the `Location` header in the response. When empty, the hostname in the `Host` header of the request is used. \n Support: Core"
  2799. maxLength: 253
  2800. minLength: 1
  2801. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  2802. type: string
  2803. path:
  2804. description: "Path defines parameters used to modify the path of the incoming request. The modified path is then used to construct the `Location` header. When empty, the request path is used as-is. \n Support: Extended"
  2805. properties:
  2806. replaceFullPath:
  2807. description: ReplaceFullPath specifies the value with which to replace the full path of a request during a rewrite or redirect.
  2808. maxLength: 1024
  2809. type: string
  2810. replacePrefixMatch:
  2811. description: "ReplacePrefixMatch specifies the value with which to replace the prefix match of a request during a rewrite or redirect. For example, a request to \"/foo/bar\" with a prefix match of \"/foo\" and a ReplacePrefixMatch of \"/xyz\" would be modified to \"/xyz/bar\". \n Note that this matches the behavior of the PathPrefix match type. This matches full path elements. A path element refers to the list of labels in the path split by the `/` separator. When specified, a trailing `/` is ignored. For example, the paths `/abc`, `/abc/`, and `/abc/def` would all match the prefix `/abc`, but the path `/abcd` would not. \n ReplacePrefixMatch is only compatible with a `PathPrefix` HTTPRouteMatch. Using any other HTTPRouteMatch type on the same HTTPRouteRule will result in the implementation setting the Accepted Condition for the Route to `status: False`. \n Request Path | Prefix Match | Replace Prefix | Modified Path -------------|--------------|----------------|---------- /foo/bar | /foo | /xyz | /xyz/bar /foo/bar | /foo | /xyz/ | /xyz/bar /foo/bar | /foo/ | /xyz | /xyz/bar /foo/bar | /foo/ | /xyz/ | /xyz/bar /foo | /foo | /xyz | /xyz /foo/ | /foo | /xyz | /xyz/ /foo/bar | /foo | <empty string> | /bar /foo/ | /foo | <empty string> | / /foo | /foo | <empty string> | / /foo/ | /foo | / | / /foo | /foo | / | /"
  2812. maxLength: 1024
  2813. type: string
  2814. type:
  2815. description: "Type defines the type of path modifier. Additional types may be added in a future release of the API. \n Note that values may be added to this enum, implementations must ensure that unknown values will not cause a crash. \n Unknown values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason of `UnsupportedValue`."
  2816. enum:
  2817. - ReplaceFullPath
  2818. - ReplacePrefixMatch
  2819. type: string
  2820. required:
  2821. - type
  2822. type: object
  2823. x-kubernetes-validations:
  2824. - message: replaceFullPath must be specified when type is set to 'ReplaceFullPath'
  2825. rule: 'self.type == ''ReplaceFullPath'' ? has(self.replaceFullPath) : true'
  2826. - message: type must be 'ReplaceFullPath' when replaceFullPath is set
  2827. rule: 'has(self.replaceFullPath) ? self.type == ''ReplaceFullPath'' : true'
  2828. - message: replacePrefixMatch must be specified when type is set to 'ReplacePrefixMatch'
  2829. rule: 'self.type == ''ReplacePrefixMatch'' ? has(self.replacePrefixMatch) : true'
  2830. - message: type must be 'ReplacePrefixMatch' when replacePrefixMatch is set
  2831. rule: 'has(self.replacePrefixMatch) ? self.type == ''ReplacePrefixMatch'' : true'
  2832. port:
  2833. description: "Port is the port to be used in the value of the `Location` header in the response. \n If no port is specified, the redirect port MUST be derived using the following rules: \n * If redirect scheme is not-empty, the redirect port MUST be the well-known port associated with the redirect scheme. Specifically \"http\" to port 80 and \"https\" to port 443. If the redirect scheme does not have a well-known port, the listener port of the Gateway SHOULD be used. * If redirect scheme is empty, the redirect port MUST be the Gateway Listener port. \n Implementations SHOULD NOT add the port number in the 'Location' header in the following cases: \n * A Location header that will use HTTP (whether that is determined via the Listener protocol or the Scheme field) _and_ use port 80. * A Location header that will use HTTPS (whether that is determined via the Listener protocol or the Scheme field) _and_ use port 443. \n Support: Extended"
  2834. format: int32
  2835. maximum: 65535
  2836. minimum: 1
  2837. type: integer
  2838. scheme:
  2839. description: "Scheme is the scheme to be used in the value of the `Location` header in the response. When empty, the scheme of the request is used. \n Scheme redirects can affect the port of the redirect, for more information, refer to the documentation for the port field of this filter. \n Note that values may be added to this enum, implementations must ensure that unknown values will not cause a crash. \n Unknown values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason of `UnsupportedValue`. \n Support: Extended"
  2840. enum:
  2841. - http
  2842. - https
  2843. type: string
  2844. statusCode:
  2845. default: 302
  2846. description: "StatusCode is the HTTP status code to be used in response. \n Note that values may be added to this enum, implementations must ensure that unknown values will not cause a crash. \n Unknown values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason of `UnsupportedValue`. \n Support: Core"
  2847. enum:
  2848. - 301
  2849. - 302
  2850. type: integer
  2851. type: object
  2852. responseHeaderModifier:
  2853. description: "ResponseHeaderModifier defines a schema for a filter that modifies response headers. \n Support: Extended"
  2854. properties:
  2855. add:
  2856. description: "Add adds the given header(s) (name, value) to the request before the action. It appends to any existing values associated with the header name. \n Input: GET /foo HTTP/1.1 my-header: foo \n Config: add: - name: \"my-header\" value: \"bar,baz\" \n Output: GET /foo HTTP/1.1 my-header: foo,bar,baz"
  2857. items:
  2858. description: HTTPHeader represents an HTTP Header name and value as defined by RFC 7230.
  2859. properties:
  2860. name:
  2861. description: "Name is the name of the HTTP Header to be matched. Name matching MUST be case insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2). \n If multiple entries specify equivalent header names, the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent header name MUST be ignored. Due to the case-insensitivity of header names, \"foo\" and \"Foo\" are considered equivalent."
  2862. maxLength: 256
  2863. minLength: 1
  2864. pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
  2865. type: string
  2866. value:
  2867. description: Value is the value of HTTP Header to be matched.
  2868. maxLength: 4096
  2869. minLength: 1
  2870. type: string
  2871. required:
  2872. - name
  2873. - value
  2874. type: object
  2875. maxItems: 16
  2876. type: array
  2877. x-kubernetes-list-map-keys:
  2878. - name
  2879. x-kubernetes-list-type: map
  2880. remove:
  2881. description: "Remove the given header(s) from the HTTP request before the action. The value of Remove is a list of HTTP header names. Note that the header names are case-insensitive (see https://datatracker.ietf.org/doc/html/rfc2616#section-4.2). \n Input: GET /foo HTTP/1.1 my-header1: foo my-header2: bar my-header3: baz \n Config: remove: [\"my-header1\", \"my-header3\"] \n Output: GET /foo HTTP/1.1 my-header2: bar"
  2882. items:
  2883. type: string
  2884. maxItems: 16
  2885. type: array
  2886. x-kubernetes-list-type: set
  2887. set:
  2888. description: "Set overwrites the request with the given header (name, value) before the action. \n Input: GET /foo HTTP/1.1 my-header: foo \n Config: set: - name: \"my-header\" value: \"bar\" \n Output: GET /foo HTTP/1.1 my-header: bar"
  2889. items:
  2890. description: HTTPHeader represents an HTTP Header name and value as defined by RFC 7230.
  2891. properties:
  2892. name:
  2893. description: "Name is the name of the HTTP Header to be matched. Name matching MUST be case insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2). \n If multiple entries specify equivalent header names, the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent header name MUST be ignored. Due to the case-insensitivity of header names, \"foo\" and \"Foo\" are considered equivalent."
  2894. maxLength: 256
  2895. minLength: 1
  2896. pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
  2897. type: string
  2898. value:
  2899. description: Value is the value of HTTP Header to be matched.
  2900. maxLength: 4096
  2901. minLength: 1
  2902. type: string
  2903. required:
  2904. - name
  2905. - value
  2906. type: object
  2907. maxItems: 16
  2908. type: array
  2909. x-kubernetes-list-map-keys:
  2910. - name
  2911. x-kubernetes-list-type: map
  2912. type: object
  2913. type:
  2914. description: "Type identifies the type of filter to apply. As with other API fields, types are classified into three conformance levels: \n - Core: Filter types and their corresponding configuration defined by \"Support: Core\" in this package, e.g. \"RequestHeaderModifier\". All implementations must support core filters. \n - Extended: Filter types and their corresponding configuration defined by \"Support: Extended\" in this package, e.g. \"RequestMirror\". Implementers are encouraged to support extended filters. \n - Implementation-specific: Filters that are defined and supported by specific vendors. In the future, filters showing convergence in behavior across multiple implementations will be considered for inclusion in extended or core conformance levels. Filter-specific configuration for such filters is specified using the ExtensionRef field. `Type` should be set to \"ExtensionRef\" for custom filters. \n Implementers are encouraged to define custom implementation types to extend the core API with implementation-specific behavior. \n If a reference to a custom filter type cannot be resolved, the filter MUST NOT be skipped. Instead, requests that would have been processed by that filter MUST receive a HTTP error response. \n Note that values may be added to this enum, implementations must ensure that unknown values will not cause a crash. \n Unknown values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason of `UnsupportedValue`."
  2915. enum:
  2916. - RequestHeaderModifier
  2917. - ResponseHeaderModifier
  2918. - RequestMirror
  2919. - RequestRedirect
  2920. - URLRewrite
  2921. - ExtensionRef
  2922. type: string
  2923. urlRewrite:
  2924. description: "URLRewrite defines a schema for a filter that modifies a request during forwarding. \n Support: Extended"
  2925. properties:
  2926. hostname:
  2927. description: "Hostname is the value to be used to replace the Host header value during forwarding. \n Support: Extended"
  2928. maxLength: 253
  2929. minLength: 1
  2930. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  2931. type: string
  2932. path:
  2933. description: "Path defines a path rewrite. \n Support: Extended"
  2934. properties:
  2935. replaceFullPath:
  2936. description: ReplaceFullPath specifies the value with which to replace the full path of a request during a rewrite or redirect.
  2937. maxLength: 1024
  2938. type: string
  2939. replacePrefixMatch:
  2940. description: "ReplacePrefixMatch specifies the value with which to replace the prefix match of a request during a rewrite or redirect. For example, a request to \"/foo/bar\" with a prefix match of \"/foo\" and a ReplacePrefixMatch of \"/xyz\" would be modified to \"/xyz/bar\". \n Note that this matches the behavior of the PathPrefix match type. This matches full path elements. A path element refers to the list of labels in the path split by the `/` separator. When specified, a trailing `/` is ignored. For example, the paths `/abc`, `/abc/`, and `/abc/def` would all match the prefix `/abc`, but the path `/abcd` would not. \n ReplacePrefixMatch is only compatible with a `PathPrefix` HTTPRouteMatch. Using any other HTTPRouteMatch type on the same HTTPRouteRule will result in the implementation setting the Accepted Condition for the Route to `status: False`. \n Request Path | Prefix Match | Replace Prefix | Modified Path -------------|--------------|----------------|---------- /foo/bar | /foo | /xyz | /xyz/bar /foo/bar | /foo | /xyz/ | /xyz/bar /foo/bar | /foo/ | /xyz | /xyz/bar /foo/bar | /foo/ | /xyz/ | /xyz/bar /foo | /foo | /xyz | /xyz /foo/ | /foo | /xyz | /xyz/ /foo/bar | /foo | <empty string> | /bar /foo/ | /foo | <empty string> | / /foo | /foo | <empty string> | / /foo/ | /foo | / | / /foo | /foo | / | /"
  2941. maxLength: 1024
  2942. type: string
  2943. type:
  2944. description: "Type defines the type of path modifier. Additional types may be added in a future release of the API. \n Note that values may be added to this enum, implementations must ensure that unknown values will not cause a crash. \n Unknown values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason of `UnsupportedValue`."
  2945. enum:
  2946. - ReplaceFullPath
  2947. - ReplacePrefixMatch
  2948. type: string
  2949. required:
  2950. - type
  2951. type: object
  2952. x-kubernetes-validations:
  2953. - message: replaceFullPath must be specified when type is set to 'ReplaceFullPath'
  2954. rule: 'self.type == ''ReplaceFullPath'' ? has(self.replaceFullPath) : true'
  2955. - message: type must be 'ReplaceFullPath' when replaceFullPath is set
  2956. rule: 'has(self.replaceFullPath) ? self.type == ''ReplaceFullPath'' : true'
  2957. - message: replacePrefixMatch must be specified when type is set to 'ReplacePrefixMatch'
  2958. rule: 'self.type == ''ReplacePrefixMatch'' ? has(self.replacePrefixMatch) : true'
  2959. - message: type must be 'ReplacePrefixMatch' when replacePrefixMatch is set
  2960. rule: 'has(self.replacePrefixMatch) ? self.type == ''ReplacePrefixMatch'' : true'
  2961. type: object
  2962. required:
  2963. - type
  2964. type: object
  2965. x-kubernetes-validations:
  2966. - message: filter.requestHeaderModifier must be nil if the filter.type is not RequestHeaderModifier
  2967. rule: '!(has(self.requestHeaderModifier) && self.type != ''RequestHeaderModifier'')'
  2968. - message: filter.requestHeaderModifier must be specified for RequestHeaderModifier filter.type
  2969. rule: '!(!has(self.requestHeaderModifier) && self.type == ''RequestHeaderModifier'')'
  2970. - message: filter.responseHeaderModifier must be nil if the filter.type is not ResponseHeaderModifier
  2971. rule: '!(has(self.responseHeaderModifier) && self.type != ''ResponseHeaderModifier'')'
  2972. - message: filter.responseHeaderModifier must be specified for ResponseHeaderModifier filter.type
  2973. rule: '!(!has(self.responseHeaderModifier) && self.type == ''ResponseHeaderModifier'')'
  2974. - message: filter.requestMirror must be nil if the filter.type is not RequestMirror
  2975. rule: '!(has(self.requestMirror) && self.type != ''RequestMirror'')'
  2976. - message: filter.requestMirror must be specified for RequestMirror filter.type
  2977. rule: '!(!has(self.requestMirror) && self.type == ''RequestMirror'')'
  2978. - message: filter.requestRedirect must be nil if the filter.type is not RequestRedirect
  2979. rule: '!(has(self.requestRedirect) && self.type != ''RequestRedirect'')'
  2980. - message: filter.requestRedirect must be specified for RequestRedirect filter.type
  2981. rule: '!(!has(self.requestRedirect) && self.type == ''RequestRedirect'')'
  2982. - message: filter.urlRewrite must be nil if the filter.type is not URLRewrite
  2983. rule: '!(has(self.urlRewrite) && self.type != ''URLRewrite'')'
  2984. - message: filter.urlRewrite must be specified for URLRewrite filter.type
  2985. rule: '!(!has(self.urlRewrite) && self.type == ''URLRewrite'')'
  2986. - message: filter.extensionRef must be nil if the filter.type is not ExtensionRef
  2987. rule: '!(has(self.extensionRef) && self.type != ''ExtensionRef'')'
  2988. - message: filter.extensionRef must be specified for ExtensionRef filter.type
  2989. rule: '!(!has(self.extensionRef) && self.type == ''ExtensionRef'')'
  2990. maxItems: 16
  2991. type: array
  2992. x-kubernetes-validations:
  2993. - message: May specify either httpRouteFilterRequestRedirect or httpRouteFilterRequestRewrite, but not both
  2994. rule: '!(self.exists(f, f.type == ''RequestRedirect'') && self.exists(f, f.type == ''URLRewrite''))'
  2995. - message: May specify either httpRouteFilterRequestRedirect or httpRouteFilterRequestRewrite, but not both
  2996. rule: '!(self.exists(f, f.type == ''RequestRedirect'') && self.exists(f, f.type == ''URLRewrite''))'
  2997. - message: RequestHeaderModifier filter cannot be repeated
  2998. rule: self.filter(f, f.type == 'RequestHeaderModifier').size() <= 1
  2999. - message: ResponseHeaderModifier filter cannot be repeated
  3000. rule: self.filter(f, f.type == 'ResponseHeaderModifier').size() <= 1
  3001. - message: RequestRedirect filter cannot be repeated
  3002. rule: self.filter(f, f.type == 'RequestRedirect').size() <= 1
  3003. - message: URLRewrite filter cannot be repeated
  3004. rule: self.filter(f, f.type == 'URLRewrite').size() <= 1
  3005. group:
  3006. default: ""
  3007. description: Group is the group of the referent. For example, "gateway.networking.k8s.io". When unspecified or empty string, core API group is inferred.
  3008. maxLength: 253
  3009. pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  3010. type: string
  3011. kind:
  3012. default: Service
  3013. description: "Kind is the Kubernetes resource kind of the referent. For example \"Service\". \n Defaults to \"Service\" when not specified. \n ExternalName services can refer to CNAME DNS records that may live outside of the cluster and as such are difficult to reason about in terms of conformance. They also may not be safe to forward to (see CVE-2021-25740 for more information). Implementations SHOULD NOT support ExternalName Services. \n Support: Core (Services with a type other than ExternalName) \n Support: Implementation-specific (Services with type ExternalName)"
  3014. maxLength: 63
  3015. minLength: 1
  3016. pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
  3017. type: string
  3018. name:
  3019. description: Name is the name of the referent.
  3020. maxLength: 253
  3021. minLength: 1
  3022. type: string
  3023. namespace:
  3024. description: "Namespace is the namespace of the backend. When unspecified, the local namespace is inferred. \n Note that when a namespace different than the local namespace is specified, a ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. \n Support: Core"
  3025. maxLength: 63
  3026. minLength: 1
  3027. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
  3028. type: string
  3029. port:
  3030. description: Port specifies the destination port number to use for this resource. Port is required when the referent is a Kubernetes Service. In this case, the port number is the service port number, not the target port. For other resources, destination port might be derived from the referent resource or this field.
  3031. format: int32
  3032. maximum: 65535
  3033. minimum: 1
  3034. type: integer
  3035. weight:
  3036. default: 1
  3037. description: "Weight specifies the proportion of requests forwarded to the referenced backend. This is computed as weight/(sum of all weights in this BackendRefs list). For non-zero values, there may be some epsilon from the exact proportion defined here depending on the precision an implementation supports. Weight is not a percentage and the sum of weights does not need to equal 100. \n If only one backend is specified and it has a weight greater than 0, 100% of the traffic is forwarded to that backend. If weight is set to 0, no traffic should be forwarded for this entry. If unspecified, weight defaults to 1. \n Support for this field varies based on the context where used."
  3038. format: int32
  3039. maximum: 1000000
  3040. minimum: 0
  3041. type: integer
  3042. required:
  3043. - name
  3044. type: object
  3045. x-kubernetes-validations:
  3046. - message: Must have port for Service reference
  3047. rule: '(size(self.group) == 0 && self.kind == ''Service'') ? has(self.port) : true'
  3048. maxItems: 16
  3049. type: array
  3050. filters:
  3051. description: "Filters define the filters that are applied to requests that match this rule. \n The effects of ordering of multiple behaviors are currently unspecified. This can change in the future based on feedback during the alpha stage. \n Conformance-levels at this level are defined based on the type of filter: \n - ALL core filters MUST be supported by all implementations. - Implementers are encouraged to support extended filters. - Implementation-specific custom filters have no API guarantees across implementations. \n Specifying the same filter multiple times is not supported unless explicitly indicated in the filter. \n All filters are expected to be compatible with each other except for the URLRewrite and RequestRedirect filters, which may not be combined. If an implementation can not support other combinations of filters, they must clearly document that limitation. In cases where incompatible or unsupported filters are specified and cause the `Accepted` condition to be set to status `False`, implementations may use the `IncompatibleFilters` reason to specify this configuration error. \n Support: Core"
  3052. items:
  3053. description: HTTPRouteFilter defines processing steps that must be completed during the request or response lifecycle. HTTPRouteFilters are meant as an extension point to express processing that may be done in Gateway implementations. Some examples include request or response modification, implementing authentication strategies, rate-limiting, and traffic shaping. API guarantee/conformance is defined based on the type of the filter.
  3054. properties:
  3055. extensionRef:
  3056. description: "ExtensionRef is an optional, implementation-specific extension to the \"filter\" behavior. For example, resource \"myroutefilter\" in group \"networking.example.net\"). ExtensionRef MUST NOT be used for core and extended filters. \n This filter can be used multiple times within the same rule. \n Support: Implementation-specific"
  3057. properties:
  3058. group:
  3059. description: Group is the group of the referent. For example, "gateway.networking.k8s.io". When unspecified or empty string, core API group is inferred.
  3060. maxLength: 253
  3061. pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  3062. type: string
  3063. kind:
  3064. description: Kind is kind of the referent. For example "HTTPRoute" or "Service".
  3065. maxLength: 63
  3066. minLength: 1
  3067. pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
  3068. type: string
  3069. name:
  3070. description: Name is the name of the referent.
  3071. maxLength: 253
  3072. minLength: 1
  3073. type: string
  3074. required:
  3075. - group
  3076. - kind
  3077. - name
  3078. type: object
  3079. requestHeaderModifier:
  3080. description: "RequestHeaderModifier defines a schema for a filter that modifies request headers. \n Support: Core"
  3081. properties:
  3082. add:
  3083. description: "Add adds the given header(s) (name, value) to the request before the action. It appends to any existing values associated with the header name. \n Input: GET /foo HTTP/1.1 my-header: foo \n Config: add: - name: \"my-header\" value: \"bar,baz\" \n Output: GET /foo HTTP/1.1 my-header: foo,bar,baz"
  3084. items:
  3085. description: HTTPHeader represents an HTTP Header name and value as defined by RFC 7230.
  3086. properties:
  3087. name:
  3088. description: "Name is the name of the HTTP Header to be matched. Name matching MUST be case insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2). \n If multiple entries specify equivalent header names, the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent header name MUST be ignored. Due to the case-insensitivity of header names, \"foo\" and \"Foo\" are considered equivalent."
  3089. maxLength: 256
  3090. minLength: 1
  3091. pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
  3092. type: string
  3093. value:
  3094. description: Value is the value of HTTP Header to be matched.
  3095. maxLength: 4096
  3096. minLength: 1
  3097. type: string
  3098. required:
  3099. - name
  3100. - value
  3101. type: object
  3102. maxItems: 16
  3103. type: array
  3104. x-kubernetes-list-map-keys:
  3105. - name
  3106. x-kubernetes-list-type: map
  3107. remove:
  3108. description: "Remove the given header(s) from the HTTP request before the action. The value of Remove is a list of HTTP header names. Note that the header names are case-insensitive (see https://datatracker.ietf.org/doc/html/rfc2616#section-4.2). \n Input: GET /foo HTTP/1.1 my-header1: foo my-header2: bar my-header3: baz \n Config: remove: [\"my-header1\", \"my-header3\"] \n Output: GET /foo HTTP/1.1 my-header2: bar"
  3109. items:
  3110. type: string
  3111. maxItems: 16
  3112. type: array
  3113. x-kubernetes-list-type: set
  3114. set:
  3115. description: "Set overwrites the request with the given header (name, value) before the action. \n Input: GET /foo HTTP/1.1 my-header: foo \n Config: set: - name: \"my-header\" value: \"bar\" \n Output: GET /foo HTTP/1.1 my-header: bar"
  3116. items:
  3117. description: HTTPHeader represents an HTTP Header name and value as defined by RFC 7230.
  3118. properties:
  3119. name:
  3120. description: "Name is the name of the HTTP Header to be matched. Name matching MUST be case insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2). \n If multiple entries specify equivalent header names, the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent header name MUST be ignored. Due to the case-insensitivity of header names, \"foo\" and \"Foo\" are considered equivalent."
  3121. maxLength: 256
  3122. minLength: 1
  3123. pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
  3124. type: string
  3125. value:
  3126. description: Value is the value of HTTP Header to be matched.
  3127. maxLength: 4096
  3128. minLength: 1
  3129. type: string
  3130. required:
  3131. - name
  3132. - value
  3133. type: object
  3134. maxItems: 16
  3135. type: array
  3136. x-kubernetes-list-map-keys:
  3137. - name
  3138. x-kubernetes-list-type: map
  3139. type: object
  3140. requestMirror:
  3141. description: "RequestMirror defines a schema for a filter that mirrors requests. Requests are sent to the specified destination, but responses from that destination are ignored. \n This filter can be used multiple times within the same rule. Note that not all implementations will be able to support mirroring to multiple backends. \n Support: Extended"
  3142. properties:
  3143. backendRef:
  3144. description: "BackendRef references a resource where mirrored requests are sent. \n Mirrored requests must be sent only to a single destination endpoint within this BackendRef, irrespective of how many endpoints are present within this BackendRef. \n If the referent cannot be found, this BackendRef is invalid and must be dropped from the Gateway. The controller must ensure the \"ResolvedRefs\" condition on the Route status is set to `status: False` and not configure this backend in the underlying implementation. \n If there is a cross-namespace reference to an *existing* object that is not allowed by a ReferenceGrant, the controller must ensure the \"ResolvedRefs\" condition on the Route is set to `status: False`, with the \"RefNotPermitted\" reason and not configure this backend in the underlying implementation. \n In either error case, the Message of the `ResolvedRefs` Condition should be used to provide more detail about the problem. \n Support: Extended for Kubernetes Service \n Support: Implementation-specific for any other resource"
  3145. properties:
  3146. group:
  3147. default: ""
  3148. description: Group is the group of the referent. For example, "gateway.networking.k8s.io". When unspecified or empty string, core API group is inferred.
  3149. maxLength: 253
  3150. pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  3151. type: string
  3152. kind:
  3153. default: Service
  3154. description: "Kind is the Kubernetes resource kind of the referent. For example \"Service\". \n Defaults to \"Service\" when not specified. \n ExternalName services can refer to CNAME DNS records that may live outside of the cluster and as such are difficult to reason about in terms of conformance. They also may not be safe to forward to (see CVE-2021-25740 for more information). Implementations SHOULD NOT support ExternalName Services. \n Support: Core (Services with a type other than ExternalName) \n Support: Implementation-specific (Services with type ExternalName)"
  3155. maxLength: 63
  3156. minLength: 1
  3157. pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
  3158. type: string
  3159. name:
  3160. description: Name is the name of the referent.
  3161. maxLength: 253
  3162. minLength: 1
  3163. type: string
  3164. namespace:
  3165. description: "Namespace is the namespace of the backend. When unspecified, the local namespace is inferred. \n Note that when a namespace different than the local namespace is specified, a ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. \n Support: Core"
  3166. maxLength: 63
  3167. minLength: 1
  3168. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
  3169. type: string
  3170. port:
  3171. description: Port specifies the destination port number to use for this resource. Port is required when the referent is a Kubernetes Service. In this case, the port number is the service port number, not the target port. For other resources, destination port might be derived from the referent resource or this field.
  3172. format: int32
  3173. maximum: 65535
  3174. minimum: 1
  3175. type: integer
  3176. required:
  3177. - name
  3178. type: object
  3179. x-kubernetes-validations:
  3180. - message: Must have port for Service reference
  3181. rule: '(size(self.group) == 0 && self.kind == ''Service'') ? has(self.port) : true'
  3182. required:
  3183. - backendRef
  3184. type: object
  3185. requestRedirect:
  3186. description: "RequestRedirect defines a schema for a filter that responds to the request with an HTTP redirection. \n Support: Core"
  3187. properties:
  3188. hostname:
  3189. description: "Hostname is the hostname to be used in the value of the `Location` header in the response. When empty, the hostname in the `Host` header of the request is used. \n Support: Core"
  3190. maxLength: 253
  3191. minLength: 1
  3192. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  3193. type: string
  3194. path:
  3195. description: "Path defines parameters used to modify the path of the incoming request. The modified path is then used to construct the `Location` header. When empty, the request path is used as-is. \n Support: Extended"
  3196. properties:
  3197. replaceFullPath:
  3198. description: ReplaceFullPath specifies the value with which to replace the full path of a request during a rewrite or redirect.
  3199. maxLength: 1024
  3200. type: string
  3201. replacePrefixMatch:
  3202. description: "ReplacePrefixMatch specifies the value with which to replace the prefix match of a request during a rewrite or redirect. For example, a request to \"/foo/bar\" with a prefix match of \"/foo\" and a ReplacePrefixMatch of \"/xyz\" would be modified to \"/xyz/bar\". \n Note that this matches the behavior of the PathPrefix match type. This matches full path elements. A path element refers to the list of labels in the path split by the `/` separator. When specified, a trailing `/` is ignored. For example, the paths `/abc`, `/abc/`, and `/abc/def` would all match the prefix `/abc`, but the path `/abcd` would not. \n ReplacePrefixMatch is only compatible with a `PathPrefix` HTTPRouteMatch. Using any other HTTPRouteMatch type on the same HTTPRouteRule will result in the implementation setting the Accepted Condition for the Route to `status: False`. \n Request Path | Prefix Match | Replace Prefix | Modified Path -------------|--------------|----------------|---------- /foo/bar | /foo | /xyz | /xyz/bar /foo/bar | /foo | /xyz/ | /xyz/bar /foo/bar | /foo/ | /xyz | /xyz/bar /foo/bar | /foo/ | /xyz/ | /xyz/bar /foo | /foo | /xyz | /xyz /foo/ | /foo | /xyz | /xyz/ /foo/bar | /foo | <empty string> | /bar /foo/ | /foo | <empty string> | / /foo | /foo | <empty string> | / /foo/ | /foo | / | / /foo | /foo | / | /"
  3203. maxLength: 1024
  3204. type: string
  3205. type:
  3206. description: "Type defines the type of path modifier. Additional types may be added in a future release of the API. \n Note that values may be added to this enum, implementations must ensure that unknown values will not cause a crash. \n Unknown values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason of `UnsupportedValue`."
  3207. enum:
  3208. - ReplaceFullPath
  3209. - ReplacePrefixMatch
  3210. type: string
  3211. required:
  3212. - type
  3213. type: object
  3214. x-kubernetes-validations:
  3215. - message: replaceFullPath must be specified when type is set to 'ReplaceFullPath'
  3216. rule: 'self.type == ''ReplaceFullPath'' ? has(self.replaceFullPath) : true'
  3217. - message: type must be 'ReplaceFullPath' when replaceFullPath is set
  3218. rule: 'has(self.replaceFullPath) ? self.type == ''ReplaceFullPath'' : true'
  3219. - message: replacePrefixMatch must be specified when type is set to 'ReplacePrefixMatch'
  3220. rule: 'self.type == ''ReplacePrefixMatch'' ? has(self.replacePrefixMatch) : true'
  3221. - message: type must be 'ReplacePrefixMatch' when replacePrefixMatch is set
  3222. rule: 'has(self.replacePrefixMatch) ? self.type == ''ReplacePrefixMatch'' : true'
  3223. port:
  3224. description: "Port is the port to be used in the value of the `Location` header in the response. \n If no port is specified, the redirect port MUST be derived using the following rules: \n * If redirect scheme is not-empty, the redirect port MUST be the well-known port associated with the redirect scheme. Specifically \"http\" to port 80 and \"https\" to port 443. If the redirect scheme does not have a well-known port, the listener port of the Gateway SHOULD be used. * If redirect scheme is empty, the redirect port MUST be the Gateway Listener port. \n Implementations SHOULD NOT add the port number in the 'Location' header in the following cases: \n * A Location header that will use HTTP (whether that is determined via the Listener protocol or the Scheme field) _and_ use port 80. * A Location header that will use HTTPS (whether that is determined via the Listener protocol or the Scheme field) _and_ use port 443. \n Support: Extended"
  3225. format: int32
  3226. maximum: 65535
  3227. minimum: 1
  3228. type: integer
  3229. scheme:
  3230. description: "Scheme is the scheme to be used in the value of the `Location` header in the response. When empty, the scheme of the request is used. \n Scheme redirects can affect the port of the redirect, for more information, refer to the documentation for the port field of this filter. \n Note that values may be added to this enum, implementations must ensure that unknown values will not cause a crash. \n Unknown values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason of `UnsupportedValue`. \n Support: Extended"
  3231. enum:
  3232. - http
  3233. - https
  3234. type: string
  3235. statusCode:
  3236. default: 302
  3237. description: "StatusCode is the HTTP status code to be used in response. \n Note that values may be added to this enum, implementations must ensure that unknown values will not cause a crash. \n Unknown values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason of `UnsupportedValue`. \n Support: Core"
  3238. enum:
  3239. - 301
  3240. - 302
  3241. type: integer
  3242. type: object
  3243. responseHeaderModifier:
  3244. description: "ResponseHeaderModifier defines a schema for a filter that modifies response headers. \n Support: Extended"
  3245. properties:
  3246. add:
  3247. description: "Add adds the given header(s) (name, value) to the request before the action. It appends to any existing values associated with the header name. \n Input: GET /foo HTTP/1.1 my-header: foo \n Config: add: - name: \"my-header\" value: \"bar,baz\" \n Output: GET /foo HTTP/1.1 my-header: foo,bar,baz"
  3248. items:
  3249. description: HTTPHeader represents an HTTP Header name and value as defined by RFC 7230.
  3250. properties:
  3251. name:
  3252. description: "Name is the name of the HTTP Header to be matched. Name matching MUST be case insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2). \n If multiple entries specify equivalent header names, the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent header name MUST be ignored. Due to the case-insensitivity of header names, \"foo\" and \"Foo\" are considered equivalent."
  3253. maxLength: 256
  3254. minLength: 1
  3255. pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
  3256. type: string
  3257. value:
  3258. description: Value is the value of HTTP Header to be matched.
  3259. maxLength: 4096
  3260. minLength: 1
  3261. type: string
  3262. required:
  3263. - name
  3264. - value
  3265. type: object
  3266. maxItems: 16
  3267. type: array
  3268. x-kubernetes-list-map-keys:
  3269. - name
  3270. x-kubernetes-list-type: map
  3271. remove:
  3272. description: "Remove the given header(s) from the HTTP request before the action. The value of Remove is a list of HTTP header names. Note that the header names are case-insensitive (see https://datatracker.ietf.org/doc/html/rfc2616#section-4.2). \n Input: GET /foo HTTP/1.1 my-header1: foo my-header2: bar my-header3: baz \n Config: remove: [\"my-header1\", \"my-header3\"] \n Output: GET /foo HTTP/1.1 my-header2: bar"
  3273. items:
  3274. type: string
  3275. maxItems: 16
  3276. type: array
  3277. x-kubernetes-list-type: set
  3278. set:
  3279. description: "Set overwrites the request with the given header (name, value) before the action. \n Input: GET /foo HTTP/1.1 my-header: foo \n Config: set: - name: \"my-header\" value: \"bar\" \n Output: GET /foo HTTP/1.1 my-header: bar"
  3280. items:
  3281. description: HTTPHeader represents an HTTP Header name and value as defined by RFC 7230.
  3282. properties:
  3283. name:
  3284. description: "Name is the name of the HTTP Header to be matched. Name matching MUST be case insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2). \n If multiple entries specify equivalent header names, the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent header name MUST be ignored. Due to the case-insensitivity of header names, \"foo\" and \"Foo\" are considered equivalent."
  3285. maxLength: 256
  3286. minLength: 1
  3287. pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
  3288. type: string
  3289. value:
  3290. description: Value is the value of HTTP Header to be matched.
  3291. maxLength: 4096
  3292. minLength: 1
  3293. type: string
  3294. required:
  3295. - name
  3296. - value
  3297. type: object
  3298. maxItems: 16
  3299. type: array
  3300. x-kubernetes-list-map-keys:
  3301. - name
  3302. x-kubernetes-list-type: map
  3303. type: object
  3304. type:
  3305. description: "Type identifies the type of filter to apply. As with other API fields, types are classified into three conformance levels: \n - Core: Filter types and their corresponding configuration defined by \"Support: Core\" in this package, e.g. \"RequestHeaderModifier\". All implementations must support core filters. \n - Extended: Filter types and their corresponding configuration defined by \"Support: Extended\" in this package, e.g. \"RequestMirror\". Implementers are encouraged to support extended filters. \n - Implementation-specific: Filters that are defined and supported by specific vendors. In the future, filters showing convergence in behavior across multiple implementations will be considered for inclusion in extended or core conformance levels. Filter-specific configuration for such filters is specified using the ExtensionRef field. `Type` should be set to \"ExtensionRef\" for custom filters. \n Implementers are encouraged to define custom implementation types to extend the core API with implementation-specific behavior. \n If a reference to a custom filter type cannot be resolved, the filter MUST NOT be skipped. Instead, requests that would have been processed by that filter MUST receive a HTTP error response. \n Note that values may be added to this enum, implementations must ensure that unknown values will not cause a crash. \n Unknown values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason of `UnsupportedValue`."
  3306. enum:
  3307. - RequestHeaderModifier
  3308. - ResponseHeaderModifier
  3309. - RequestMirror
  3310. - RequestRedirect
  3311. - URLRewrite
  3312. - ExtensionRef
  3313. type: string
  3314. urlRewrite:
  3315. description: "URLRewrite defines a schema for a filter that modifies a request during forwarding. \n Support: Extended"
  3316. properties:
  3317. hostname:
  3318. description: "Hostname is the value to be used to replace the Host header value during forwarding. \n Support: Extended"
  3319. maxLength: 253
  3320. minLength: 1
  3321. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  3322. type: string
  3323. path:
  3324. description: "Path defines a path rewrite. \n Support: Extended"
  3325. properties:
  3326. replaceFullPath:
  3327. description: ReplaceFullPath specifies the value with which to replace the full path of a request during a rewrite or redirect.
  3328. maxLength: 1024
  3329. type: string
  3330. replacePrefixMatch:
  3331. description: "ReplacePrefixMatch specifies the value with which to replace the prefix match of a request during a rewrite or redirect. For example, a request to \"/foo/bar\" with a prefix match of \"/foo\" and a ReplacePrefixMatch of \"/xyz\" would be modified to \"/xyz/bar\". \n Note that this matches the behavior of the PathPrefix match type. This matches full path elements. A path element refers to the list of labels in the path split by the `/` separator. When specified, a trailing `/` is ignored. For example, the paths `/abc`, `/abc/`, and `/abc/def` would all match the prefix `/abc`, but the path `/abcd` would not. \n ReplacePrefixMatch is only compatible with a `PathPrefix` HTTPRouteMatch. Using any other HTTPRouteMatch type on the same HTTPRouteRule will result in the implementation setting the Accepted Condition for the Route to `status: False`. \n Request Path | Prefix Match | Replace Prefix | Modified Path -------------|--------------|----------------|---------- /foo/bar | /foo | /xyz | /xyz/bar /foo/bar | /foo | /xyz/ | /xyz/bar /foo/bar | /foo/ | /xyz | /xyz/bar /foo/bar | /foo/ | /xyz/ | /xyz/bar /foo | /foo | /xyz | /xyz /foo/ | /foo | /xyz | /xyz/ /foo/bar | /foo | <empty string> | /bar /foo/ | /foo | <empty string> | / /foo | /foo | <empty string> | / /foo/ | /foo | / | / /foo | /foo | / | /"
  3332. maxLength: 1024
  3333. type: string
  3334. type:
  3335. description: "Type defines the type of path modifier. Additional types may be added in a future release of the API. \n Note that values may be added to this enum, implementations must ensure that unknown values will not cause a crash. \n Unknown values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason of `UnsupportedValue`."
  3336. enum:
  3337. - ReplaceFullPath
  3338. - ReplacePrefixMatch
  3339. type: string
  3340. required:
  3341. - type
  3342. type: object
  3343. x-kubernetes-validations:
  3344. - message: replaceFullPath must be specified when type is set to 'ReplaceFullPath'
  3345. rule: 'self.type == ''ReplaceFullPath'' ? has(self.replaceFullPath) : true'
  3346. - message: type must be 'ReplaceFullPath' when replaceFullPath is set
  3347. rule: 'has(self.replaceFullPath) ? self.type == ''ReplaceFullPath'' : true'
  3348. - message: replacePrefixMatch must be specified when type is set to 'ReplacePrefixMatch'
  3349. rule: 'self.type == ''ReplacePrefixMatch'' ? has(self.replacePrefixMatch) : true'
  3350. - message: type must be 'ReplacePrefixMatch' when replacePrefixMatch is set
  3351. rule: 'has(self.replacePrefixMatch) ? self.type == ''ReplacePrefixMatch'' : true'
  3352. type: object
  3353. required:
  3354. - type
  3355. type: object
  3356. x-kubernetes-validations:
  3357. - message: filter.requestHeaderModifier must be nil if the filter.type is not RequestHeaderModifier
  3358. rule: '!(has(self.requestHeaderModifier) && self.type != ''RequestHeaderModifier'')'
  3359. - message: filter.requestHeaderModifier must be specified for RequestHeaderModifier filter.type
  3360. rule: '!(!has(self.requestHeaderModifier) && self.type == ''RequestHeaderModifier'')'
  3361. - message: filter.responseHeaderModifier must be nil if the filter.type is not ResponseHeaderModifier
  3362. rule: '!(has(self.responseHeaderModifier) && self.type != ''ResponseHeaderModifier'')'
  3363. - message: filter.responseHeaderModifier must be specified for ResponseHeaderModifier filter.type
  3364. rule: '!(!has(self.responseHeaderModifier) && self.type == ''ResponseHeaderModifier'')'
  3365. - message: filter.requestMirror must be nil if the filter.type is not RequestMirror
  3366. rule: '!(has(self.requestMirror) && self.type != ''RequestMirror'')'
  3367. - message: filter.requestMirror must be specified for RequestMirror filter.type
  3368. rule: '!(!has(self.requestMirror) && self.type == ''RequestMirror'')'
  3369. - message: filter.requestRedirect must be nil if the filter.type is not RequestRedirect
  3370. rule: '!(has(self.requestRedirect) && self.type != ''RequestRedirect'')'
  3371. - message: filter.requestRedirect must be specified for RequestRedirect filter.type
  3372. rule: '!(!has(self.requestRedirect) && self.type == ''RequestRedirect'')'
  3373. - message: filter.urlRewrite must be nil if the filter.type is not URLRewrite
  3374. rule: '!(has(self.urlRewrite) && self.type != ''URLRewrite'')'
  3375. - message: filter.urlRewrite must be specified for URLRewrite filter.type
  3376. rule: '!(!has(self.urlRewrite) && self.type == ''URLRewrite'')'
  3377. - message: filter.extensionRef must be nil if the filter.type is not ExtensionRef
  3378. rule: '!(has(self.extensionRef) && self.type != ''ExtensionRef'')'
  3379. - message: filter.extensionRef must be specified for ExtensionRef filter.type
  3380. rule: '!(!has(self.extensionRef) && self.type == ''ExtensionRef'')'
  3381. maxItems: 16
  3382. type: array
  3383. x-kubernetes-validations:
  3384. - message: May specify either httpRouteFilterRequestRedirect or httpRouteFilterRequestRewrite, but not both
  3385. rule: '!(self.exists(f, f.type == ''RequestRedirect'') && self.exists(f, f.type == ''URLRewrite''))'
  3386. - message: RequestHeaderModifier filter cannot be repeated
  3387. rule: self.filter(f, f.type == 'RequestHeaderModifier').size() <= 1
  3388. - message: ResponseHeaderModifier filter cannot be repeated
  3389. rule: self.filter(f, f.type == 'ResponseHeaderModifier').size() <= 1
  3390. - message: RequestRedirect filter cannot be repeated
  3391. rule: self.filter(f, f.type == 'RequestRedirect').size() <= 1
  3392. - message: URLRewrite filter cannot be repeated
  3393. rule: self.filter(f, f.type == 'URLRewrite').size() <= 1
  3394. matches:
  3395. default:
  3396. - path:
  3397. type: PathPrefix
  3398. value: /
  3399. description: "Matches define conditions used for matching the rule against incoming HTTP requests. Each match is independent, i.e. this rule will be matched if **any** one of the matches is satisfied. \n For example, take the following matches configuration: \n ``` matches: - path: value: \"/foo\" headers: - name: \"version\" value: \"v2\" - path: value: \"/v2/foo\" ``` \n For a request to match against this rule, a request must satisfy EITHER of the two conditions: \n - path prefixed with `/foo` AND contains the header `version: v2` - path prefix of `/v2/foo` \n See the documentation for HTTPRouteMatch on how to specify multiple match conditions that should be ANDed together. \n If no matches are specified, the default is a prefix path match on \"/\", which has the effect of matching every HTTP request. \n Proxy or Load Balancer routing configuration generated from HTTPRoutes MUST prioritize matches based on the following criteria, continuing on ties. Across all rules specified on applicable Routes, precedence must be given to the match having: \n * \"Exact\" path match. * \"Prefix\" path match with largest number of characters. * Method match. * Largest number of header matches. * Largest number of query param matches. \n Note: The precedence of RegularExpression path matches are implementation-specific. \n If ties still exist across multiple Routes, matching precedence MUST be determined in order of the following criteria, continuing on ties: \n * The oldest Route based on creation timestamp. * The Route appearing first in alphabetical order by \"{namespace}/{name}\". \n If ties still exist within an HTTPRoute, matching precedence MUST be granted to the FIRST matching rule (in list order) with a match meeting the above criteria. \n When no rules matching a request have been successfully attached to the parent a request is coming from, a HTTP 404 status code MUST be returned."
  3400. items:
  3401. description: "HTTPRouteMatch defines the predicate used to match requests to a given action. Multiple match types are ANDed together, i.e. the match will evaluate to true only if all conditions are satisfied. \n For example, the match below will match a HTTP request only if its path starts with `/foo` AND it contains the `version: v1` header: \n ``` match: \n path: value: \"/foo\" headers: - name: \"version\" value \"v1\" \n ```"
  3402. properties:
  3403. headers:
  3404. description: Headers specifies HTTP request header matchers. Multiple match values are ANDed together, meaning, a request must match all the specified headers to select the route.
  3405. items:
  3406. description: HTTPHeaderMatch describes how to select a HTTP route by matching HTTP request headers.
  3407. properties:
  3408. name:
  3409. description: "Name is the name of the HTTP Header to be matched. Name matching MUST be case insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2). \n If multiple entries specify equivalent header names, only the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent header name MUST be ignored. Due to the case-insensitivity of header names, \"foo\" and \"Foo\" are considered equivalent. \n When a header is repeated in an HTTP request, it is implementation-specific behavior as to how this is represented. Generally, proxies should follow the guidance from the RFC: https://www.rfc-editor.org/rfc/rfc7230.html#section-3.2.2 regarding processing a repeated header, with special handling for \"Set-Cookie\"."
  3410. maxLength: 256
  3411. minLength: 1
  3412. pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
  3413. type: string
  3414. type:
  3415. default: Exact
  3416. description: "Type specifies how to match against the value of the header. \n Support: Core (Exact) \n Support: Implementation-specific (RegularExpression) \n Since RegularExpression HeaderMatchType has implementation-specific conformance, implementations can support POSIX, PCRE or any other dialects of regular expressions. Please read the implementation's documentation to determine the supported dialect."
  3417. enum:
  3418. - Exact
  3419. - RegularExpression
  3420. type: string
  3421. value:
  3422. description: Value is the value of HTTP Header to be matched.
  3423. maxLength: 4096
  3424. minLength: 1
  3425. type: string
  3426. required:
  3427. - name
  3428. - value
  3429. type: object
  3430. maxItems: 16
  3431. type: array
  3432. x-kubernetes-list-map-keys:
  3433. - name
  3434. x-kubernetes-list-type: map
  3435. method:
  3436. description: "Method specifies HTTP method matcher. When specified, this route will be matched only if the request has the specified method. \n Support: Extended"
  3437. enum:
  3438. - GET
  3439. - HEAD
  3440. - POST
  3441. - PUT
  3442. - DELETE
  3443. - CONNECT
  3444. - OPTIONS
  3445. - TRACE
  3446. - PATCH
  3447. type: string
  3448. path:
  3449. default:
  3450. type: PathPrefix
  3451. value: /
  3452. description: Path specifies a HTTP request path matcher. If this field is not specified, a default prefix match on the "/" path is provided.
  3453. properties:
  3454. type:
  3455. default: PathPrefix
  3456. description: "Type specifies how to match against the path Value. \n Support: Core (Exact, PathPrefix) \n Support: Implementation-specific (RegularExpression)"
  3457. enum:
  3458. - Exact
  3459. - PathPrefix
  3460. - RegularExpression
  3461. type: string
  3462. value:
  3463. default: /
  3464. description: Value of the HTTP path to match against.
  3465. maxLength: 1024
  3466. type: string
  3467. type: object
  3468. x-kubernetes-validations:
  3469. - message: value must be an absolute path and start with '/' when type one of ['Exact', 'PathPrefix']
  3470. rule: '(self.type in [''Exact'',''PathPrefix'']) ? self.value.startsWith(''/'') : true'
  3471. - message: must not contain '//' when type one of ['Exact', 'PathPrefix']
  3472. rule: '(self.type in [''Exact'',''PathPrefix'']) ? !self.value.contains(''//'') : true'
  3473. - message: must not contain '/./' when type one of ['Exact', 'PathPrefix']
  3474. rule: '(self.type in [''Exact'',''PathPrefix'']) ? !self.value.contains(''/./'') : true'
  3475. - message: must not contain '/../' when type one of ['Exact', 'PathPrefix']
  3476. rule: '(self.type in [''Exact'',''PathPrefix'']) ? !self.value.contains(''/../'') : true'
  3477. - message: must not contain '%2f' when type one of ['Exact', 'PathPrefix']
  3478. rule: '(self.type in [''Exact'',''PathPrefix'']) ? !self.value.contains(''%2f'') : true'
  3479. - message: must not contain '%2F' when type one of ['Exact', 'PathPrefix']
  3480. rule: '(self.type in [''Exact'',''PathPrefix'']) ? !self.value.contains(''%2F'') : true'
  3481. - message: must not contain '#' when type one of ['Exact', 'PathPrefix']
  3482. rule: '(self.type in [''Exact'',''PathPrefix'']) ? !self.value.contains(''#'') : true'
  3483. - message: must not end with '/..' when type one of ['Exact', 'PathPrefix']
  3484. rule: '(self.type in [''Exact'',''PathPrefix'']) ? !self.value.endsWith(''/..'') : true'
  3485. - message: must not end with '/.' when type one of ['Exact', 'PathPrefix']
  3486. rule: '(self.type in [''Exact'',''PathPrefix'']) ? !self.value.endsWith(''/.'') : true'
  3487. - message: type must be one of ['Exact', 'PathPrefix', 'RegularExpression']
  3488. rule: self.type in ['Exact','PathPrefix'] || self.type == 'RegularExpression'
  3489. - message: must only contain valid characters (matching ^(?:[-A-Za-z0-9/._~!$&'()*+,;=:@]|[%][0-9a-fA-F]{2})+$) for types ['Exact', 'PathPrefix']
  3490. rule: '(self.type in [''Exact'',''PathPrefix'']) ? self.value.matches(r"""^(?:[-A-Za-z0-9/._~!$&''()*+,;=:@]|[%][0-9a-fA-F]{2})+$""") : true'
  3491. queryParams:
  3492. description: "QueryParams specifies HTTP query parameter matchers. Multiple match values are ANDed together, meaning, a request must match all the specified query parameters to select the route. \n Support: Extended"
  3493. items:
  3494. description: HTTPQueryParamMatch describes how to select a HTTP route by matching HTTP query parameters.
  3495. properties:
  3496. name:
  3497. description: "Name is the name of the HTTP query param to be matched. This must be an exact string match. (See https://tools.ietf.org/html/rfc7230#section-2.7.3). \n If multiple entries specify equivalent query param names, only the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent query param name MUST be ignored. \n If a query param is repeated in an HTTP request, the behavior is purposely left undefined, since different data planes have different capabilities. However, it is *recommended* that implementations should match against the first value of the param if the data plane supports it, as this behavior is expected in other load balancing contexts outside of the Gateway API. \n Users SHOULD NOT route traffic based on repeated query params to guard themselves against potential differences in the implementations."
  3498. maxLength: 256
  3499. minLength: 1
  3500. pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
  3501. type: string
  3502. type:
  3503. default: Exact
  3504. description: "Type specifies how to match against the value of the query parameter. \n Support: Extended (Exact) \n Support: Implementation-specific (RegularExpression) \n Since RegularExpression QueryParamMatchType has Implementation-specific conformance, implementations can support POSIX, PCRE or any other dialects of regular expressions. Please read the implementation's documentation to determine the supported dialect."
  3505. enum:
  3506. - Exact
  3507. - RegularExpression
  3508. type: string
  3509. value:
  3510. description: Value is the value of HTTP query param to be matched.
  3511. maxLength: 1024
  3512. minLength: 1
  3513. type: string
  3514. required:
  3515. - name
  3516. - value
  3517. type: object
  3518. maxItems: 16
  3519. type: array
  3520. x-kubernetes-list-map-keys:
  3521. - name
  3522. x-kubernetes-list-type: map
  3523. type: object
  3524. maxItems: 8
  3525. type: array
  3526. timeouts:
  3527. description: "Timeouts defines the timeouts that can be configured for an HTTP request. \n Support: Extended \n "
  3528. properties:
  3529. backendRequest:
  3530. description: "BackendRequest specifies a timeout for an individual request from the gateway to a backend. This covers the time from when the request first starts being sent from the gateway to when the full response has been received from the backend. \n An entire client HTTP transaction with a gateway, covered by the Request timeout, may result in more than one call from the gateway to the destination backend, for example, if automatic retries are supported. \n Because the Request timeout encompasses the BackendRequest timeout, the value of BackendRequest must be <= the value of Request timeout. \n Support: Extended"
  3531. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
  3532. type: string
  3533. request:
  3534. description: "Request specifies the maximum duration for a gateway to respond to an HTTP request. If the gateway has not been able to respond before this deadline is met, the gateway MUST return a timeout error. \n For example, setting the `rules.timeouts.request` field to the value `10s` in an `HTTPRoute` will cause a timeout if a client request is taking longer than 10 seconds to complete. \n This timeout is intended to cover as close to the whole request-response transaction as possible although an implementation MAY choose to start the timeout after the entire request stream has been received instead of immediately after the transaction is initiated by the client. \n When this field is unspecified, request timeout behavior is implementation-specific. \n Support: Extended"
  3535. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
  3536. type: string
  3537. type: object
  3538. x-kubernetes-validations:
  3539. - message: backendRequest timeout cannot be longer than request timeout
  3540. rule: '!(has(self.request) && has(self.backendRequest) && duration(self.request) != duration(''0s'') && duration(self.backendRequest) > duration(self.request))'
  3541. type: object
  3542. x-kubernetes-validations:
  3543. - message: RequestRedirect filter must not be used together with backendRefs
  3544. rule: '(has(self.backendRefs) && size(self.backendRefs) > 0) ? (!has(self.filters) || self.filters.all(f, !has(f.requestRedirect))): true'
  3545. - message: When using RequestRedirect filter with path.replacePrefixMatch, exactly one PathPrefix match must be specified
  3546. rule: '(has(self.filters) && self.filters.exists_one(f, has(f.requestRedirect) && has(f.requestRedirect.path) && f.requestRedirect.path.type == ''ReplacePrefixMatch'' && has(f.requestRedirect.path.replacePrefixMatch))) ? ((size(self.matches) != 1 || !has(self.matches[0].path) || self.matches[0].path.type != ''PathPrefix'') ? false : true) : true'
  3547. - message: When using URLRewrite filter with path.replacePrefixMatch, exactly one PathPrefix match must be specified
  3548. rule: '(has(self.filters) && self.filters.exists_one(f, has(f.urlRewrite) && has(f.urlRewrite.path) && f.urlRewrite.path.type == ''ReplacePrefixMatch'' && has(f.urlRewrite.path.replacePrefixMatch))) ? ((size(self.matches) != 1 || !has(self.matches[0].path) || self.matches[0].path.type != ''PathPrefix'') ? false : true) : true'
  3549. - message: Within backendRefs, when using RequestRedirect filter with path.replacePrefixMatch, exactly one PathPrefix match must be specified
  3550. rule: '(has(self.backendRefs) && self.backendRefs.exists_one(b, (has(b.filters) && b.filters.exists_one(f, has(f.requestRedirect) && has(f.requestRedirect.path) && f.requestRedirect.path.type == ''ReplacePrefixMatch'' && has(f.requestRedirect.path.replacePrefixMatch))) )) ? ((size(self.matches) != 1 || !has(self.matches[0].path) || self.matches[0].path.type != ''PathPrefix'') ? false : true) : true'
  3551. - message: Within backendRefs, When using URLRewrite filter with path.replacePrefixMatch, exactly one PathPrefix match must be specified
  3552. rule: '(has(self.backendRefs) && self.backendRefs.exists_one(b, (has(b.filters) && b.filters.exists_one(f, has(f.urlRewrite) && has(f.urlRewrite.path) && f.urlRewrite.path.type == ''ReplacePrefixMatch'' && has(f.urlRewrite.path.replacePrefixMatch))) )) ? ((size(self.matches) != 1 || !has(self.matches[0].path) || self.matches[0].path.type != ''PathPrefix'') ? false : true) : true'
  3553. maxItems: 16
  3554. type: array
  3555. type: object
  3556. status:
  3557. description: Status defines the current state of HTTPRoute.
  3558. properties:
  3559. parents:
  3560. description: "Parents is a list of parent resources (usually Gateways) that are associated with the route, and the status of the route with respect to each parent. When this route attaches to a parent, the controller that manages the parent must add an entry to this list when the controller first sees the route and should update the entry as appropriate when the route or gateway is modified. \n Note that parent references that cannot be resolved by an implementation of this API will not be added to this list. Implementations of this API can only populate Route status for the Gateways/parent resources they are responsible for. \n A maximum of 32 Gateways will be represented in this list. An empty list means the route has not been attached to any Gateway."
  3561. items:
  3562. description: RouteParentStatus describes the status of a route with respect to an associated Parent.
  3563. properties:
  3564. conditions:
  3565. description: "Conditions describes the status of the route with respect to the Gateway. Note that the route's availability is also subject to the Gateway's own status conditions and listener status. \n If the Route's ParentRef specifies an existing Gateway that supports Routes of this kind AND that Gateway's controller has sufficient access, then that Gateway's controller MUST set the \"Accepted\" condition on the Route, to indicate whether the route has been accepted or rejected by the Gateway, and why. \n A Route MUST be considered \"Accepted\" if at least one of the Route's rules is implemented by the Gateway. \n There are a number of cases where the \"Accepted\" condition may not be set due to lack of controller visibility, that includes when: \n * The Route refers to a non-existent parent. * The Route is of a type that the controller does not support. * The Route is in a namespace the controller does not have access to."
  3566. items:
  3567. description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, \n type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
  3568. properties:
  3569. lastTransitionTime:
  3570. description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
  3571. format: date-time
  3572. type: string
  3573. message:
  3574. description: message is a human readable message indicating details about the transition. This may be an empty string.
  3575. maxLength: 32768
  3576. type: string
  3577. observedGeneration:
  3578. description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.
  3579. format: int64
  3580. minimum: 0
  3581. type: integer
  3582. reason:
  3583. description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.
  3584. maxLength: 1024
  3585. minLength: 1
  3586. pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
  3587. type: string
  3588. status:
  3589. description: status of the condition, one of True, False, Unknown.
  3590. enum:
  3591. - "True"
  3592. - "False"
  3593. - Unknown
  3594. type: string
  3595. type:
  3596. description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
  3597. maxLength: 316
  3598. pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
  3599. type: string
  3600. required:
  3601. - lastTransitionTime
  3602. - message
  3603. - reason
  3604. - status
  3605. - type
  3606. type: object
  3607. maxItems: 8
  3608. minItems: 1
  3609. type: array
  3610. x-kubernetes-list-map-keys:
  3611. - type
  3612. x-kubernetes-list-type: map
  3613. controllerName:
  3614. description: "ControllerName is a domain/path string that indicates the name of the controller that wrote this status. This corresponds with the controllerName field on GatewayClass. \n Example: \"example.net/gateway-controller\". \n The format of this field is DOMAIN \"/\" PATH, where DOMAIN and PATH are valid Kubernetes names (https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). \n Controllers MUST populate this field when writing status. Controllers should ensure that entries to status populated with their ControllerName are cleaned up when they are no longer necessary."
  3615. maxLength: 253
  3616. minLength: 1
  3617. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$
  3618. type: string
  3619. parentRef:
  3620. description: ParentRef corresponds with a ParentRef in the spec that this RouteParentStatus struct describes the status of.
  3621. properties:
  3622. group:
  3623. default: gateway.networking.k8s.io
  3624. description: "Group is the group of the referent. When unspecified, \"gateway.networking.k8s.io\" is inferred. To set the core API group (such as for a \"Service\" kind referent), Group must be explicitly set to \"\" (empty string). \n Support: Core"
  3625. maxLength: 253
  3626. pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  3627. type: string
  3628. kind:
  3629. default: Gateway
  3630. description: "Kind is kind of the referent. \n There are two kinds of parent resources with \"Core\" support: \n * Gateway (Gateway conformance profile) * Service (Mesh conformance profile, experimental, ClusterIP Services only) \n Support for other resources is Implementation-Specific."
  3631. maxLength: 63
  3632. minLength: 1
  3633. pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
  3634. type: string
  3635. name:
  3636. description: "Name is the name of the referent. \n Support: Core"
  3637. maxLength: 253
  3638. minLength: 1
  3639. type: string
  3640. namespace:
  3641. description: "Namespace is the namespace of the referent. When unspecified, this refers to the local namespace of the Route. \n Note that there are specific rules for ParentRefs which cross namespace boundaries. Cross-namespace references are only valid if they are explicitly allowed by something in the namespace they are referring to. For example: Gateway has the AllowedRoutes field, and ReferenceGrant provides a generic way to enable any other kind of cross-namespace reference. \n ParentRefs from a Route to a Service in the same namespace are \"producer\" routes, which apply default routing rules to inbound connections from any namespace to the Service. \n ParentRefs from a Route to a Service in a different namespace are \"consumer\" routes, and these routing rules are only applied to outbound connections originating from the same namespace as the Route, for which the intended destination of the connections are a Service targeted as a ParentRef of the Route. \n Support: Core"
  3642. maxLength: 63
  3643. minLength: 1
  3644. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
  3645. type: string
  3646. port:
  3647. description: "Port is the network port this Route targets. It can be interpreted differently based on the type of parent resource. \n When the parent resource is a Gateway, this targets all listeners listening on the specified port that also support this kind of Route(and select this Route). It's not recommended to set `Port` unless the networking behaviors specified in a Route must apply to a specific port as opposed to a listener(s) whose port(s) may be changed. When both Port and SectionName are specified, the name and port of the selected listener must match both specified values. \n When the parent resource is a Service, this targets a specific port in the Service spec. When both Port (experimental) and SectionName are specified, the name and port of the selected port must match both specified values. \n Implementations MAY choose to support other parent resources. Implementations supporting other types of parent resources MUST clearly document how/if Port is interpreted. \n For the purpose of status, an attachment is considered successful as long as the parent resource accepts it partially. For example, Gateway listeners can restrict which Routes can attach to them by Route kind, namespace, or hostname. If 1 of 2 Gateway listeners accept attachment from the referencing Route, the Route MUST be considered successfully attached. If no Gateway listeners accept attachment from this Route, the Route MUST be considered detached from the Gateway. \n Support: Extended \n "
  3648. format: int32
  3649. maximum: 65535
  3650. minimum: 1
  3651. type: integer
  3652. sectionName:
  3653. description: "SectionName is the name of a section within the target resource. In the following resources, SectionName is interpreted as the following: \n * Gateway: Listener Name. When both Port (experimental) and SectionName are specified, the name and port of the selected listener must match both specified values. * Service: Port Name. When both Port (experimental) and SectionName are specified, the name and port of the selected listener must match both specified values. Note that attaching Routes to Services as Parents is part of experimental Mesh support and is not supported for any other purpose. \n Implementations MAY choose to support attaching Routes to other resources. If that is the case, they MUST clearly document how SectionName is interpreted. \n When unspecified (empty string), this will reference the entire resource. For the purpose of status, an attachment is considered successful if at least one section in the parent resource accepts it. For example, Gateway listeners can restrict which Routes can attach to them by Route kind, namespace, or hostname. If 1 of 2 Gateway listeners accept attachment from the referencing Route, the Route MUST be considered successfully attached. If no Gateway listeners accept attachment from this Route, the Route MUST be considered detached from the Gateway. \n Support: Core"
  3654. maxLength: 253
  3655. minLength: 1
  3656. pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
  3657. type: string
  3658. required:
  3659. - name
  3660. type: object
  3661. required:
  3662. - controllerName
  3663. - parentRef
  3664. type: object
  3665. maxItems: 32
  3666. type: array
  3667. required:
  3668. - parents
  3669. type: object
  3670. required:
  3671. - spec
  3672. type: object
  3673. served: true
  3674. storage: true
  3675. subresources:
  3676. status: {}
  3677. status:
  3678. acceptedNames:
  3679. kind: ""
  3680. plural: ""
  3681. conditions: null
  3682. storedVersions: null

RBAC

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: gateway-role
rules:
  - apiGroups:
      - ""
    resources:
      - namespaces
    verbs:
      - list
      - watch
  - apiGroups:
      - ""
    resources:
      - services
      - endpoints
      - secrets
    verbs:
      - get
      - list
      - watch
  - apiGroups:
      - gateway.networking.k8s.io
    resources:
      - gatewayclasses
      - gateways
      - httproutes
      - referencegrants
      - tcproutes
      - tlsroutes
    verbs:
      - get
      - list
      - watch
  - apiGroups:
      - gateway.networking.k8s.io
    resources:
      - gatewayclasses/status
      - gateways/status
      - httproutes/status
      - tcproutes/status
      - tlsroutes/status
    verbs:
      - update

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: gateway-controller
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: gateway-role
subjects:
  - kind: ServiceAccount
    name: traefik-controller
    namespace: default

The Kubernetes Gateway API project provides several guides on how to use the APIs. These guides can help you to go further than the example above. The getting started guide details how to install the CRDs from their repository.

For now, the Traefik Gateway Provider can be used while following the below guides:

Resource Configuration

When using Kubernetes Gateway API as a provider, Traefik uses Kubernetes Custom Resource Definitions to retrieve its routing configuration.

All concepts can be found in the official API concepts documentation. Traefik implements the following resources:

  • GatewayClass defines a set of Gateways that share a common configuration and behaviour.
  • Gateway describes how traffic can be translated to Services within the cluster.
  • HTTPRoute defines HTTP rules for mapping requests from a Gateway to Kubernetes Services.
  • TCPRoute defines TCP rules for mapping requests from a Gateway to Kubernetes Services.
  • TLSRoute defines TLS rules for mapping requests from a Gateway to Kubernetes Services.

Provider Configuration

endpoint

Optional, Default=””

The Kubernetes server endpoint URL.

When deployed into Kubernetes, Traefik reads the environment variables KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT or KUBECONFIG to construct the endpoint.

The access token is looked up in /var/run/secrets/kubernetes.io/serviceaccount/token and the SSL CA certificate in /var/run/secrets/kubernetes.io/serviceaccount/ca.crt. Both are mounted automatically when deployed inside Kubernetes.

The endpoint may be specified to override the environment variable values inside a cluster.

When the environment variables are not found, Traefik tries to connect to the Kubernetes API server with an external-cluster client. In this case, the endpoint is required. Specifically, it may be set to the URL used by kubectl proxy to connect to a Kubernetes cluster using the granted authentication and authorization of the associated kubeconfig.

File (YAML)

providers:
  kubernetesGateway:
    endpoint: "http://localhost:8080"
    # ...

File (TOML)

[providers.kubernetesGateway]
  endpoint = "http://localhost:8080"
  # ...

CLI

--providers.kubernetesgateway.endpoint=http://localhost:8080

token

Optional, Default=””

Bearer token used for the Kubernetes client configuration.

File (YAML)

providers:
  kubernetesGateway:
    token: "mytoken"
    # ...

File (TOML)

[providers.kubernetesGateway]
  token = "mytoken"
  # ...

CLI

--providers.kubernetesgateway.token=mytoken

certAuthFilePath

Optional, Default=””

Path to the certificate authority file. Used for the Kubernetes client configuration.

File (YAML)

providers:
  kubernetesGateway:
    certAuthFilePath: "/my/ca.crt"
    # ...

File (TOML)

[providers.kubernetesGateway]
  certAuthFilePath = "/my/ca.crt"
  # ...

CLI

--providers.kubernetesgateway.certauthfilepath=/my/ca.crt

namespaces

Optional, Default: []

Array of namespaces to watch. If left empty, Traefik watches all namespaces.

File (YAML)

providers:
  kubernetesGateway:
    namespaces:
    - "default"
    - "production"
    # ...

File (TOML)

[providers.kubernetesGateway]
  namespaces = ["default", "production"]
  # ...

CLI

--providers.kubernetesgateway.namespaces=default,production

statusAddress

ip

Optional, Default: “”

This IP will get copied to the Gateway status.addresses, and currently only supports one IP value (IPv4 or IPv6).

File (YAML)

providers:
  kubernetesGateway:
    statusAddress:
      ip: "1.2.3.4"
    # ...

File (TOML)

[providers.kubernetesGateway.statusAddress]
  ip = "1.2.3.4"
  # ...

CLI

--providers.kubernetesgateway.statusaddress.ip=1.2.3.4

hostname

Optional, Default: “”

This Hostname will get copied to the Gateway status.addresses.

File (YAML)

providers:
  kubernetesGateway:
    statusAddress:
      hostname: "example.net"
    # ...

File (TOML)

[providers.kubernetesGateway.statusAddress]
  hostname = "example.net"
  # ...

CLI

--providers.kubernetesgateway.statusaddress.hostname=example.net

service

Optional

The Kubernetes service to copy status addresses from. When using third parties tools like External-DNS, this option can be used to copy the service loadbalancer.status (containing the service’s endpoints IPs) to the gateways.

File (YAML)

providers:
  kubernetesGateway:
    statusAddress:
      service:
        namespace: default
        name: foo
    # ...

File (TOML)

[providers.kubernetesGateway.statusAddress.service]
  namespace = "default"
  name = "foo"
  # ...

CLI

--providers.kubernetesgateway.statusaddress.service.namespace=default
--providers.kubernetesgateway.statusaddress.service.name=foo

experimentalChannel

Optional, Default: false

Toggles support for the Experimental Channel resources (Gateway API release channels documentation). This option currently enables support for TCPRoute and TLSRoute.

File (YAML)

providers:
  kubernetesGateway:
    experimentalChannel: true

File (TOML)

[providers.kubernetesGateway]
    experimentalChannel = true
  # ...

CLI

--providers.kubernetesgateway.experimentalchannel=true

labelselector

Optional, Default: “”

A label selector can be defined to filter on specific GatewayClass objects only. If left empty, Traefik processes all GatewayClass objects in the configured namespaces.

See label-selectors for details.

File (YAML)

providers:
  kubernetesGateway:
    labelselector: "app=traefik"
    # ...

File (TOML)

[providers.kubernetesGateway]
  labelselector = "app=traefik"
  # ...

CLI

--providers.kubernetesgateway.labelselector="app=traefik"

throttleDuration

Optional, Default: 0

The throttleDuration option defines how often the provider is allowed to handle events from Kubernetes. This prevents a Kubernetes cluster that updates many times per second from continuously changing your Traefik configuration.

If left empty, the provider does not apply any throttling and does not drop any Kubernetes events.

The value of throttleDuration should be provided in seconds or as a valid duration format, see time.ParseDuration.

File (YAML)

providers:
  kubernetesGateway:
    throttleDuration: "10s"
    # ...

File (TOML)

[providers.kubernetesGateway]
  throttleDuration = "10s"
  # ...

CLI

--providers.kubernetesgateway.throttleDuration=10s

Using Traefik for Business Applications?

If you are using Traefik in your organization, consider our enterprise-grade solutions:

These tools help businesses discover, deploy, secure, and manage microservices and APIs easily, at scale, across any environment.