### Configure startup argument Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/configuration-reference/startupargs Example of starting the controller with the --configmap-patternfiles argument. ```nix haproxy-ingress-controller --configmap-patternfiles=default/acl-patterns ``` -------------------------------- ### Installation Output Source: https://www.haproxy.com/documentation/kubernetes-ingress/enterprise/installation/install-on-amazon-eks/install-using-marketplace Example output confirming the successful deployment of the HAProxy Kubernetes Ingress Controller. ```text NAME: haproxy-kubernetes-ingress LAST DEPLOYED: Fri Mar 24 15:09:05 2023 NAMESPACE: haproxy-controller STATUS: deployed REVISION: 1 TEST SUITE: None NOTES: HAProxy Kubernetes Ingress Controller has been successfully installed. ``` -------------------------------- ### Install with --set parameters Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/configuration-reference/values Example of installing the HAProxy Kubernetes Ingress Controller using multiple --set flags for node port configuration. ```nix helm 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 ``` -------------------------------- ### Install with Helm --set flags Source: https://www.haproxy.com/documentation/kubernetes-ingress/enterprise/configuration-reference/values Example of installing the ingress controller using multiple --set flags to define image credentials and service type. ```nix helm install haproxy-kubernetes-ingress haproxytech/kubernetes-ingress \ --create-namespace \ --namespace haproxy-controller \ --set controller.imageCredentials.registry=registry.haproxy.com \ --set controller.imageCredentials.username= \ --set controller.imageCredentials.password= \ --set controller.image.repository=registry.haproxy.com/haproxytech/hapee-ingress \ --set controller.image.tag=v3.2 \ --set controller.service.type=LoadBalancer ``` -------------------------------- ### ConfigMap Output Example Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/configuration-reference/configmap Example output showing the list of available ConfigMaps. ```text NAME DATA AGE haproxy-kubernetes-ingress 0 13s ``` -------------------------------- ### Install using a values file Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/configuration-reference/values Command to install the controller using the configuration defined in a values.yaml file. ```nix helm install -f values.yaml haproxy-kubernetes-ingress haproxytech/kubernetes-ingress \ --create-namespace \ --namespace haproxy-controller ``` -------------------------------- ### Helm Upgrade Output Example Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/upgrade Example output confirming a successful Helm upgrade of the ingress controller. ```text Release "haproxy-kubernetes-ingress" has been upgraded. Happy Helming! NAME: haproxy-kubernetes-ingress LAST DEPLOYED: Fri Jan 19 21:30:16 2024 NAMESPACE: haproxy-controller STATUS: deployed REVISION: 2 TEST SUITE: None NOTES: HAProxy Kubernetes Ingress Controller has been successfully installed. Controller image deployed is: "haproxytech/kubernetes-ingress:1.10.10". [...] ``` ```text Release "haproxy-kubernetes-ingress" has been upgraded. Happy Helming! NAME: haproxy-kubernetes-ingress LAST DEPLOYED: Fri Jan 19 21:30:16 2024 NAMESPACE: haproxy-controller STATUS: deployed REVISION: 2 TEST SUITE: None NOTES: HAProxy Kubernetes Ingress Controller has been successfully installed. Controller image deployed is: "haproxytech/kubernetes-ingress:1.10.10". [...] ``` -------------------------------- ### Install the route package Source: https://www.haproxy.com/documentation/kubernetes-ingress/enterprise/installation/external-mode-on-premises Install the hapee-extras-route package on the ingress controller server. ```nix sudo apt install -y hapee-extras-route ``` -------------------------------- ### Server Template Configuration Example Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/crd/v3-2/ingress.v3.haproxy.org_backends.yaml Example of a server template definition used to initialize servers with shared parameters. ```json {"fqdn":"google.com","num_or_range":"1-3","port":80,"prefix":"srv"} ``` -------------------------------- ### Example deployment output Source: https://www.haproxy.com/documentation/kubernetes-ingress/administration/troubleshooting Expected output after applying the updated configuration. ```text namespace/haproxy-controller unchanged serviceaccount/haproxy-ingress-service-account unchanged clusterrole.rbac.authorization.k8s.io/haproxy-ingress-cluster-role configured [...] ``` ```text namespace/haproxy-controller unchanged serviceaccount/haproxy-ingress-service-account unchanged clusterrole.rbac.authorization.k8s.io/haproxy-ingress-cluster-role configured [...] ``` -------------------------------- ### Install using a values.yaml file Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/configuration-reference/values Apply configuration settings by referencing a values.yaml file during the Helm installation. ```nix helm install -f values.yaml haproxy-kubernetes-ingress haproxytech/kubernetes-ingress ``` -------------------------------- ### Service Output Example Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/installation/on-prem Example output showing the NodePort configuration for the HAProxy Ingress service. ```text NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE haproxy-kubernetes-ingress NodePort 10.97.154.7 80:30706/TCP,443:30675/TCP,1024:31441/TCP 32s ``` -------------------------------- ### Example Add-on Creation Output Source: https://www.haproxy.com/documentation/kubernetes-ingress/enterprise/installation/install-on-amazon-eks/install-using-marketplace The expected JSON response after successfully initiating the add-on creation process. ```json { "addon": { "addonName": "haproxy-kubernetes-ingress", "clusterName": "[Your cluster name]", "status": "CREATING", "addonVersion": "v1.97.0-eksbuild.1", "health": { "issues": [] }, "addonArn": "arn:aws:eks:$AWS_REGION:xxxxxxxxxxxx:addon/[Your cluster name]/haproxy-kubernetes-ingress/90c23198-cdd3-b295-c410-xxxxxxxxxxxx", "createdAt": "2022-12-01T12:18:26.497000-08:00", "modifiedAt": "2022-12-01T12:50:52.222000-08:00", "tags": {} } } ``` -------------------------------- ### Deployment Manifest Gateway Argument Source: https://www.haproxy.com/documentation/kubernetes-ingress/gateway-api/enable-gateway-api Example of the expected startup argument in the deployment specification. ```yaml apiVersion: apps/v1 kind: Deployment metadata: [...] name: haproxy-kubernetes-ingress namespace: haproxy-controller spec: [...] template: [...] spec: containers: - args: - --gateway-controller-name=haproxy.org/gateway-controller ``` -------------------------------- ### Example CRD Output Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/configuration-reference/validationrules-crd Expected output when listing the installed custom resource definitions. ```text NAME CREATED AT validationrules.ingress.v3.haproxy.org 2022-01-21T20:00:31Z ``` ```text NAME CREATED AT validationrules.core.haproxy.org 2022-01-21T20:00:31Z ``` -------------------------------- ### Install BIRD on Linux Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/installation/external-mode-on-premises Commands to add the BIRD repository and install the BIRD package on a Linux system. ```nix sudo add-apt-repository -y ppa:cz.nic-labs/bird sudo apt update sudo apt install bird ``` -------------------------------- ### Example Pod Output Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/upgrade Sample output showing the status of the ingress controller pod. ```text NAME READY STATUS RESTARTS AGE haproxy-kubernetes-ingress-59f7587966-9kjtv 1/1 Running 0 11m ``` -------------------------------- ### Configure from and guid Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/configuration-reference/frontend-crd Sets the source identifier and unique GUID for the frontend configuration. ```yaml apiVersion: "ingress.v3.haproxy.org/v3" kind: Frontend metadata: name: example-frontend-crd namespace: default spec: from: String # Allowed pattern: ^[A-Za-z0-9-_.:]+$ ``` ```yaml apiVersion: "ingress.v3.haproxy.org/v3" kind: Frontend metadata: name: example-frontend-crd namespace: default spec: guid: String # Allowed pattern: ^[A-Za-z0-9-_.:]+$ ``` -------------------------------- ### Install mkpasswd Tool Source: https://www.haproxy.com/documentation/kubernetes-ingress/administration/troubleshooting Install the mkpasswd utility required for generating password hashes for the HTTP endpoint. ```nix # mkpasswd is included in the whois package sudo apt install whois ``` ```nix sudo yum install mkpasswd ``` -------------------------------- ### Install Ingress Controller via OCI Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/installation/on-prem Installs the latest version of the ingress controller using the OCI registry. ```nix helm install haproxy-kubernetes-ingress oci://ghcr.io/haproxytech/helm-charts/kubernetes-ingress \ --create-namespace \ --namespace haproxy-controller ``` -------------------------------- ### Pod List Output Source: https://www.haproxy.com/documentation/kubernetes-ingress/ingress-tutorials/load-balance-tcp Example output showing the status of the BusyBox deployment pod. ```output NAME READY STATUS RESTARTS AGE busybox-deployment-6fbb645fd4-cfkwp 1/1 Running 0 12m ``` -------------------------------- ### Install HAProxy Ingress via Helm Source: https://www.haproxy.com/documentation/kubernetes-ingress/enterprise/installation/on-prem Use these commands to install the HAProxy Kubernetes Ingress controller with specific image credentials and tags. ```nix helm install haproxy-kubernetes-ingress haproxytech/kubernetes-ingress \ --create-namespace \ --namespace haproxy-controller \ --set controller.imageCredentials.registry=registry.haproxy.com \ --set controller.imageCredentials.username= \ --set controller.imageCredentials.password= \ --set controller.image.repository=registry.haproxy.com/haproxytech/hapee-ingress \ --set controller.image.tag=v3.2.12-ee3 ``` ```nix helm install haproxy-kubernetes-ingress oci://ghcr.io/haproxytech/helm-charts/kubernetes-ingress \ --create-namespace \ --namespace haproxy-controller \ --set controller.imageCredentials.registry=registry.haproxy.com \ --set controller.imageCredentials.username= \ --set controller.imageCredentials.password= \ --set controller.image.repository=registry.haproxy.com/haproxytech/hapee-ingress \ --set controller.image.tag=v3.2.12-ee3 ``` -------------------------------- ### Install Ingress Controller via Helm (OCI) Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/installation/google Installs the ingress controller using the OCI registry with the service type set to LoadBalancer. ```nix helm install haproxy-kubernetes-ingress oci://ghcr.io/haproxytech/helm-charts/kubernetes-ingress \ --create-namespace \ --namespace haproxy-controller \ --set controller.service.type=LoadBalancer ``` -------------------------------- ### Configure QUIC Initial Rule Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/crd/v3-2/ingress.v3.haproxy.org_defaults.yaml Example configuration for a QUIC initial rule using the reject type. ```json {"type":"reject"} ``` -------------------------------- ### Install Helm chart with custom values Source: https://www.haproxy.com/documentation/kubernetes-ingress/ingress-tutorials/auxiliary-config-file Command to install the Helm chart using the updated values file. ```nix helm install haproxy-kubernetes-ingress haproxytech/kubernetes-ingress \ -f values.yaml \ --namespace haproxy-controller ``` -------------------------------- ### Install ingress controller package Source: https://www.haproxy.com/documentation/kubernetes-ingress/enterprise/installation/external-mode-on-premises Install the HAProxy Enterprise Kubernetes Ingress Controller using the system package manager. ```nix sudo apt update sudo apt install -y hapee-3.2r1-kubernetes-ingress ``` ```nix sudo yum install -y hapee-3.2r1-kubernetes-ingress ``` -------------------------------- ### Example access log output Source: https://www.haproxy.com/documentation/kubernetes-ingress/administration/logging Sample output format displayed when viewing logs via kubectl. ```nix 10.244.0.1:48817 [29/Sep/2020:20:34:48.208] http default-app-service-80/SRV_ZYWuA 0/0/0/1/1 200 504 - - ---- 4/2/0/0/0 0/0 "GET test.local/app HTTP/1.1" 10.244.0.1:48817 [29/Sep/2020:20:34:49.761] http default-app-service-80/SRV_ZYWuA 0/0/0/0/0 200 504 - - ---- 4/2/0/0/0 0/0 "GET test.local/app HTTP/1.1" 10.244.0.1:48817 [29/Sep/2020:20:34:50.787] http default-app-service-80/SRV_ZYWuA 0/0/0/0/0 200 504 - - ---- 4/2/0/0/0 0/0 "GET test.local/app HTTP/1.1" ``` -------------------------------- ### View Service Output Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/installation/azure Example output showing the service details including the external IP address. ```text NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE haproxy-kubernetes-ingress LoadBalancer 10.0.40.8 20.62.154.138 80:31669/TCP,443:30449/TCP,1024:31713/TCP 2m43s ``` -------------------------------- ### Install calicoctl Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/installation/external-mode-on-premises Commands to move the calicoctl binary to the system path and make it executable. ```nix sudo cp ./calicoctl /usr/local/bin sudo chmod +x /usr/local/bin/calicoctl ``` -------------------------------- ### HAProxy Configuration File Content Source: https://www.haproxy.com/documentation/kubernetes-ingress/ingress-tutorials/load-balance-fastcgi Example configuration showing FastCGI backend settings. ```haproxy [...] backend default_grocery-service_9000 mode http balance roundrobin option forwardfor no option abortonclose default-server check ###_config-snippet_### BEGIN ### service:default_grocery-service_9000/default/grocery-service ### default-server proto fcgi use-fcgi-app php-fpm ###_config-snippet_### END server SRV_1 100.44.0.2:9000 enabled [...] backend default_plants-service_9000 mode http balance roundrobin option forwardfor no option abortonclose default-server check ###_config-snippet_### BEGIN ### service:default_plants-service_9000/default/plants-service ### default-server proto fcgi use-fcgi-app php-fpm ###_config-snippet_### END server SRV_1 100.36.0.1:9000 enabled [...] ``` -------------------------------- ### Install Ingress Controller via OCI Helm Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/installation/azure Install the ingress controller using the OCI registry with LoadBalancer service type and Azure health probe annotations. ```nix helm install haproxy-kubernetes-ingress oci://ghcr.io/haproxytech/helm-charts/kubernetes-ingress \ --create-namespace \ --namespace haproxy-controller \ --set controller.service.type=LoadBalancer \ --set controller.service.annotations."service\.beta\.kubernetes\.io/azure-load-balancer-health-probe-request-path"="/healthz" ``` -------------------------------- ### Install ingress controller via OCI Source: https://www.haproxy.com/documentation/kubernetes-ingress/enterprise/installation/google Installs the ingress controller using the OCI registry, requiring your HAProxy Enterprise license key. ```nix helm install haproxy-kubernetes-ingress oci://ghcr.io/haproxytech/helm-charts/kubernetes-ingress \ --create-namespace \ --namespace haproxy-controller \ --set controller.imageCredentials.registry=registry.haproxy.com \ --set controller.imageCredentials.username= \ --set controller.imageCredentials.password= \ --set controller.image.repository=registry.haproxy.com/haproxytech/hapee-ingress \ --set controller.image.tag=v3.2 \ --set controller.service.type=LoadBalancer ``` -------------------------------- ### Install Ingress Controller via Helm (HTTPS) Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/installation/google Installs the ingress controller using the HTTPS repository with the service type set to LoadBalancer. ```nix helm install haproxy-kubernetes-ingress haproxytech/kubernetes-ingress \ --create-namespace \ --namespace haproxy-controller \ --set controller.service.type=LoadBalancer ``` -------------------------------- ### Install Ingress Controller as DaemonSet via Helm Source: https://www.haproxy.com/documentation/kubernetes-ingress/enterprise/installation/on-prem Deploys the controller using a DaemonSet with host port enabled. Use these commands when installing from the standard HAProxy repository. ```nix helm install haproxy-kubernetes-ingress haproxytech/kubernetes-ingress \ --create-namespace \ --namespace haproxy-controller \ --set controller.imageCredentials.registry=registry.haproxy.com \ --set controller.imageCredentials.username= \ --set controller.imageCredentials.password= \ --set controller.image.repository=registry.haproxy.com/haproxytech/hapee-ingress \ --set controller.image.tag=latest \ --set controller.kind=DaemonSet \ --set controller.daemonset.useHostPort=true ``` ```nix helm install haproxy-kubernetes-ingress haproxytech/kubernetes-ingress \ --create-namespace \ --namespace haproxy-controller \ --set controller.imageCredentials.registry=registry.haproxy.com \ --set controller.imageCredentials.username= \ --set controller.imageCredentials.password= \ --set controller.image.repository=registry.haproxy.com/haproxytech/hapee-ingress \ --set controller.image.tag=latest \ --set controller.kind=DaemonSet \ --set controller.daemonset.useHostPort=true ``` -------------------------------- ### Enable and Start Ingress Service Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/installation/external-mode-on-premises Activate the newly created systemd service to run the ingress controller. ```nix sudo systemctl enable haproxy-ingress sudo systemctl start haproxy-ingress ``` -------------------------------- ### Install Ingress Controller via OCI Source: https://www.haproxy.com/documentation/kubernetes-ingress/enterprise/installation/azure Installs the HAProxy Ingress controller using the OCI registry, configured for Azure Load Balancer. ```nix helm install haproxy-kubernetes-ingress oci://ghcr.io/haproxytech/helm-charts/kubernetes-ingress \ --create-namespace \ --namespace haproxy-controller \ --set controller.imageCredentials.registry=registry.haproxy.com \ --set controller.imageCredentials.username=[KEY] \ --set controller.imageCredentials.password=[KEY] \ --set controller.image.repository=registry.haproxy.com/haproxytech/hapee-ingress \ --set controller.image.tag=v3.2 \ --set controller.service.type=LoadBalancer \ --set controller.service.annotations."service\.beta\.kubernetes\.io/azure-load-balancer-health-probe-request-path"="/healthz" ``` -------------------------------- ### Install Ingress Controller via Helm Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/installation/aws Installs the ingress controller using either HTTPS or OCI repositories with a LoadBalancer service type. ```nix helm install haproxy-kubernetes-ingress haproxytech/kubernetes-ingress \ --create-namespace \ --namespace haproxy-controller \ --set controller.service.type=LoadBalancer ``` ```nix helm install haproxy-kubernetes-ingress oci://ghcr.io/haproxytech/helm-charts/kubernetes-ingress \ --create-namespace \ --namespace haproxy-controller \ --set controller.service.type=LoadBalancer ``` -------------------------------- ### Configure ConfigMap with Global Resource Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/configuration-reference/global-crd Example ConfigMap configuration linking the Global resource. ```yaml apiVersion: v1 kind: ConfigMap metadata: name: haproxy-kubernetes-ingress namespace: haproxy-controller data: cr-global: default/example-global ``` ```yaml apiVersion: v1 kind: ConfigMap metadata: name: haproxy-kubernetes-ingress namespace: haproxy-controller data: cr-global: default/example-global ``` -------------------------------- ### Verify auxiliary configuration log output Source: https://www.haproxy.com/documentation/kubernetes-ingress/ingress-tutorials/load-balance-fastcgi Example log output confirming the auxiliary configuration file has been processed. ```text 2024/07/26 20:23:24 INFO controller/monitor.go:118 restart required : auxiliary configuration file created 2024/07/26 20:23:24 INFO controller/monitor.go:122 Auxiliary HAProxy config '/etc/haproxy/haproxy-aux.cfg' updated ``` -------------------------------- ### View Ingress Controller Log Output Source: https://www.haproxy.com/documentation/kubernetes-ingress/ingress-tutorials/load-balance-fastcgi Example output showing backend scaling and configuration reloads. ```text [...] 2024/07/29 21:27:32 INFO service/service.go:164 [transactionID=9e91f547-e0b7-46e7-805b-b0ded84e5abc] reload required : Service 'default/grocery-service': new backend 'default_grocery-service_9000' 2024/07/29 21:27:32 INFO service/endpoints.go:160 [transactionID=9e91f547-e0b7-46e7-805b-b0ded84e5abc] reload required : [CONFIG] [BACKEND] [SERVER] Server slots in backend 'default_grocery-service_9000' scaled to match available endpoints 2024/07/29 21:27:32 INFO service/service.go:164 [transactionID=9e91f547-e0b7-46e7-805b-b0ded84e5abc] reload required : Service 'default/plants-service': new backend 'default_plants-service_9000' [...] ``` -------------------------------- ### Configure Global Settings Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/configuration-reference/global-crd Examples of configuring various boolean, string, and array settings in the Global CRD. ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: nogetaddrinfo: Boolean ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: nokqueue: Boolean ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: nopoll: Boolean ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: noreuseport: Boolean ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: nosplice: Boolean ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: numa_cpu_mapping: String # Allowed values are enabled, disabled ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: pidfile: String ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: pp2_never_send_local: Boolean ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: prealloc-fd: Boolean ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: presetenv: - name: String value: String ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: profiling_tasks: String # Allowed values are auto, on, off ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: quiet: Boolean ``` -------------------------------- ### View service status output Source: https://www.haproxy.com/documentation/kubernetes-ingress/ingress-tutorials/load-balance-http Example output showing the mapping of ports to NodePorts. ```text NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE haproxy-kubernetes-ingress NodePort 10.101.116.157 80:30000/TCP,443:31962/TCP,1024:31675/TCP 97m ``` -------------------------------- ### Configure Systemd Options File Source: https://www.haproxy.com/documentation/kubernetes-ingress/enterprise/configuration-reference/startupargs Example of setting startup arguments within the systemd options file for the ingress controller. ```text # Options for hapee-3.2-kubernetes-ingress. ## SysV legacy #SYSV_OPTIONS=(-f /etc/hapee-3.2/kubernetes-ingress.yml) # SystemD will not expand variables (eg. ${hapee_majorversion}) like a shell would SYSD_OPTIONS='-f /etc/hapee-3.2/kubernetes-ingress.yml --empty-ingress-class' ``` -------------------------------- ### Check CRDs with --job-check-crd Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/configuration-reference/startupargs Executes a check for CRD installation and version status without starting the controller. ```nix haproxy-ingress-controller --job-check-crd ``` -------------------------------- ### WafBodyRule Example Source: https://www.haproxy.com/documentation/kubernetes-ingress/enterprise/crd/v3-2/ingress.v3.haproxy.com_frontends.yaml Example configuration for a WafBodyRule object used within the waf_body_rule_list. ```json {"cond":"if","cond_test":"headers wafdrop || headers wafblock !learningmode","index":0,"type":"deny"} ``` -------------------------------- ### Helm upgrade output Source: https://www.haproxy.com/documentation/kubernetes-ingress/ingress-tutorials/load-balance-tcp Example output confirming the successful upgrade and mapping of TCP service ports. ```output Release "haproxy-kubernetes-ingress" has been upgraded. Happy Helming! NAME: haproxy-kubernetes-ingress [...] Service ports mapped are: - name: http containerPort: 8080 protocol: TCP - name: https containerPort: 8443 protocol: TCP - name: stat containerPort: 1024 protocol: TCP - name: quic containerPort: 8443 protocol: UDP - name: service-1-tcp containerPort: 2000 protocol: TCP ``` -------------------------------- ### Example process log output Source: https://www.haproxy.com/documentation/kubernetes-ingress/administration/logging Sample output showing the startup banner and version information of the HAProxy Ingress Controller. ```text 2020/07/17 17:07:47 _ _ _ ____ _____ _____ | | | | / \ | _ \ _ __ _____ ___ _ | ____| ____| | |_| | / _ \ | |_) | '__/ _ \ \/ / | | | | _| | _| | _ |/ ___ \| __/| | | (_) > <| |_| | | |___| |___ |_| |_/_/ \_\_| |_| \___/_/\_\\__, | |_____|_____| _ __ _ |___/ ___ ____ | |/ / _| |__ ___ _ __ _ __ ___| |_ ___ ___ |_ _/ ___| | ' / | | | '_ \ / _ \ '__| '_ \ / _ \ __/ _ \/ __| | | | | . \ |_| | |_) | __/ | | | | | __/ || __/\_\_\ | | |___ |_|\_\__,_|_.__/ \___|_| |_| |_|\___|\__\___||___/ |___\____| 2020/07/17 17:07:47 HAProxy Ingress Controller v1.4.5-ee1 c2b5156 2020/07/17 17:07:47 Build from: ssh://git@gitlab.int.haproxy.com/haproxy-controller/kubernetes-ingress-ee 2020/07/17 17:07:47 Build date: 2020-07-12T00:00:53 ``` ```text 2020/07/17 17:07:47 _ _ _ ____ _____ _____ | | | | / \ | _ \ _ __ _____ ___ _ | ____| ____| | |_| | / _ \ | |_) | '__/ _ \ \/ / | | | | _| | _| | _ |/ ___ \| __/| | | (_) > <| |_| | | |___| |___ |_| |_/_/ \_\_| |_| \___/_/\_\\__, | |_____|_____| _ __ _ |___/ ___ ____ | |/ / _| |__ ___ _ __ _ __ ___| |_ ___ ___ |_ _/ ___| | ' / | | | '_ \ / _ \ '__| '_ \ / _ \ __/ _ \/ __| | | | | . \ |_| | |_) | __/ | | | | | __/ || __/\_\_\ | | |___ |_|\_\__,_|_.__/ \___|_| |_| |_|\___|\__\___||___/ |___\____| 2020/07/17 17:07:47 HAProxy Ingress Controller v1.4.5-ee1 c2b5156 2020/07/17 17:07:47 Build from: ssh://git@gitlab.int.haproxy.com/haproxy-controller/kubernetes-ingress-ee 2020/07/17 17:07:47 Build date: 2020-07-12T00:00:53 ``` -------------------------------- ### Verify CRD Installation Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/configuration-reference/validationrules-crd List custom resource definitions to confirm the installation. ```nix kubectl get crd ``` -------------------------------- ### Configure Backend Settings Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/configuration-reference/backend-crd Examples for various backend configuration parameters including timeouts, flags, and load balancing settings. ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Backend metadata: name: example-backend namespace: default spec: config: abortonclose: String # Allowed values are enabled, disabled ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Backend metadata: name: example-backend namespace: default spec: config: accept_invalid_http_response: String # Allowed values are enabled, disabled ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Backend metadata: name: example-backend namespace: default spec: config: adv_check: String # Allowed values are httpchk, ldap-check, mysql-check, pgsql-check, redis-check, smtpchk, ssl-hello-chk, tcp-check ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Backend metadata: name: example-backend namespace: default spec: config: allbackups: String # Allowed values are enabled, disabled ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Backend metadata: name: example-backend namespace: default spec: config: balance: algorithm: String # Allowed values are first, hash, hdr, leastconn, random, rdp-cookie, roundrobin, source, static-rr, uri, url_param hash_expression: String hdr_name: String hdr_use_domain_only: Boolean random_draws: Integer rdp_cookie_name: String # Allowed pattern: ^[^\s]+$ uri_depth: Integer uri_len: Integer uri_path_only: Boolean uri_whole: Boolean url_param: String # Allowed pattern: ^[^\s]+$ url_param_check_post: Integer url_param_max_wait: Integer ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Backend metadata: name: example-backend namespace: default spec: config: bind_process: String # Allowed pattern: ^[^\s]+$ ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Backend metadata: name: example-backend namespace: default spec: config: check_timeout: Integer ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Backend metadata: name: example-backend namespace: default spec: config: checkcache: String # Allowed values are enabled, disabled ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Backend metadata: name: example-backend namespace: default spec: config: compression: algo-req: String # Allowed values are identity, gzip, deflate, raw-deflate algorithms: [ String ] algos-res: [ String ] direction: String # Allowed values are request, response, both offload: Boolean types: [ String ] types-req: [ String ] types-res: [ String ] ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Backend metadata: name: example-backend namespace: default spec: config: connect_timeout: Integer ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Backend metadata: name: example-backend namespace: default spec: config: cookie: attr: - value: String # Allowed pattern: ^[^\s]+$ domain: - value: String # Allowed pattern: ^[^\s]+$ dynamic: Boolean httponly: Boolean indirect: Boolean maxidle: Integer maxlife: Integer name: String # Allowed pattern: ^[^\s]+$ nocache: Boolean postonly: Boolean preserve: Boolean secure: Boolean type: String # Allowed values are rewrite, insert, prefix ``` -------------------------------- ### TCP CRD Configuration Example Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/configuration-reference/tcps-crd Example structure for a TCP resource including the http_request_timeout field. ```yaml apiVersion: "ingress.v3.haproxy.org/v3" kind: TCP metadata: name: example-tcp spec: - name: example-tcp service: name: String port: Integer frontend: http_request_timeout: Integer # Minimum: 0 ``` -------------------------------- ### Examine Deployment Configuration Source: https://www.haproxy.com/documentation/kubernetes-ingress/gateway-api/enable-gateway-api Retrieve the current deployment configuration in YAML format to identify existing startup arguments. ```nix kubectl get deployment haproxy-kubernetes-ingress -n haproxy-controller -o yaml ``` ```nix kubectl get deployment haproxy-ingress -n ingress-controller -o yaml ``` -------------------------------- ### TCP Request Rule Example Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/crd/v3-2/ingress.v1.haproxy.org_tcps.yaml Example configuration for a TCP request rule defining a connection condition. ```json {"cond":"if","cond_test":"{ src 192.168.0.0/16 }","index":0,"type":"connection"} ``` -------------------------------- ### Set startup arguments via Helm --set Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/configuration-reference/startupargs Use the --set-string flag to pass specific startup arguments like --empty-ingress-class into the controller.extraArgs array. ```nix helm install haproxy haproxytech/kubernetes-ingress \ --set-string "controller.extraArgs={--empty-ingress-class}" ``` -------------------------------- ### Apply Backend Service Source: https://www.haproxy.com/documentation/kubernetes-ingress/ingress-tutorials/load-balance-tcp Deploy the backend service and verify the creation output. ```nix kubectl apply -f example-service.yaml ``` ```output service/example-service1 created ``` -------------------------------- ### Download and Install Ingress Controller Binary Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/installation/external-mode-on-premises Fetch the ingress controller release, extract the archive, and move the binary to the system path. ```nix wget https://github.com/haproxytech/kubernetes-ingress/releases/download/v1.8.8/haproxy-ingress-controller_1.8.8_Linux_x86_64.tar.gz tar -xzvf haproxy-ingress-controller_1.8.8_Linux_x86_64.tar.gz sudo cp ./haproxy-ingress-controller /usr/local/bin/ ``` -------------------------------- ### Install Ingress Controller via HTTPS Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/installation/on-prem Installs the latest version of the ingress controller using the HTTPS repository. ```nix helm install haproxy-kubernetes-ingress haproxytech/kubernetes-ingress \ --create-namespace \ --namespace haproxy-controller ``` -------------------------------- ### Example output for helm search Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/upgrade Sample output showing the list of available chart versions and their corresponding application versions. ```text NAME CHART VERSION APP VERSION DESCRIPTION haproxytech/kubernetes-ingress 1.36.1 1.10.10 A Helm chart for HAProxy Kubernetes Ingress Con... haproxytech/kubernetes-ingress 1.36.0 1.10.10 A Helm chart for HAProxy Kubernetes Ingress Con... haproxytech/kubernetes-ingress 1.35.5 1.10.10 A Helm chart for HAProxy Kubernetes Ingress Con... haproxytech/kubernetes-ingress 1.35.4 1.10.10 A Helm chart for HAProxy Kubernetes Ingress Con... haproxytech/kubernetes-ingress 1.35.3 1.10.10 A Helm chart for HAProxy Kubernetes Ingress Con... haproxytech/kubernetes-ingress 1.35.2 1.10.10 A Helm chart for HAProxy Kubernetes Ingress Con... haproxytech/kubernetes-ingress 1.35.1 1.10.10 A Helm chart for HAProxy Kubernetes Ingress Con... haproxytech/kubernetes-ingress 1.35.0 1.10.10 A Helm chart for HAProxy Kubernetes Ingress Con... haproxytech/kubernetes-ingress 1.34.1 1.10.9 A Helm chart for HAProxy Kubernetes Ingress Con... [...] ``` ```text NAME CHART VERSION APP VERSION DESCRIPTION haproxytech/kubernetes-ingress 1.36.1 1.10.10 A Helm chart for HAProxy Kubernetes Ingress Con... haproxytech/kubernetes-ingress 1.36.0 1.10.10 A Helm chart for HAProxy Kubernetes Ingress Con... haproxytech/kubernetes-ingress 1.35.5 1.10.10 A Helm chart for HAProxy Kubernetes Ingress Con... haproxytech/kubernetes-ingress 1.35.4 1.10.10 A Helm chart for HAProxy Kubernetes Ingress Con... haproxytech/kubernetes-ingress 1.35.3 1.10.10 A Helm chart for HAProxy Kubernetes Ingress Con... haproxytech/kubernetes-ingress 1.35.2 1.10.10 A Helm chart for HAProxy Kubernetes Ingress Con... haproxytech/kubernetes-ingress 1.35.1 1.10.10 A Helm chart for HAProxy Kubernetes Ingress Con... haproxytech/kubernetes-ingress 1.35.0 1.10.10 A Helm chart for HAProxy Kubernetes Ingress Con... haproxytech/kubernetes-ingress 1.34.1 1.10.9 A Helm chart for HAProxy Kubernetes Ingress Con... [...] ``` -------------------------------- ### HTTP Error Rule Configuration Example Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/crd/v3-2/ingress.v3.haproxy.org_defaults.yaml Example JSON object representing an HTTP error rule configuration for HAProxy. ```json {"index":0,"status":425,"type":"status"} ``` -------------------------------- ### Install with Custom NodePorts Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/installation/on-prem Configure specific NodePort values for HTTP, HTTPS, Stats, and Prometheus ports during Helm installation. ```nix helm 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 ``` ```nix helm install haproxy-kubernetes-ingress oci://ghcr.io/haproxytech/helm-charts/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 ``` -------------------------------- ### Run startup arguments in external mode Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/configuration-reference/startupargs Pass arguments directly to the binary invocation when running the controller in external mode. ```nix haproxy-ingress-controller --empty-ingress-class ``` -------------------------------- ### Configure quic_initial_rule_list Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/configuration-reference/frontend-crd Define a list of initial rules for QUIC. ```yaml apiVersion: "ingress.v3.haproxy.org/v3" kind: Frontend metadata: name: example-frontend-crd namespace: default spec: quic_initial_rule_list: - cond: String # Allowed values are if, unless cond_test: String type: String # Allowed values are reject, accept, send-retry, dgram-drop ``` -------------------------------- ### Apply and verify ValidationRules Source: https://www.haproxy.com/documentation/kubernetes-ingress/ingress-tutorials/user-annotations Use kubectl to apply the configuration and verify the resource creation. ```nix kubectl apply -f example-annotations.yaml ``` ```text validationrules.ingress.v3.haproxy.org/example-annotations created ``` -------------------------------- ### Install Ingress Controller via HTTPS Source: https://www.haproxy.com/documentation/kubernetes-ingress/enterprise/installation/azure Installs the HAProxy Ingress controller using the HTTPS repository, configured for Azure Load Balancer. ```nix helm install haproxy-kubernetes-ingress haproxytech/kubernetes-ingress \ --create-namespace \ --namespace haproxy-controller \ --set controller.imageCredentials.registry=registry.haproxy.com \ --set controller.imageCredentials.username=[KEY] \ --set controller.imageCredentials.password=[KEY] \ --set controller.image.repository=registry.haproxy.com/haproxytech/hapee-ingress \ --set controller.image.tag=v3.2 \ --set controller.service.type=LoadBalancer \ --set controller.service.annotations."service\.beta\.kubernetes\.io/azure-load-balancer-health-probe-request-path"="/healthz" ``` -------------------------------- ### Install Specific Helm Chart Version Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/installation/on-prem Installs a specific version of the Helm chart using either the standard repository or the OCI registry. ```nix helm install haproxy-kubernetes-ingress haproxytech/kubernetes-ingress \ --version 1.42.0 \ --create-namespace \ --namespace haproxy-controller ``` ```nix helm install haproxy-kubernetes-ingress oci://ghcr.io/haproxytech/helm-charts/kubernetes-ingress \ --version 1.42.0 \ --create-namespace \ --namespace haproxy-controller ``` -------------------------------- ### Configure startup arguments via kubectl Deployment Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/configuration-reference/startupargs Add arguments directly to the args section of the container specification in your Kubernetes Deployment YAML file. ```yaml --- apiVersion: apps/v1 kind: Deployment metadata: name: haproxy-kubernetes-ingress [...] spec: [...] spec: [...] containers: - name: haproxy-ingress image: haproxytech/kubernetes-ingress args: - --configmap=default/haproxy-kubernetes-ingress ``` -------------------------------- ### Enable and Start BIRD Service Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/installation/external-mode-on-premises Commands to enable the BIRD service at boot and restart it to apply configuration changes. ```nix sudo systemctl enable bird sudo systemctl restart bird ``` -------------------------------- ### Connect to GKE Cluster Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/installation/google Use the Google Cloud SDK to initialize the environment and retrieve cluster credentials. ```nix gcloud init gcloud container clusters get-credentials [Your cluster name] --zone [Your zone] --project [Your project name] ``` -------------------------------- ### Install Specific Docker Image Tag Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/installation/on-prem Installs the ingress controller while overriding the default Docker image tag using the --set flag. ```nix helm install haproxy-kubernetes-ingress haproxytech/kubernetes-ingress \ --create-namespace \ --namespace haproxy-controller \ --set controller.image.tag=3.0 ``` ```nix helm install haproxy-kubernetes-ingress oci://ghcr.io/haproxytech/helm-charts/kubernetes-ingress \ --create-namespace \ --namespace haproxy-controller \ --set controller.image.tag=3.0 ``` -------------------------------- ### Apply Kubernetes Resources Source: https://www.haproxy.com/documentation/kubernetes-ingress/ingress-tutorials/load-balance-tcp Commands to apply the deployment configuration and verify the creation of resources. ```nix kubectl apply -f busybox.yaml ``` ```output deployment.apps/busybox-deployment created service/busybox-service created ``` -------------------------------- ### Install ingress controller via HTTPS repository Source: https://www.haproxy.com/documentation/kubernetes-ingress/enterprise/installation/on-prem Installs the ingress controller using the HTTPS repository. Replace [KEY] with your actual HAProxy Enterprise license key. ```nix helm install haproxy-kubernetes-ingress haproxytech/kubernetes-ingress \ --create-namespace \ --namespace haproxy-controller \ --set controller.imageCredentials.registry=registry.haproxy.com \ --set controller.imageCredentials.username=[KEY] \ --set controller.imageCredentials.password=[KEY] \ --set controller.image.repository=registry.haproxy.com/haproxytech/hapee-ingress \ --set controller.image.tag=v3.2 ``` -------------------------------- ### Install Ingress Controller via Helm Source: https://www.haproxy.com/documentation/kubernetes-ingress/enterprise/installation/install-on-amazon-eks/install-using-marketplace Deploy the ingress controller into the specified namespace using the downloaded chart and required configuration flags. ```nix helm install haproxy-kubernetes-ingress \ --namespace haproxy-controller \ --set controller.service.type=LoadBalancer \ --set "aws.licenseConfigSecretName=license-token-secret" \ ./haproxy-ingress-controller-helm-chart2-*.tgz ``` -------------------------------- ### Install Ingress Controller via HTTPS Helm Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/installation/azure Install the ingress controller using the HTTPS repository with LoadBalancer service type and Azure health probe annotations. ```nix helm install haproxy-kubernetes-ingress haproxytech/kubernetes-ingress \ --create-namespace \ --namespace haproxy-controller \ --set controller.service.type=LoadBalancer \ --set controller.service.annotations."service\.beta\.kubernetes\.io/azure-load-balancer-health-probe-request-path"="/healthz" ``` -------------------------------- ### Configure from Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/configuration-reference/tcps-crd Sets the source address or network for the frontend. ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: TCP metadata: name: example-tcp spec: - name: example-tcp service: name: String port: Integer frontend: from: String # Allowed pattern: ^[A-Za-z0-9-_.:]+$ ``` -------------------------------- ### Configure AWS CLI Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/installation/aws Initializes the AWS CLI with credentials for the current user. ```nix aws configure ```