HAProxy Enterprise Kubernetes Ingress Controller Documentation 1.8

Use the Global custom resource

With the Global custom resource, you can tune process-level options for the ingress controller. To use it:

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

    In the example below, the maxconn property limits how many concurrent TCP connections the ingress controller will accept.

    example-global.yaml

    apiVersion: "core.haproxy.org/v1alpha1"
    kind: Global
    metadata:
      name: example-global
      namespace: default
    spec:
      config:
        maxconn: 60000
  2. Deploy it to your cluster using kubectl apply.

    $ kubectl apply -f example-global.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-global key to the data section to implement the global properties.

    example-configmap.yaml

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

    $ kubectl apply -f  example-configmap.yaml
    

Next up

Global custom resource reference
HAProxyConf 2022 - Call for papers