HAProxy Ingress Controller installation
The HAProxy Ingress Controller is installed using the Official Helm Chart with the configuration below. In the example, the Ingress controller is identified as type: NodePort
(this allows the ODBC exposition). The HA can be achieved in 2 ways: either by using DaemonSet
or by using three replicas for deployment with node anti-affinity to ensure that the pods will be deployed on separate Kubernetes nodes.
## Controller Service configuration
## ref: https://kubernetes.io/docs/concepts/services-networking/service/
service:
enabled: true # set to false when controller.kind is 'DaemonSet' and
controller.daemonset.useHostPorts is true
type: NodePort # can be 'ClusterIP', 'NodePort' or 'LoadBalancer'
In the next example, ingressClass
is specified as haproxy
. This allows the MarkLogic Ingress to be managed using the HAProxy Ingress Controller.
## IngressClass: ## Ref: https://github.com/haproxytech/kubernetes-ingress/blob/master/ documentation/ingressclass.md # k8s >= 1.18: IngressClass resource used, in multi-Ingress environments, to select Ingress resources to implement. # ref: https://kubernetes.io/docs/concepts/services-networking/ingress/ #ingress-class # ref: https://kubernetes.io/docs/concepts/services-networking/ingress/ #default-ingress-class # Note: Uses ingressClass as name for the Ingress Class object if enabled ingressClassResource: name: haproxy default: true parameters: {} # k8s < 1.18: Ingress Class used, in multi-Ingress environments, for ingress.class annotation to select Ingress resources to implement. # k8s >= 1.18: Ingress Class used to target specific HAProxy Ingress Controller in multi-Ingress envionments # ref: https://kubernetes.io/docs/concepts/services-networking/ ingress-controllers/#using-multiple-ingress-controllers ingressClass: "haproxy" # typically "haproxy" or null to receive all eventscode needs to be inserted here
In the next example, the config:stats-config-snippet
configuration allows basic authentication for the statistic page exposed. request-capture
is used to capture the host and user agent from the user request.
config: # timeout-connect: "250ms" # servers-increment: "10" # servers-increment-max-disabled: "10" # rate-limit: "ON" # rate-limit-expire: "1m" # rate-limit-interval: "10s" # rate-limit-size: "100k" stats-config-snippet: | stats auth ml-admin:ml-admin2022 request-capture: | hdr(Host) hdr(User-Agent)Code needs to be inserted here