Administration
Manage HAProxy Unified Gateway logs
The HAProxy Unified Gateway controller’s Deployment manifest, controller.yaml, sets the startup argument --hugconf-crd, which references a HugConf custom resource to load. By default, it uses one named haproxy-unified-gateway/hugconf. The job of that resource is to customize the controller’s behavior, including its log settings.
Set logging options with HugConf Jump to heading
With a HugConf resource, you can customize the verbosity of the logs that the HAProxy Unified Gateway controller produces.
- Define which categories of logs to produce.
- Set the logging level for each category.
For example, to enable info-level logging of interactions with the Kubernetes API and debug-level logging for the load balancer’s operations, apply the following settings:
-
Create a file named
hugconf.yamland add the following:hugconf.yamlyamlapiVersion: gate.v3.haproxy.org/v3kind: HugConfmetadata:name: hugconfnamespace: haproxy-unified-gatewayspec:logging:categoryLevelList:- category: k8slevel: Info- category: haproxycfglevel: DebugdefaultLevel: Debughugconf.yamlyamlapiVersion: gate.v3.haproxy.org/v3kind: HugConfmetadata:name: hugconfnamespace: haproxy-unified-gatewayspec:logging:categoryLevelList:- category: k8slevel: Info- category: haproxycfglevel: DebugdefaultLevel: DebugThis will create or update a HugConf resource named
hugconfin thehaproxy-unified-gatewaynamespace. In this file:categoryLevelListdefines the list of logging categories you want to include in the logs. In this example, the list includesk8sfor K8s API interactions andhaproxycfgfor load balancer operations.- Each entry has its own logging level. For
k8s, we set the level toInfoand forhaproxycfgwe set it toDebug. - If you don’t specify a
levelfor a logging category, its level is inherited from the value set bydefaultLevel.
-
Apply the configuration:
nixkubectl apply -f hugconf.yamlnixkubectl apply -f hugconf.yamloutputtexthugconf.gate.v3.haproxy.org/hugconf createdoutputtexthugconf.gate.v3.haproxy.org/hugconf created
View the controller logs Jump to heading
To view the logs for the HAProxy Unified Gateway pod, issue the following command:
nixkubectl logs -n haproxy-unified-gateway \$(kubectl get pods -A \| awk '/haproxy-unified-gateway/ && !/default/ && /Running/' \| awk 'NR==1{print $2}') $@
nixkubectl logs -n haproxy-unified-gateway \$(kubectl get pods -A \| awk '/haproxy-unified-gateway/ && !/default/ && /Running/' \| awk 'NR==1{print $2}') $@
This will show all of the logs generated within the pod that you specifed in your HugConf configuration. Depending on your settings, this may include the controller’s logs, the load balancer logs, and others.
outputtext2025-11-19T12:28:37.482Z [pebble] {"type":"security","datetime":"2025-11-19T12:28:37Z","level":"WARN","event":"sys_startup:1000","description":"Starting daemon","appid":"pebble"}2025-11-19T12:28:37.483Z [pebble] Started daemon.2025-11-19T12:28:37.503Z [pebble] POST /v1/services 6.039014ms 202 (http+unix)2025-11-19T12:28:37.509Z [pebble] Service "hug" starting: /var/lib/pebble/default/run-hug2025-11-19T12:28:37.512Z [pebble] Service "haproxy" starting: /var/lib/pebble/default/run-haproxy2025-11-19T12:28:37.520Z [hug] Memory limit for HUG: 853MiB2025-11-19T12:28:37.523Z [haproxy] Memory limit for HAProxy: 1706MiB2025-11-19T12:28:37.678Z [haproxy] [NOTICE] (19) : Initializing new worker (33)2025-11-19T12:28:37.685Z [haproxy] [NOTICE] (33) : haproxy version is 3.2.8-9200f392025-11-19T12:28:38.086Z [hug] _2025-11-19T12:28:38.086Z [hug] | |__ __ _ _ __ _ __ _____ ___ _2025-11-19T12:28:38.086Z [hug] | '_ \ / _` | '_ \| '__/ _ \ \/ / | | |2025-11-19T12:28:38.086Z [hug] | | | | (_| | |_) | | | (_) > <| |_| |2025-11-19T12:28:38.086Z [hug] |_| |_|\__,_| .__/|_| \___/_/\_\\__, |2025-11-19T12:28:38.086Z [hug] |_| __ _ _ |___/ _2025-11-19T12:28:38.086Z [hug] _ _ _ __ (_)/ _(_) ___ __| | __ _ __ _| |_ _____ ____ _ _ _2025-11-19T12:28:38.086Z [hug] | | | | '_ \| | |_| |/ _ \/ _` | / _` |/ _` | __/ _ \ \ /\ / / _` | | | |2025-11-19T12:28:38.086Z [hug] | |_| | | | | | _| | __/ (_| | | (_| | (_| | || __/\ V V / (_| | |_| |2025-11-19T12:28:38.086Z [hug] \__,_|_| |_|_|_| |_|\___|\__,_| \__, |\__,_|\__\___| \_/\_/ \__,_|\__, |2025-11-19T12:28:38.086Z [hug] |___/ |___/2025-11-19T12:28:38.086Z [hug]2025-11-19T12:28:38.086Z [hug] HAProxy unified gateway v0.7.02025-11-19T12:28:38.086Z [hug] built-from github.com/haproxytech/haproxy-unified-gateway2025-11-19T12:28:38.107Z [haproxy] [NOTICE] (19) : Loading success.2025-11-19T12:28:38.429Z [hug] {"time":"2025-11-19T12:28:38.426379208Z","level":"INFO","msg":"Starting EventSource","controller":"GatewayApiCRD","controllerGroup":"apiextensions.k8s.io","controllerKind":"CustomResourceDefinition","source":"kind source: *v1.PartialObjectMetadata","category":"k8s","sourceFile":{"file":"/go/pkg/mod/github.com/go-logr/logr@v1.4.3/logr.go","line":280}}...
outputtext2025-11-19T12:28:37.482Z [pebble] {"type":"security","datetime":"2025-11-19T12:28:37Z","level":"WARN","event":"sys_startup:1000","description":"Starting daemon","appid":"pebble"}2025-11-19T12:28:37.483Z [pebble] Started daemon.2025-11-19T12:28:37.503Z [pebble] POST /v1/services 6.039014ms 202 (http+unix)2025-11-19T12:28:37.509Z [pebble] Service "hug" starting: /var/lib/pebble/default/run-hug2025-11-19T12:28:37.512Z [pebble] Service "haproxy" starting: /var/lib/pebble/default/run-haproxy2025-11-19T12:28:37.520Z [hug] Memory limit for HUG: 853MiB2025-11-19T12:28:37.523Z [haproxy] Memory limit for HAProxy: 1706MiB2025-11-19T12:28:37.678Z [haproxy] [NOTICE] (19) : Initializing new worker (33)2025-11-19T12:28:37.685Z [haproxy] [NOTICE] (33) : haproxy version is 3.2.8-9200f392025-11-19T12:28:38.086Z [hug] _2025-11-19T12:28:38.086Z [hug] | |__ __ _ _ __ _ __ _____ ___ _2025-11-19T12:28:38.086Z [hug] | '_ \ / _` | '_ \| '__/ _ \ \/ / | | |2025-11-19T12:28:38.086Z [hug] | | | | (_| | |_) | | | (_) > <| |_| |2025-11-19T12:28:38.086Z [hug] |_| |_|\__,_| .__/|_| \___/_/\_\\__, |2025-11-19T12:28:38.086Z [hug] |_| __ _ _ |___/ _2025-11-19T12:28:38.086Z [hug] _ _ _ __ (_)/ _(_) ___ __| | __ _ __ _| |_ _____ ____ _ _ _2025-11-19T12:28:38.086Z [hug] | | | | '_ \| | |_| |/ _ \/ _` | / _` |/ _` | __/ _ \ \ /\ / / _` | | | |2025-11-19T12:28:38.086Z [hug] | |_| | | | | | _| | __/ (_| | | (_| | (_| | || __/\ V V / (_| | |_| |2025-11-19T12:28:38.086Z [hug] \__,_|_| |_|_|_| |_|\___|\__,_| \__, |\__,_|\__\___| \_/\_/ \__,_|\__, |2025-11-19T12:28:38.086Z [hug] |___/ |___/2025-11-19T12:28:38.086Z [hug]2025-11-19T12:28:38.086Z [hug] HAProxy unified gateway v0.7.02025-11-19T12:28:38.086Z [hug] built-from github.com/haproxytech/haproxy-unified-gateway2025-11-19T12:28:38.107Z [haproxy] [NOTICE] (19) : Loading success.2025-11-19T12:28:38.429Z [hug] {"time":"2025-11-19T12:28:38.426379208Z","level":"INFO","msg":"Starting EventSource","controller":"GatewayApiCRD","controllerGroup":"apiextensions.k8s.io","controllerKind":"CustomResourceDefinition","source":"kind source: *v1.PartialObjectMetadata","category":"k8s","sourceFile":{"file":"/go/pkg/mod/github.com/go-logr/logr@v1.4.3/logr.go","line":280}}...
Use the explain command Jump to heading
Use the kubectl explain command to see the full list of fields supported by the HugConf CRD:
nixkubectl explain hugconf --api-version=gate.v3.haproxy.org/v3 --recursive
nixkubectl explain hugconf --api-version=gate.v3.haproxy.org/v3 --recursive
outputtextGROUP: gate.v3.haproxy.orgKIND: HugConfVERSION: v3DESCRIPTION:HugConf is a specification for a the controller related configurationFIELDS:apiVersion <string>kind <string>...spec <Object> -required-logging <Object> -required-categoryLevelList <[]Object>category <string> -required-enum: k8s, gate, status, haproxycfg, ....level <string> -required-enum: Debug, Info, Warn, Error, ....defaultLevel <string>enum: Debug, Info, Warn, Error, ....
outputtextGROUP: gate.v3.haproxy.orgKIND: HugConfVERSION: v3DESCRIPTION:HugConf is a specification for a the controller related configurationFIELDS:apiVersion <string>kind <string>...spec <Object> -required-logging <Object> -required-categoryLevelList <[]Object>category <string> -required-enum: k8s, gate, status, haproxycfg, ....level <string> -required-enum: Debug, Info, Warn, Error, ....defaultLevel <string>enum: Debug, Info, Warn, Error, ....
You can examine fields in more detail by providing the specific field in the command, for example, hugconf.spec.logging.defaultLevel:
nixkubectl explain hugconf.spec.logging.defaultLevel --api-version=gate.v3.haproxy.org/v3 --recursive
nixkubectl explain hugconf.spec.logging.defaultLevel --api-version=gate.v3.haproxy.org/v3 --recursive