---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    controller-gen.kubebuilder.io/version: v0.17.3
  labels:
    app: kgateway
    app.kubernetes.io/name: kgateway
  name: backendconfigpolicies.gateway.kgateway.dev
spec:
  group: gateway.kgateway.dev
  names:
    categories:
      - kgateway
    kind: BackendConfigPolicy
    listKind: BackendConfigPolicyList
    plural: backendconfigpolicies
    singular: backendconfigpolicy
  scope: Namespaced
  versions:
    - name: v1alpha1
      schema:
        openAPIV3Schema:
          properties:
            apiVersion:
              type: string
            kind:
              type: string
            metadata:
              type: object
            spec:
              properties:
                commonHttpProtocolOptions:
                  properties:
                    idleTimeout:
                      type: string
                      x-kubernetes-validations:
                        - message: idleTimeout must be a valid duration string
                          rule: duration(self) >= duration('0s')
                    maxHeadersCount:
                      type: integer
                    maxRequestsPerConnection:
                      type: integer
                    maxStreamDuration:
                      type: string
                      x-kubernetes-validations:
                        - message: maxStreamDuration must be a valid duration string
                          rule: duration(self) >= duration('0s')
                  type: object
                  x-kubernetes-validations:
                    - message: idleTimeout must be a valid duration string (e.g. "1s", "500ms")
                      rule: (!has(self.idleTimeout) || (has(self.idleTimeout) && self.idleTimeout.matches('^([0-9]{1,5}(h|m|s|ms)){1,4}$')))
                    - message: maxStreamDuration must be a valid duration string (e.g. "1s", "500ms")
                      rule: (!has(self.maxStreamDuration) || (has(self.maxStreamDuration) && self.maxStreamDuration.matches('^([0-9]{1,5}(h|m|s|ms)){1,4}$')))
                connectTimeout:
                  type: string
                  x-kubernetes-validations:
                    - message: connectTimeout must be a valid duration string
                      rule: duration(self) >= duration('0s')
                http1ProtocolOptions:
                  properties:
                    enableTrailers:
                      type: boolean
                    headerFormat:
                      enum:
                        - ProperCaseHeaderKeyFormat
                        - PreserveCaseHeaderKeyFormat
                      type: string
                    overrideStreamErrorOnInvalidHttpMessage:
                      type: boolean
                  type: object
                loadBalancer:
                  properties:
                    closeConnectionsOnHostSetChange:
                      type: boolean
                    healthyPanicThreshold:
                      format: int32
                      maximum: 100
                      minimum: 0
                      type: integer
                    leastRequest:
                      properties:
                        choiceCount:
                          default: 2
                          format: int32
                          type: integer
                        slowStart:
                          properties:
                            aggression:
                              type: string
                              x-kubernetes-validations:
                                - message: Aggression, if specified, must be a string representing a number greater than 0.0
                                  rule: self == "" || (self.matches('^-?(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)$') && double(self) > 0.0)
                            minWeightPercent:
                              format: int32
                              type: integer
                            window:
                              type: string
                              x-kubernetes-validations:
                                - message: window must be a valid duration string
                                  rule: duration(self) >= duration('0s')
                          type: object
                      type: object
                    localityType:
                      enum:
                        - WeightedLb
                      type: string
                    maglev:
                      type: object
                    random:
                      type: object
                    ringHash:
                      properties:
                        maximumRingSize:
                          format: int64
                          type: integer
                        minimumRingSize:
                          format: int64
                          type: integer
                      type: object
                    roundRobin:
                      properties:
                        slowStart:
                          properties:
                            aggression:
                              type: string
                              x-kubernetes-validations:
                                - message: Aggression, if specified, must be a string representing a number greater than 0.0
                                  rule: self == "" || (self.matches('^-?(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)$') && double(self) > 0.0)
                            minWeightPercent:
                              format: int32
                              type: integer
                            window:
                              type: string
                              x-kubernetes-validations:
                                - message: window must be a valid duration string
                                  rule: duration(self) >= duration('0s')
                          type: object
                      type: object
                    updateMergeWindow:
                      type: string
                      x-kubernetes-validations:
                        - message: updateMergeWindow must be a valid duration string
                          rule: duration(self) >= duration('0s')
                    useHostnameForHashing:
                      default: false
                      type: boolean
                  type: object
                  x-kubernetes-validations:
                    - message: only one of leastRequest, roundRobin, ringHash, maglev, or random can be set
                      rule: '[has(self.leastRequest), has(self.roundRobin), has(self.ringHash), has(self.maglev), has(self.random)].filter(x, x).size() <= 1'
                perConnectionBufferLimitBytes:
                  type: integer
                targetRefs:
                  items:
                    properties:
                      group:
                        maxLength: 253
                        pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
                        type: string
                      kind:
                        maxLength: 63
                        minLength: 1
                        pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
                        type: string
                      name:
                        maxLength: 253
                        minLength: 1
                        type: string
                    required:
                      - group
                      - kind
                      - name
                    type: object
                  maxItems: 16
                  minItems: 1
                  type: array
                targetSelectors:
                  items:
                    properties:
                      group:
                        maxLength: 253
                        pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
                        type: string
                      kind:
                        maxLength: 63
                        minLength: 1
                        pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
                        type: string
                      matchLabels:
                        additionalProperties:
                          type: string
                        type: object
                    required:
                      - group
                      - kind
                      - matchLabels
                    type: object
                  type: array
                tcpKeepalive:
                  properties:
                    keepAliveInterval:
                      type: string
                      x-kubernetes-validations:
                        - message: keepAliveInterval must be a valid duration string
                          rule: duration(self) >= duration('0s')
                        - message: keepAliveInterval must be at least 1 second
                          rule: duration(self) >= duration('1s')
                    keepAliveProbes:
                      type: integer
                    keepAliveTime:
                      type: string
                      x-kubernetes-validations:
                        - message: keepAliveTime must be a valid duration string
                          rule: duration(self) >= duration('0s')
                        - message: keepAliveTime must be at least 1 second
                          rule: duration(self) >= duration('1s')
                  type: object
                tls:
                  properties:
                    allowRenegotiation:
                      type: boolean
                    alpnProtocols:
                      items:
                        type: string
                      type: array
                    oneWayTLS:
                      type: boolean
                    parameters:
                      properties:
                        cipherSuites:
                          items:
                            type: string
                          type: array
                        ecdhCurves:
                          items:
                            type: string
                          type: array
                        tlsMaxVersion:
                          enum:
                            - AUTO
                            - "1.0"
                            - "1.1"
                            - "1.2"
                            - "1.3"
                          type: string
                        tlsMinVersion:
                          enum:
                            - AUTO
                            - "1.0"
                            - "1.1"
                            - "1.2"
                            - "1.3"
                          type: string
                      type: object
                    secretRef:
                      properties:
                        name:
                          default: ""
                          type: string
                      type: object
                      x-kubernetes-map-type: atomic
                    sni:
                      type: string
                    tlsFiles:
                      properties:
                        rootCA:
                          type: string
                        tlsCertificate:
                          type: string
                        tlsKey:
                          type: string
                      type: object
                      x-kubernetes-validations:
                        - message: At least one of tlsCertificate, tlsKey, or rootCA must be set in TLSFiles
                          rule: has(self.tlsCertificate) || has(self.tlsKey) || has(self.rootCA)
                    verifySubjectAltName:
                      items:
                        type: string
                      type: array
                  type: object
                  x-kubernetes-validations:
                    - message: Exactly one of secretRef or tlsFiles must be set in TLS
                      rule: has(self.secretRef) != has(self.tlsFiles)
              type: object
            status:
              properties:
                ancestors:
                  items:
                    properties:
                      ancestorRef:
                        properties:
                          group:
                            default: gateway.networking.k8s.io
                            maxLength: 253
                            pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
                            type: string
                          kind:
                            default: Gateway
                            maxLength: 63
                            minLength: 1
                            pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
                            type: string
                          name:
                            maxLength: 253
                            minLength: 1
                            type: string
                          namespace:
                            maxLength: 63
                            minLength: 1
                            pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
                            type: string
                          port:
                            format: int32
                            maximum: 65535
                            minimum: 1
                            type: integer
                          sectionName:
                            maxLength: 253
                            minLength: 1
                            pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
                            type: string
                        required:
                          - name
                        type: object
                      conditions:
                        items:
                          properties:
                            lastTransitionTime:
                              format: date-time
                              type: string
                            message:
                              maxLength: 32768
                              type: string
                            observedGeneration:
                              format: int64
                              minimum: 0
                              type: integer
                            reason:
                              maxLength: 1024
                              minLength: 1
                              pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
                              type: string
                            status:
                              enum:
                                - "True"
                                - "False"
                                - Unknown
                              type: string
                            type:
                              maxLength: 316
                              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])$
                              type: string
                          required:
                            - lastTransitionTime
                            - message
                            - reason
                            - status
                            - type
                          type: object
                        maxItems: 8
                        minItems: 1
                        type: array
                        x-kubernetes-list-map-keys:
                          - type
                        x-kubernetes-list-type: map
                      controllerName:
                        maxLength: 253
                        minLength: 1
                        pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$
                        type: string
                    required:
                      - ancestorRef
                      - controllerName
                    type: object
                  maxItems: 16
                  type: array
              required:
                - ancestors
              type: object
          type: object
      served: true
      storage: true
      subresources:
        status: {}
