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:
-
Create a YAML file that declares a
Defaults
resource and add properties to itsspec.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.example-defaults.yaml
apiVersion: "core.haproxy.org/v1alpha1" kind: Defaults metadata: name: example-defaults namespace: default spec: config: client_timeout: 10000
-
Deploy it to your cluster using
kubectl apply
.$ kubectl apply -f example-defaults.yaml
-
Create a new ConfigMap with the name
haproxy-kubernetes-ingress
to override the one that ships with the ingress controller. Add thecr-defaults
key to thedata
section to implement the defaults.example-configmap.yaml
apiVersion: v1 kind: ConfigMap metadata: name: haproxy-kubernetes-ingress namespace: haproxy-controller data: cr-defaults: default/example-defaults
-
Update the ConfigMap in your cluster by using
kubectl apply
.$ kubectl apply -f example-configmap.yaml
Next up
Defaults custom resource reference