### Install with command-line parameters Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/configuration-reference/values Example of installing the ingress controller using multiple --set flags to define node ports. ```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 ``` -------------------------------- ### QUIC Initial Configuration Example 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"} ``` -------------------------------- ### ConfigMap Output Example Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/configuration-reference/configmap Example output showing the list of ConfigMaps. ```text NAME DATA AGE haproxy-kubernetes-ingress 0 13s ``` -------------------------------- ### Helm Installation Output Source: https://www.haproxy.com/documentation/kubernetes-ingress/enterprise/installation/install-on-amazon-eks/install-using-marketplace Example of the successful deployment status output returned by Helm. ```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. ``` -------------------------------- ### CRD Installation Output Source: https://www.haproxy.com/documentation/kubernetes-ingress/enterprise/configuration-reference/validationrules-crd Example output showing the listed custom resource definitions. ```text NAME CREATED AT validationrules.ingress.v3.haproxy.com 2022-01-21T20:00:31Z ``` ```text NAME CREATED AT validationrules.core.haproxy.org 2022-01-21T20:00:31Z ``` -------------------------------- ### Install using a values 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 ``` -------------------------------- ### Install using a values file Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/configuration-reference/values Command to install the ingress controller using the -f flag to reference a values.yaml file. ```nix helm install -f values.yaml haproxy-kubernetes-ingress haproxytech/kubernetes-ingress \ --create-namespace \ --namespace haproxy-controller ``` -------------------------------- ### Configure Backend Settings Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/configuration-reference/backend-crd Examples for configuring various backend operational parameters. ```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 ``` -------------------------------- ### Install mkpasswd Tool Source: https://www.haproxy.com/documentation/kubernetes-ingress/administration/troubleshooting Install the necessary utility for password hashing on different package managers. ```nix # mkpasswd is included in the whois package sudo apt install whois ``` ```nix sudo yum install mkpasswd ``` -------------------------------- ### 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 kubectl apply 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 [...] ``` -------------------------------- ### 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 start the ingress controller. ```nix sudo systemctl enable haproxy-ingress sudo systemctl start haproxy-ingress ``` -------------------------------- ### Helm install with extraArgs Source: https://www.haproxy.com/documentation/kubernetes-ingress/enterprise/configuration-reference/values Commands to install the HAProxy Ingress controller using either direct set-string arguments or a values file. ```nix helm install haproxy-kubernetes-ingress haproxytech/kubernetes-ingress --set-string "controller.extraArgs={--configmap-tcp-services=default/tcp}" ``` ```nix helm install -f values.yaml haproxy-kubernetes-ingress haproxytech/kubernetes-ingress ``` -------------------------------- ### Configure Statistics and Limits Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/configuration-reference/global-crd Examples for configuring statistics and system-wide limits. ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: stats_maxconn: Integer ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: stats_timeout: Integer ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: strict_limits: Boolean ``` -------------------------------- ### Install Ingress Controller Package Source: https://www.haproxy.com/documentation/kubernetes-ingress/enterprise/installation/external-mode-on-premises Install the ingress controller package using the system's 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 ``` -------------------------------- ### 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 BIRD on Linux Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/installation/external-mode-on-premises Commands to add the repository and install the BIRD package on Debian-based systems. ```nix sudo add-apt-repository -y ppa:cz.nic-labs/bird sudo apt update sudo apt install bird ``` -------------------------------- ### 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 to start on boot and restart the current process. ```nix sudo systemctl enable bird sudo systemctl restart bird ``` -------------------------------- ### Example output for upgrade command Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/upgrade Displays the expected output after successfully upgrading the Helm release. ```text Release "haproxy-kubernetes-ingress" has been upgraded. Happy Helming! NAME: haproxy-kubernetes-ingress LAST DEPLOYED: Fri Jan 19 21:32:28 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.9". [...] ``` -------------------------------- ### Example Service Output Source: https://www.haproxy.com/documentation/kubernetes-ingress/ingress-tutorials/load-balance-fastcgi The expected output showing the NodePort configuration for the ingress controller. ```text NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/haproxy-kubernetes-ingress NodePort 10.105.8.178 80:30901/TCP,443:32033/TCP,443:32033/UDP,1024:30609/TCP,6060:31356/TCP 27h ``` -------------------------------- ### 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 ``` -------------------------------- ### Example Service Output Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/installation/on-prem Sample output showing the NodePort configuration for HTTP, HTTPS, and Stats ports. ```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 ``` -------------------------------- ### Pod List Output Source: https://www.haproxy.com/documentation/kubernetes-ingress/administration/troubleshooting Example output showing running ingress controller pods. ```text NAME READY STATUS RESTARTS AGE haproxy-ingress-6fb9847747-5z7gq 1/1 Running 0 3h42m ``` -------------------------------- ### Install Ingress Controller via Helm (OCI) Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/installation/azure Installs the ingress controller using the OCI registry with Azure LoadBalancer configuration. ```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 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 Helm chart with custom values Source: https://www.haproxy.com/documentation/kubernetes-ingress/ingress-tutorials/auxiliary-config-file Command to install the Helm chart while referencing the custom values file. ```bash helm install haproxy-kubernetes-ingress haproxytech/kubernetes-ingress \ -f values.yaml \ --namespace haproxy-controller ``` -------------------------------- ### Install calicoctl Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/installation/external-mode-on-premises Move the calicoctl binary to the system path and grant execution permissions. ```nix sudo cp ./calicoctl /usr/local/bin sudo chmod +x /usr/local/bin/calicoctl ``` -------------------------------- ### Deployment Rollout History Output Source: https://www.haproxy.com/documentation/kubernetes-ingress/gateway-api/tcproute Example output showing the revision history and change cause. ```text REVISION CHANGE-CAUSE 1 2 Updated haproxy-ingress deployment to enable Gateway API ``` -------------------------------- ### Install Ingress Controller via Helm Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/installation/aws Install the ingress controller using either HTTPS or OCI repository methods with 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 ``` -------------------------------- ### Example Output for Empty Namespace Source: https://www.haproxy.com/documentation/kubernetes-ingress/enterprise/installation/install-on-amazon-eks/install-using-marketplace Expected output when no resources exist in the default namespace. ```text No resources found in default namespace. ``` -------------------------------- ### Install Ingress Controller via Helm (HTTPS) Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/installation/azure Installs the ingress controller using the HTTPS repository with Azure LoadBalancer configuration. ```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 Global Settings Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/configuration-reference/global-crd Examples for configuring global settings within the Global CRD. ```yaml apiVersion: "core.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: chroot: String # Allowed pattern: ^[^\s]+$ ``` ```yaml apiVersion: "core.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: group: String # Allowed pattern: ^[^\s]+$ ``` ```yaml apiVersion: "core.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: hard_stop_after: Integer ``` ```yaml apiVersion: "core.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: user: String # Allowed pattern: ^[^\s]+$ ``` ```yaml apiVersion: "core.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: daemon: String # Allowed values are enabled, disabled ``` ```yaml apiVersion: "core.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: nbproc: Integer ``` ```yaml apiVersion: "core.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: nbthread: Integer ``` ```yaml apiVersion: "core.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: master-worker: Boolean ``` ```yaml apiVersion: "core.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: external_check: Boolean ``` ```yaml apiVersion: "core.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: pidfile: String ``` ```yaml apiVersion: "core.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: maxconn: Integer ``` ```yaml apiVersion: "core.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: server_state_base: String # Allowed pattern: ^[^\s]+$ ``` ```yaml apiVersion: "core.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: tune_ssl_default_dh_param: Integer ``` ```yaml apiVersion: "core.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: ssl_default_bind_options: String ``` ```yaml apiVersion: "core.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: ssl_default_bind_ciphers: String ``` -------------------------------- ### Install Ingress Controller via OCI Repository Source: https://www.haproxy.com/documentation/kubernetes-ingress/enterprise/installation/install-on-amazon-eks/install-using-license-key Installs the HAProxy Enterprise ingress controller using the OCI repository. Replace with your actual 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 ``` -------------------------------- ### Example Output of Helm Search Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/installation/on-prem Sample output showing available chart and application versions. ```text NAME CHART VERSION APP VERSION DESCRIPTION haproxytech/kubernetes-ingress 1.44.0 3.1.0-rc1 A Helm chart for HAProxy Kubernetes Ingress Con... haproxytech/kubernetes-ingress 1.43.0 3.1.0-rc1 A Helm chart for HAProxy Kubernetes Ingress Con... haproxytech/kubernetes-ingress 1.42.0 3.0.4 A Helm chart for HAProxy Kubernetes Ingress Con... haproxytech/kubernetes-ingress 1.41.0 3.0.1 A Helm chart for HAProxy Kubernetes Ingress Con... haproxytech/kubernetes-ingress 1.40.1 3.0.1 A Helm chart for HAProxy Kubernetes Ingress Con... haproxytech/kubernetes-ingress 1.40.0 3.0.0 A Helm chart for HAProxy Kubernetes Ingress Con... ``` -------------------------------- ### Connection Log Output Source: https://www.haproxy.com/documentation/kubernetes-ingress/ingress-tutorials/load-balance-tcp Example log output confirming a successful connection. ```output connect to [::ffff:10.244.0.10]:5570 from 10-244-0-8.haproxy-kubernetes-ingress.haproxy-controller.svc.cluster.local:60598 ([::ffff:10.244.0.8]:60598) ``` -------------------------------- ### Check Cluster Resources Output Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/installation/aws Example output when no resources are present in the default namespace. ```text No resources found in default namespace. ``` -------------------------------- ### Check CRD installation status Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/configuration-reference/startupargs Executes a check to verify if CRDs are installed and up to date without starting the controller. ```nix haproxy-ingress-controller --job-check-crd ``` -------------------------------- ### Configure Controller with --configmap-patternfiles Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/configuration-reference/startupargs Startup command to enable pattern files by specifying the ConfigMap. ```nix haproxy-ingress-controller --configmap-patternfiles=default/acl-patterns ``` -------------------------------- ### Configure TCP Frontend Settings Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/configuration-reference/tcps-crd Examples of configuring various frontend parameters for the TCP CRD. ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: TCP metadata: name: example-tcp spec: - name: example-tcp service: name: String port: Integer frontend: http_no_delay: String # Allowed values are enabled, disabled ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: TCP metadata: name: example-tcp spec: - name: example-tcp service: name: String port: Integer frontend: http_request_timeout: Integer ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: TCP metadata: name: example-tcp spec: - name: example-tcp service: name: String port: Integer frontend: http_restrict_req_hdr_names: String # Allowed values are preserve, delete, reject ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: TCP metadata: name: example-tcp spec: - name: example-tcp service: name: String port: Integer frontend: http_use_proxy_header: String # Allowed values are enabled, disabled ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: TCP metadata: name: example-tcp spec: - name: example-tcp service: name: String port: Integer frontend: httplog: Boolean ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: TCP metadata: name: example-tcp spec: - name: example-tcp service: name: String port: Integer frontend: httpslog: String # Allowed values are enabled, disabled ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: TCP metadata: name: example-tcp spec: - name: example-tcp service: name: String port: Integer frontend: id: Integer ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: TCP metadata: name: example-tcp spec: - name: example-tcp service: name: String port: Integer frontend: idle_close_on_response: String # Allowed values are enabled, disabled ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: TCP metadata: name: example-tcp spec: - name: example-tcp service: name: String port: Integer frontend: independent_streams: String # Allowed values are enabled, disabled ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: TCP metadata: name: example-tcp spec: - name: example-tcp service: name: String port: Integer frontend: log_format: String ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: TCP metadata: name: example-tcp spec: - name: example-tcp service: name: String port: Integer frontend: log_format_sd: String ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: TCP metadata: name: example-tcp spec: - name: example-tcp service: name: String port: Integer frontend: log_separate_errors: String # Allowed values are enabled, disabled ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: TCP metadata: name: example-tcp spec: - name: example-tcp service: name: String port: Integer frontend: log_tag: String # Allowed pattern: ^[A-Za-z0-9-_.:]+$ ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: TCP metadata: name: example-tcp spec: - name: example-tcp service: name: String port: Integer frontend: log_target_list: - address: String # Allowed pattern: ^[^\s]+$ facility: String # Allowed values are kern, user, mail, daemon, auth, syslog, lpr, news, uucp, cron, auth2, ftp, ntp, audit, alert, cron2, local0, local1, local2, local3, local4, local5, local6, local7 format: String # Allowed values are local, rfc3164, rfc5424, priority, short, timed, iso, raw global: Boolean index: Integer length: Integer level: String # Allowed values are emerg, alert, crit, err, warning, notice, info, debug minlevel: String # Allowed values are emerg, alert, crit, err, warning, notice, info, debug nolog: Boolean sample_range: String sample_size: Integer ``` -------------------------------- ### Examine Deployment YAML Source: https://www.haproxy.com/documentation/kubernetes-ingress/gateway-api/enable-gateway-api Retrieve the current deployment configuration 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 ``` -------------------------------- ### Log output for auxiliary configuration 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 ``` -------------------------------- ### Configure Global SSL Settings Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/configuration-reference/global-crd Examples of configuring various SSL/TLS parameters in the Global CRD. ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: ssl_default_bind_ciphers: String ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: ssl_default_bind_ciphersuites: String ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: ssl_default_bind_client_sigalgs: String ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: ssl_default_bind_curves: String ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: ssl_default_bind_options: String ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: ssl_default_bind_sigalgs: String ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: ssl_default_server_ciphers: String ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: ssl_default_server_ciphersuites: String ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: ssl_default_server_client_sigalgs: String ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: ssl_default_server_curves: String ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: ssl_default_server_options: String ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: ssl_default_server_sigalgs: String ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: ssl_dh_param_file: String ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: ssl_engines: - algorithms: String name: String ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: ssl_load_extra_files: String ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: ssl_mode_async: String # Allowed values are enabled, disabled ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: ssl_propquery: String ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: ssl_provider: String ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: ssl_provider_path: String ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: ssl_server_verify: String # Allowed values are none, required ``` ```yaml apiVersion: "ingress.v1.haproxy.org/v1" kind: Global metadata: name: example-global namespace: default spec: config: ssl_skip_self_issued_ca: Boolean ``` -------------------------------- ### Verify CRD Installation Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/configuration-reference/validationrules-crd List the custom resource definitions to confirm the installation was successful. ```nix kubectl get crd ``` -------------------------------- ### Verify Helm Upgrade Output 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". [...] ``` -------------------------------- ### WafBodyRule Example Source: https://www.haproxy.com/documentation/kubernetes-ingress/enterprise/crd/v3-2/ingress.v3.haproxy.com_frontends.yaml Example configuration for a WAF body rule within the HAProxy Ingress Frontend CRD. ```json {"cond":"if","cond_test":"headers wafdrop || headers wafblock !learningmode","index":0,"type":"deny"} ``` -------------------------------- ### Example output for service status Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/installation/on-prem Expected output format showing the service configuration and port mappings. ```text NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE haproxy-kubernetes-ingress NodePort 10.104.173.167 80:30264/TCP,443:31575/TCP,1024:31785/TCP 155m ``` -------------------------------- ### Example ingress controller log output Source: https://www.haproxy.com/documentation/kubernetes-ingress/administration/logging Sample output showing the startup information and version details 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 ``` -------------------------------- ### HTTP Error Rule Example Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/crd/v3-2/ingress.v3.haproxy.org_defaults.yaml Example configuration for an HTTP error rule using a status code. ```json {"index":0,"status":425,"type":"status"} ``` -------------------------------- ### Define HAProxy Filter Example Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/crd/v3-2/ingress.v1.haproxy.org_tcps.yaml Example of a filter configuration object used within the filter_list array. ```json {"index":0,"trace_name":"name","trace_rnd_parsing":true,"type":"trace"} ``` -------------------------------- ### 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 arguments to the controller.extraArgs field during Helm installation. ```nix helm install haproxy haproxytech/kubernetes-ingress \ --set-string "controller.extraArgs={--empty-ingress-class}" ``` -------------------------------- ### Example JSON output for add-on creation Source: https://www.haproxy.com/documentation/kubernetes-ingress/enterprise/installation/install-on-amazon-eks/install-using-marketplace The expected JSON response after successfully triggering 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": {} } } ``` ```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": {} } } ``` -------------------------------- ### Apply Service Configuration Source: https://www.haproxy.com/documentation/kubernetes-ingress/ingress-tutorials/load-balance-tcp Applies the service definition and shows the creation output. ```nix kubectl apply -f busybox.yaml ``` ```output service/busybox-service created ``` -------------------------------- ### Initialize Calico Configuration Directory Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/installation/external-mode-on-premises Create the directory and empty configuration file required for calicoctl. ```nix sudo mkdir /etc/calico sudo touch /etc/calico/calicoctl.cfg ``` -------------------------------- ### 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 ``` -------------------------------- ### Configure from, fullconn, and hash settings Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/configuration-reference/defaults-crd Various global settings including source binding, connection limits, and load balancing hash configurations. ```yaml apiVersion: "ingress.v3.haproxy.org/v3" kind: Defaults metadata: name: example-defaults namespace: default spec: from: String # Allowed pattern: ^[A-Za-z0-9-_.:]+$ ``` ```yaml apiVersion: "ingress.v3.haproxy.org/v3" kind: Defaults metadata: name: example-defaults namespace: default spec: fullconn: Integer ``` ```yaml apiVersion: "ingress.v3.haproxy.org/v3" kind: Defaults metadata: name: example-defaults namespace: default spec: h1_case_adjust_bogus_client: String # Allowed values are enabled, disabled ``` ```yaml apiVersion: "ingress.v3.haproxy.org/v3" kind: Defaults metadata: name: example-defaults namespace: default spec: h1_case_adjust_bogus_server: String # Allowed values are enabled, disabled ``` ```yaml apiVersion: "ingress.v3.haproxy.org/v3" kind: Defaults metadata: name: example-defaults namespace: default spec: hash_balance_factor: Integer ``` ```yaml apiVersion: "ingress.v3.haproxy.org/v3" kind: Defaults metadata: name: example-defaults namespace: default spec: hash_preserve_affinity: String # Allowed values are always, maxconn, maxqueue ``` ```yaml apiVersion: "ingress.v3.haproxy.org/v3" kind: Defaults metadata: name: example-defaults namespace: default spec: hash_type: function: String # Allowed values are sdbm, djb2, wt6, crc32, none method: String # Allowed values are map-based, consistent modifier: String # Allowed values are avalanche ``` -------------------------------- ### Download and Install Ingress Controller Binary Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/installation/external-mode-on-premises Download 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/ ``` -------------------------------- ### Connect to GKE Cluster Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/installation/google Use these commands to initialize the Google Cloud SDK and retrieve cluster credentials for kubectl access. ```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 using a specific Docker image tag via the controller.image.tag parameter. ```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 ``` -------------------------------- ### 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 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 ``` -------------------------------- ### Create BGP configuration file Source: https://www.haproxy.com/documentation/kubernetes-ingress/community/installation/external-mode-on-premises Initializes the configuration file path for BGP settings. ```nix sudo touch /etc/calico/calico-bgp.yaml ``` -------------------------------- ### Install ingress controller via HTTPS 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 OCI repository Source: https://www.haproxy.com/documentation/kubernetes-ingress/enterprise/installation/azure Installs the HAProxy Enterprise Ingress Controller using the OCI registry with Azure-specific load balancer annotations. ```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" ```