HAProxy Enterprise Kubernetes Ingress Controller Documentation 1.8

Use the Defaults custom resource

With the Defaults custom resource, you can manage default load balancer settings that apply to all services. To use it:

  1. Create a YAML file that declares a Defaults resource and add properties to its spec.config section.

    In the example below, the client_timeout property sets how many milliseconds the ingress controller will wait for an inactive client to respond.


    apiVersion: "core.haproxy.org/v1alpha1"
    kind: Defaults
      name: example-defaults
      namespace: default
        client_timeout: 10000
  2. Deploy it to your cluster using kubectl apply.

    $ kubectl apply -f example-defaults.yaml
  3. Create a new ConfigMap with the name haproxy-kubernetes-ingress to override the one that ships with the ingress controller. Add the cr-defaults key to the data section to implement the defaults.


    apiVersion: v1
    kind: ConfigMap
      name: haproxy-kubernetes-ingress
      namespace: haproxy-controller
      cr-defaults: default/example-defaults
  4. Update the ConfigMap in your cluster by using kubectl apply.

    $ kubectl apply -f  example-configmap.yaml

Next up

Defaults custom resource reference
HAProxyConf 2022 - Call for papers