Configuration reference

Validation Rules CRD

Selected version

Validation Rules CRD Configuration reference

Available since version 3.2

With user-defined annotations, you can extend the functionality of HAProxy Kubernetes Ingress Controller in custom ways. User-defined annotations attach to the metadata of your Kubernetes resources and are translated into one or many lines of HAProxy configuration. They can be simple, but they can also enable advanced use cases through templating expressions. You can restrict which namespaces, resource kinds, and configuration sections your annotations are available to; and you can define validation logic that ensures users set your annotations correctly.

Prerequisites Jump to heading

Info

If you installed the ingress controller with Helm, this CRD is installed and updated automatically. If you installed with kubectl, follow these instructions for installation. Once installed, to perform updates on this CRD, see Update CRDs on AWS or Update CRDs on premises.

Before you can use the Backend custom resource, you must install its definition into your Kubernetes cluster.

  1. Download the v3-2 Validationrules custom resource file.

  2. Install the custom resource definition with kubectl apply:

    Enterprise ingress controller

    nix
    kubectl apply -f ingress.v3.haproxy.org_validationrules.yaml
    nix
    kubectl apply -f ingress.v3.haproxy.org_validationrules.yaml
  3. Verify that the installation worked by listing custom resources defined in your cluster:

    nix
    kubectl get crd
    nix
    kubectl get crd
    output
    text
    NAME CREATED AT
    validationrules.ingress.v3.haproxy.com 2022-01-21T20:00:31Z
    output
    text
    NAME CREATED AT
    validationrules.ingress.v3.haproxy.com 2022-01-21T20:00:31Z
    output
    text
    NAME CREATED AT
    validationrules.core.haproxy.org 2022-01-21T20:00:31Z
    output
    text
    NAME CREATED AT
    validationrules.core.haproxy.org 2022-01-21T20:00:31Z
    output
    text
    NAME CREATED AT
    validationrules.core.haproxy.org 2022-01-21T20:00:31Z
    output
    text
    NAME CREATED AT
    validationrules.core.haproxy.org 2022-01-21T20:00:31Z
    output
    text
    NAME CREATED AT
    validationrules.core.haproxy.org 2022-01-21T20:00:31Z
    output
    text
    NAME CREATED AT
    validationrules.core.haproxy.org 2022-01-21T20:00:31Z
    output
    text
    NAME CREATED AT
    validationrules.core.haproxy.org 2022-01-21T20:00:31Z
    output
    text
    NAME CREATED AT
    validationrules.core.haproxy.org 2022-01-21T20:00:31Z

Properties

  • CRD version: 3.2
  • API version: ingress.v3.haproxy.org/v3

ingresses

[array]
apiVersion: "ingress.v3.haproxy.org/v3"
kind: ValidationRules
metadata:
  name: example-annotations
  namespace: haproxy-controller
spec:
  prefix: "example.com"
  validation_rules:
    example-annotation:
      ingresses: Array of String 

namespaces

[array]
apiVersion: "ingress.v3.haproxy.org/v3"
kind: ValidationRules
metadata:
  name: example-annotations
  namespace: haproxy-controller
spec:
  prefix: "example.com"
  validation_rules:
    example-annotation:
      namespaces: Array of String 

order_priority

[integer]
apiVersion: "ingress.v3.haproxy.org/v3"
kind: ValidationRules
metadata:
  name: example-annotations
  namespace: haproxy-controller
spec:
  prefix: "example.com"
  validation_rules:
    example-annotation:
      order_priority: Integer 

resources

[array]
apiVersion: "ingress.v3.haproxy.org/v3"
kind: ValidationRules
metadata:
  name: example-annotations
  namespace: haproxy-controller
spec:
  prefix: "example.com"
  validation_rules:
    example-annotation:
      resources: Array of String 

rule

[string]
apiVersion: "ingress.v3.haproxy.org/v3"
kind: ValidationRules
metadata:
  name: example-annotations
  namespace: haproxy-controller
spec:
  prefix: "example.com"
  validation_rules:
    example-annotation:
      rule: String 

section

[string]
apiVersion: "ingress.v3.haproxy.org/v3"
kind: ValidationRules
metadata:
  name: example-annotations
  namespace: haproxy-controller
spec:
  prefix: "example.com"
  validation_rules:
    example-annotation:
      section: String # Allowed values are frontend, backend, all

template

[string]
apiVersion: "ingress.v3.haproxy.org/v3"
kind: ValidationRules
metadata:
  name: example-annotations
  namespace: haproxy-controller
spec:
  prefix: "example.com"
  validation_rules:
    example-annotation:
      template: String 

type

[string]
apiVersion: "ingress.v3.haproxy.org/v3"
kind: ValidationRules
metadata:
  name: example-annotations
  namespace: haproxy-controller
spec:
  prefix: "example.com"
  validation_rules:
    example-annotation:
      type: String # Allowed values are duration, int, uint, bool, string, float, json

Do you have any suggestions on how we can improve the content of this page?