---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: backends.core.haproxy.org
spec:
  group: core.haproxy.org
  names:
    kind: Backend
    plural: backends
  scope: Namespaced
  versions:
    - name: v1alpha2
      served: true
      storage: true
      schema:
        openAPIV3Schema:
          type: object
          properties:
            spec:
              type: object
              properties:
                config:
                  title: Backend
                  description: HAProxy backend configuration
                  type: object
                  properties:
                    abortonclose:
                      type: string
                      enum:
                        - enabled
                        - disabled
                    accept_invalid_http_response:
                      type: string
                      enum:
                        - enabled
                        - disabled
                    adv_check:
                      type: string
                      enum:
                        - ssl-hello-chk
                        - smtpchk
                        - ldap-check
                        - mysql-check
                        - pgsql-check
                        - tcp-check
                        - redis-check
                        - httpchk
                    allbackups:
                      type: string
                      enum:
                        - enabled
                        - disabled
                    balance:
                      type: object
                      required:
                        - algorithm
                      properties:
                        algorithm:
                          type: string
                          enum:
                            - roundrobin
                            - static-rr
                            - leastconn
                            - first
                            - source
                            - uri
                            - url_param
                            - hdr
                            - random
                            - rdp-cookie
                        hdr_name:
                          type: string
                        hdr_use_domain_only:
                          type: boolean
                        random_draws:
                          type: integer
                        rdp_cookie_name:
                          type: string
                          pattern: ^[^\s]+$
                        uri_depth:
                          type: integer
                        uri_len:
                          type: integer
                        uri_path_only:
                          type: boolean
                        uri_whole:
                          type: boolean
                        url_param:
                          type: string
                          pattern: ^[^\s]+$
                        url_param_check_post:
                          type: integer
                        url_param_max_wait:
                          type: integer
                    bind_process:
                      type: string
                      pattern: ^[^\s]+$
                    check_timeout:
                      type: integer
                      nullable: true
                    compression:
                      type: object
                      properties:
                        algorithms:
                          type: array
                          items:
                            type: string
                            enum:
                              - identity
                              - gzip
                              - deflate
                              - raw-deflate
                        offload:
                          type: boolean
                        types:
                          type: array
                          items:
                            type: string
                    connect_timeout:
                      type: integer
                      nullable: true
                    cookie:
                      type: object
                      required:
                        - name
                      properties:
                        domain:
                          type: array
                          items:
                            type: object
                            properties:
                              value:
                                type: string
                                pattern: ^[^\s]+$
                        dynamic:
                          type: boolean
                        httponly:
                          type: boolean
                        indirect:
                          type: boolean
                        maxidle:
                          type: integer
                        maxlife:
                          type: integer
                        name:
                          type: string
                          pattern: ^[^\s]+$
                        nocache:
                          type: boolean
                        postonly:
                          type: boolean
                        preserve:
                          type: boolean
                        secure:
                          type: boolean
                        type:
                          type: string
                          enum:
                            - rewrite
                            - insert
                            - prefix
                    default_server:
                      type: object
                      title: Default Server
                      properties:
                        address:
                          type: string
                          pattern: ^[^\s]+$
                        agent-addr:
                          type: string
                          pattern: ^[^\s]+$
                        agent-check:
                          type: string
                          enum:
                            - enabled
                            - disabled
                        agent-inter:
                          type: integer
                          nullable: true
                        agent-port:
                          type: integer
                          maximum: 65535
                          minimum: 1
                          nullable: true
                        agent-send:
                          type: string
                        allow_0rtt:
                          type: boolean
                        alpn:
                          type: string
                          pattern: ^[^\s]+$
                        backup:
                          type: string
                          enum:
                            - enabled
                            - disabled
                        ca_file:
                          type: string
                        check:
                          type: string
                          enum:
                            - enabled
                            - disabled
                        check-send-proxy:
                          type: string
                          enum:
                            - enabled
                            - disabled
                        check-sni:
                          type: string
                          pattern: ^[^\s]+$
                        check-ssl:
                          type: string
                          enum:
                            - enabled
                            - disabled
                        check_alpn:
                          type: string
                          pattern: ^[^\s]+$
                        check_proto:
                          type: string
                          pattern: ^[^\s]+$
                        check_via_socks4:
                          type: string
                          enum:
                            - enabled
                            - disabled
                        ciphers:
                          type: string
                        ciphersuites:
                          type: string
                        cookie:
                          type: string
                          pattern: ^[^\s]+$
                        crl_file:
                          type: string
                        disabled:
                          type: string
                          enum:
                            - enabled
                            - disabled
                        downinter:
                          type: integer
                          nullable: true
                        enabled:
                          type: string
                          enum:
                            - enabled
                            - disabled
                        error_limit:
                          type: integer
                        fall:
                          type: integer
                          nullable: true
                        fastinter:
                          type: integer
                          nullable: true
                        force_sslv3:
                          type: string
                          enum:
                            - enabled
                            - disabled
                        force_tlsv10:
                          type: string
                          enum:
                            - enabled
                            - disabled
                        force_tlsv11:
                          type: string
                          enum:
                            - enabled
                            - disabled
                        force_tlsv12:
                          type: string
                          enum:
                            - enabled
                            - disabled
                        force_tlsv13:
                          type: string
                          enum:
                            - enabled
                            - disabled
                        health_check_port:
                          type: integer
                          maximum: 65535
                          minimum: 1
                          nullable: true
                        init-addr:
                          type: string
                          pattern: ^[^\s]+$
                        inter:
                          type: integer
                          nullable: true
                        log_proto:
                          type: string
                          enum:
                            - legacy
                            - octet-count
                        max_reuse:
                          type: integer
                          nullable: true
                        maxconn:
                          type: integer
                          nullable: true
                        maxqueue:
                          type: integer
                          nullable: true
                        minconn:
                          type: integer
                          nullable: true
                        name:
                          type: string
                          pattern: ^[^\s]+$
                        namespace:
                          type: string
                        no_sslv3:
                          type: string
                          enum:
                            - enabled
                            - disabled
                        no_tlsv10:
                          type: string
                          enum:
                            - enabled
                            - disabled
                        no_tlsv11:
                          type: string
                          enum:
                            - enabled
                            - disabled
                        no_tlsv12:
                          type: string
                          enum:
                            - enabled
                            - disabled
                        no_tlsv13:
                          type: string
                          enum:
                            - enabled
                            - disabled
                        no_verifyhost:
                          type: string
                          enum:
                            - enabled
                            - disabled
                        npn:
                          type: string
                        observe:
                          type: string
                          enum:
                            - layer4
                            - layer7
                        on-error:
                          type: string
                          enum:
                            - fastinter
                            - fail-check
                            - sudden-death
                            - mark-down
                        on-marked-down:
                          type: string
                          enum:
                            - shutdown-sessions
                        on-marked-up:
                          type: string
                          enum:
                            - shutdown-backup-sessions
                        pool_low_conn:
                          type: integer
                          nullable: true
                        pool_max_conn:
                          type: integer
                          nullable: true
                        pool_purge_delay:
                          type: integer
                          nullable: true
                        port:
                          type: integer
                          maximum: 65535
                          minimum: 1
                          nullable: true
                        proto:
                          type: string
                          pattern: ^[^\s]+$
                        proxy-v2-options:
                          type: array
                          items:
                            type: string
                            enum:
                              - ssl
                              - cert-cn
                              - ssl-cipher
                              - cert-sig
                              - cert-key
                              - authority
                              - crc32c
                              - unique-id
                        redir:
                          type: string
                        resolve-net:
                          type: string
                          pattern: ^[^\s]+$
                        resolve-prefer:
                          type: string
                          pattern: ^[^\s]+$
                          enum:
                            - ipv4
                            - ipv6
                        resolve_opts:
                          type: string
                          pattern: ^[^,\s][^\,]*[^,\s]*$
                        resolvers:
                          type: string
                          pattern: ^[^\s]+$
                        rise:
                          type: integer
                          nullable: true
                        send-proxy:
                          type: string
                          enum:
                            - enabled
                            - disabled
                        send-proxy-v2:
                          type: string
                          enum:
                            - enabled
                            - disabled
                        send_proxy_v2_ssl:
                          type: string
                          enum:
                            - enabled
                            - disabled
                        send_proxy_v2_ssl_cn:
                          type: string
                          enum:
                            - enabled
                            - disabled
                        slowstart:
                          type: integer
                          nullable: true
                        sni:
                          type: string
                          pattern: ^[^\s]+$
                        socks4:
                          type: string
                          pattern: ^[^\s]+$
                        source:
                          type: string
                        ssl:
                          type: string
                          enum:
                            - enabled
                            - disabled
                        ssl_certificate:
                          type: string
                          pattern: ^[^\s]+$
                        ssl_max_ver:
                          type: string
                          enum:
                            - SSLv3
                            - TLSv1.0
                            - TLSv1.1
                            - TLSv1.2
                            - TLSv1.3
                        ssl_min_ver:
                          type: string
                          enum:
                            - SSLv3
                            - TLSv1.0
                            - TLSv1.1
                            - TLSv1.2
                            - TLSv1.3
                        ssl_reuse:
                          type: string
                          enum:
                            - enabled
                            - disabled
                        stick:
                          type: string
                          enum:
                            - enabled
                            - disabled
                        tcp_ut:
                          type: integer
                        tfo:
                          type: string
                          enum:
                            - enabled
                            - disabled
                        tls_tickets:
                          type: string
                          enum:
                            - enabled
                            - disabled
                        track:
                          type: string
                        verify:
                          type: string
                          enum:
                            - none
                            - required
                        verifyhost:
                          type: string
                        weight:
                          type: integer
                          nullable: true
                    dynamic_cookie_key:
                      type: string
                      pattern: ^[^\s]+$
                    external_check:
                      type: string
                      enum:
                        - enabled
                        - disabled
                    external_check_command:
                      type: string
                      pattern: ^[^\s]+$
                    external_check_path:
                      type: string
                      pattern: ^[^\s]+$
                    forwardfor:
                      type: object
                      required:
                        - enabled
                      properties:
                        enabled:
                          type: string
                          enum:
                            - enabled
                        except:
                          type: string
                          pattern: ^[^\s]+$
                        header:
                          type: string
                          pattern: ^[^\s]+$
                        ifnone:
                          type: boolean
                    h1_case_adjust_bogus_server:
                      type: string
                      enum:
                        - enabled
                        - disabled
                    hash_type:
                      type: object
                      properties:
                        function:
                          type: string
                          enum:
                            - sdbm
                            - djb2
                            - wt6
                            - crc32
                        method:
                          type: string
                          enum:
                            - map-based
                            - consistent
                        modifier:
                          type: string
                          enum:
                            - avalanche
                    http-buffer-request:
                      type: string
                      enum:
                        - enabled
                        - disabled
                    http-check:
                      type: object
                      title: HTTP Check
                      required:
                        - index
                        - type
                      properties:
                        addr:
                          type: string
                          pattern: ^[^\s]+$
                        alpn:
                          type: string
                          pattern: ^[^\s]+$
                        body:
                          type: string
                        body_log_format:
                          type: string
                        check_comment:
                          type: string
                        default:
                          type: boolean
                        error_status:
                          type: string
                          enum:
                            - L7OKC
                            - L7RSP
                            - L7STS
                            - L6RSP
                            - L4CON
                        exclamation_mark:
                          type: boolean
                        headers:
                          type: array
                          items:
                            type: object
                            required:
                              - name
                              - fmt
                            properties:
                              fmt:
                                type: string
                              name:
                                type: string
                        index:
                          type: integer
                          nullable: true
                        linger:
                          type: boolean
                        match:
                          type: string
                          pattern: ^[^\s]+$
                          enum:
                            - status
                            - rstatus
                            - hdr
                            - fhdr
                            - string
                            - rstring
                        method:
                          type: string
                        min_recv:
                          type: integer
                          nullable: true
                        ok_status:
                          type: string
                          enum:
                            - L7OK
                            - L7OKC
                            - L6OK
                            - L4OK
                        on_error:
                          type: string
                        on_success:
                          type: string
                        pattern:
                          type: string
                        port:
                          type: integer
                          maximum: 65535
                          minimum: 1
                          nullable: true
                        port_string:
                          type: string
                        proto:
                          type: string
                        send_proxy:
                          type: boolean
                        sni:
                          type: string
                        ssl:
                          type: boolean
                        status-code:
                          type: string
                        tout_status:
                          type: string
                          enum:
                            - L7TOUT
                            - L6TOUT
                            - L4TOUT
                        type:
                          type: string
                          enum:
                            - comment
                            - connect
                            - disable-on-404
                            - expect
                            - send
                            - send-state
                            - set-var
                            - set-var-fmt
                            - unset-var
                        uri:
                          type: string
                        uri_log_format:
                          type: string
                        var_expr:
                          type: string
                        var_format:
                          type: string
                        var_name:
                          type: string
                          pattern: ^[^\s]+$
                        var_scope:
                          type: string
                          pattern: ^[^\s]+$
                        version:
                          type: string
                        via_socks4:
                          type: boolean
                    http-keep-alive:
                      type: string
                      enum:
                        - enabled
                        - disabled
                    http-no-delay:
                      type: string
                      enum:
                        - enabled
                        - disabled
                    http-server-close:
                      type: string
                      enum:
                        - enabled
                        - disabled
                    http-use-htx:
                      type: string
                      pattern: ^[^\s]+$
                      enum:
                        - enabled
                        - disabled
                    http_connection_mode:
                      type: string
                      enum:
                        - httpclose
                        - http-server-close
                        - http-keep-alive
                    http_keep_alive_timeout:
                      type: integer
                      nullable: true
                    http_pretend_keepalive:
                      type: string
                      enum:
                        - enabled
                        - disabled
                    http_proxy:
                      type: string
                      enum:
                        - enabled
                        - disabled
                    http_request_timeout:
                      type: integer
                      nullable: true
                    http_reuse:
                      type: string
                      enum:
                        - aggressive
                        - always
                        - never
                        - safe
                    httpchk_params:
                      type: object
                      properties:
                        method:
                          type: string
                          enum:
                            - HEAD
                            - PUT
                            - POST
                            - GET
                            - TRACE
                            - PATCH
                        uri:
                          type: string
                          pattern: ^[^ ]*$
                        version:
                          type: string
                    httpclose:
                      type: string
                      enum:
                        - enabled
                        - disabled
                    log_health_checks:
                      type: string
                      enum:
                        - enabled
                        - disabled
                    log_tag:
                      type: string
                      pattern: ^[^\s]+$
                    mode:
                      type: string
                      enum:
                        - http
                        - tcp
                    mysql_check_params:
                      type: object
                      properties:
                        client_version:
                          type: string
                          enum:
                            - pre-41
                            - post-41
                        username:
                          type: string
                    name:
                      type: string
                      pattern: ^[A-Za-z0-9-_.:]+$
                    pgsql_check_params:
                      type: object
                      properties:
                        username:
                          type: string
                    queue_timeout:
                      type: integer
                      nullable: true
                    redispatch:
                      type: object
                      required:
                        - enabled
                      properties:
                        enabled:
                          type: string
                          enum:
                            - enabled
                            - disabled
                        interval:
                          type: integer
                    retries:
                      type: integer
                      nullable: true
                    server_timeout:
                      type: integer
                      nullable: true
                    smtpchk_params:
                      type: object
                      properties:
                        domain:
                          type: string
                        hello:
                          type: string
                    srvtcpka:
                      type: string
                      enum:
                        - enabled
                        - disabled
                    stats_options:
                      type: object
                      properties:
                        stats_admin:
                          type: boolean
                        stats_admin_cond:
                          type: string
                          enum:
                            - if
                            - unless
                        stats_admin_cond_test:
                          type: string
                        stats_enable:
                          type: boolean
                        stats_hide_version:
                          type: boolean
                        stats_maxconn:
                          type: integer
                          minimum: 1
                        stats_refresh_delay:
                          type: integer
                          nullable: true
                        stats_show_desc:
                          type: string
                          nullable: true
                        stats_show_legends:
                          type: boolean
                        stats_show_node_name:
                          type: string
                          pattern: ^[^\s]+$
                          nullable: true
                        stats_uri_prefix:
                          type: string
                          pattern: ^[^\s]+$
                    stick_table:
                      type: object
                      properties:
                        expire:
                          type: integer
                          nullable: true
                        keylen:
                          type: integer
                          nullable: true
                        nopurge:
                          type: boolean
                        peers:
                          type: string
                          pattern: ^[^\s]+$
                        size:
                          type: integer
                          nullable: true
                        store:
                          type: string
                          pattern: ^[^\s]+$
                        type:
                          type: string
                          enum:
                            - ip
                            - ipv6
                            - integer
                            - string
                            - binary
                    tcpka:
                      type: string
                      enum:
                        - enabled
                        - disabled
                    tunnel_timeout:
                      type: integer
                      nullable: true
