HAProxy Kubernetes Ingress Controller Documentation 1.6

Enable logging for HAProxy Kubernetes Ingress Controller

When you install the Kubernetes Ingress Controller, it captures logs from the controller itself. Use kubectl logs to view the logs of the ingress controller pod:

$ kubectl logs kubernetes-ingress-7d84545b45-fpzm9 -n haproxy-controller

  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

By default, this will not include access logs from requests and responses. However, by adding the following ConfigMap to your cluster, access logs will also be displayed when you call kubectl logs.

apiVersion: v1
kind: ConfigMap
metadata:
  name: haproxy
  namespace: haproxy-controller
data:
  syslog-server: "address:stdout, format: raw, facility:daemon"

You will then see access logs:

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"

Next up

View Prometheus metrics and other statistics