Configuration reference
Helm values files
When installing and configuring HAProxy Kubernetes Ingress Controller with Helm, instead of using many --set invocations, you can use a values file to define configuration value overrides. These values files can be used on initial installation, as well as on helm upgrade commands where you are changing your configuration post-installation. Note that when using a values file, that the command line --set invocations take precedence over the values in the values file.
Use a values file for --set invocations Jump to heading
Consider the following Helm installation command where we are setting some additional parameters using --set:
nixhelm install haproxy-kubernetes-ingress haproxytech/kubernetes-ingress \--create-namespace \--namespace haproxy-controller \--set controller.service.nodePorts.http=30000 \--set controller.service.nodePorts.https=30001 \--set controller.service.nodePorts.stat=30002 \--set controller.service.nodePorts.prometheus=30003
nixhelm install haproxy-kubernetes-ingress haproxytech/kubernetes-ingress \--create-namespace \--namespace haproxy-controller \--set controller.service.nodePorts.http=30000 \--set controller.service.nodePorts.https=30001 \--set controller.service.nodePorts.stat=30002 \--set controller.service.nodePorts.prometheus=30003
We can instead place these parameters into a values file named values.yaml and provide this file to the helm install command with -f.
values.yamlyamlcontroller:service:nodePorts:http: 30000https: 30001stat: 30002
values.yamlyamlcontroller:service:nodePorts:http: 30000https: 30001stat: 30002
nixhelm install -f values.yaml haproxy-kubernetes-ingress haproxytech/kubernetes-ingress \--create-namespace \--namespace haproxy-controller
nixhelm install -f values.yaml haproxy-kubernetes-ingress haproxytech/kubernetes-ingress \--create-namespace \--namespace haproxy-controller
Use a values file for service annotations Jump to heading
You can also provide values for service annotations.
For example, the following helm install command:
nixhelm install haproxy-kubernetes-ingress haproxytech/kubernetes-ingress \--set controller.kind=DaemonSet \--set controller.ingressClass=haproxy \--set controller.service.type=LoadBalancer \--set controller.service.annotations."service\.beta\.kubernetes\.io/aws-load-balancer-cross-zone-load-balancing-enabled"="true" \--set controller.service.annotations."service\.beta\.kubernetes\.io/aws-load-balancer-internal"="0.0.0.0/0"
nixhelm install haproxy-kubernetes-ingress haproxytech/kubernetes-ingress \--set controller.kind=DaemonSet \--set controller.ingressClass=haproxy \--set controller.service.type=LoadBalancer \--set controller.service.annotations."service\.beta\.kubernetes\.io/aws-load-balancer-cross-zone-load-balancing-enabled"="true" \--set controller.service.annotations."service\.beta\.kubernetes\.io/aws-load-balancer-internal"="0.0.0.0/0"
becomes
nixhelm install -f values.yaml haproxy-kubernetes-ingress haproxytech/kubernetes-ingress
nixhelm install -f values.yaml haproxy-kubernetes-ingress haproxytech/kubernetes-ingress
with the following values.yaml file:
values.yamlyamlcontroller:kind: DaemonSetingressClass: haproxyservice:type: LoadBalancerannotations:service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: "true"service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0
values.yamlyamlcontroller:kind: DaemonSetingressClass: haproxyservice:type: LoadBalancerannotations:service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: "true"service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0
Use a values file for startup arguments Jump to heading
You can use the controller.extraArgs field in a values file to provide startup arguments to the ingress controller.
For example, to specify the name of the ConfigMap used for load balancing TCP services:
values.yamlyamlcontroller:service:tcpPorts:- name: mysqlport: 3306targetPort: 3306protocol: TCPextraArgs:- --configmap-tcp-services=default/tcp
values.yamlyamlcontroller:service:tcpPorts:- name: mysqlport: 3306targetPort: 3306protocol: TCPextraArgs:- --configmap-tcp-services=default/tcp
Note that the ConfigMap must exist before calling helm install.
Using the values file this way, this helm install command:
nixhelm install haproxy-kubernetes-ingress haproxytech/kubernetes-ingress --set-string "controller.extraArgs={--configmap-tcp-services=default/tcp}"
nixhelm install haproxy-kubernetes-ingress haproxytech/kubernetes-ingress --set-string "controller.extraArgs={--configmap-tcp-services=default/tcp}"
becomes
nixhelm install -f values.yaml haproxy-kubernetes-ingress haproxytech/kubernetes-ingress
nixhelm install -f values.yaml haproxy-kubernetes-ingress haproxytech/kubernetes-ingress
Note that you can define your TCP ports in the values file as well. For more information see: load balance TCP services.
See also Jump to heading
- For an example for TCP services, see Load balance TCP services.
- For an auxiliary configuration file example, see Auxiliary configuration files.
- For more information on the Helm values file, see the Helm website.
Do you have any suggestions on how we can improve the content of this page?