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:

nix
helm install haproxy-kubernetes-ingress haproxytech/kubernetes-ingress \
--create-namespace \
--namespace haproxy-controller \
--set controller.imageCredentials.registry=kubernetes-registry.haproxy.com \
--set controller.imageCredentials.username=<KEY> \
--set controller.imageCredentials.password=<KEY> \
--set controller.image.repository=kubernetes-registry.haproxy.com/hapee-ingress \
--set controller.image.tag=v1.11 \
--set controller.service.type=LoadBalancer
nix
helm install haproxy-kubernetes-ingress haproxytech/kubernetes-ingress \
--create-namespace \
--namespace haproxy-controller \
--set controller.imageCredentials.registry=kubernetes-registry.haproxy.com \
--set controller.imageCredentials.username=<KEY> \
--set controller.imageCredentials.password=<KEY> \
--set controller.image.repository=kubernetes-registry.haproxy.com/hapee-ingress \
--set controller.image.tag=v1.11 \
--set controller.service.type=LoadBalancer

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.yaml
yaml
controller:
service:
type: LoadBalancer
image:
repository: kubernetes-registry.haproxy.com/hapee-ingress
tag: v1.11
imageCredentials:
registry: kubernetes-registry.haproxy.com
username: <KEY>
password: <KEY>
values.yaml
yaml
controller:
service:
type: LoadBalancer
image:
repository: kubernetes-registry.haproxy.com/hapee-ingress
tag: v1.11
imageCredentials:
registry: kubernetes-registry.haproxy.com
username: <KEY>
password: <KEY>
nix
helm install -f values.yaml haproxy-kubernetes-ingress haproxytech/kubernetes-ingress \
--create-namespace \
--namespace haproxy-controller
nix
helm 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:

nix
helm 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"
nix
helm 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

nix
helm install -f values.yaml haproxy-kubernetes-ingress haproxytech/kubernetes-ingress
nix
helm install -f values.yaml haproxy-kubernetes-ingress haproxytech/kubernetes-ingress

with the following values.yaml file:

values.yaml
yaml
controller:
kind: DaemonSet
ingressClass: haproxy
service:
type: LoadBalancer
annotations:
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.yaml
yaml
controller:
kind: DaemonSet
ingressClass: haproxy
service:
type: LoadBalancer
annotations:
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.yaml
yaml
controller:
service:
tcpPorts:
- name: mysql
port: 3306
targetPort: 3306
protocol: TCP
extraArgs:
- --configmap-tcp-services=default/tcp
values.yaml
yaml
controller:
service:
tcpPorts:
- name: mysql
port: 3306
targetPort: 3306
protocol: TCP
extraArgs:
- --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:

nix
helm install haproxy-kubernetes-ingress haproxytech/kubernetes-ingress --set-string "controller.extraArgs={--configmap-tcp-services=default/tcp}"
nix
helm install haproxy-kubernetes-ingress haproxytech/kubernetes-ingress --set-string "controller.extraArgs={--configmap-tcp-services=default/tcp}"

becomes

nix
helm install -f values.yaml haproxy-kubernetes-ingress haproxytech/kubernetes-ingress
nix
helm 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

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