Skip to content

Instantly share code, notes, and snippets.

@haproxytechblog
Last active February 19, 2021 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haproxytechblog/20d756c6df565f51da7042de9bd2c694 to your computer and use it in GitHub Desktop.
Save haproxytechblog/20d756c6df565f51da7042de9bd2c694 to your computer and use it in GitHub Desktop.
Logging with the HAProxy Kubernetes Ingress Controller
$ kubectl logs haproxy-kubernetes-ingress-6bbb4f9f5f-lt8j
2021/02/03 17:19:42 HAProxy Ingress Controller v1.5.0 a5e81ae
2021/02/03 17:19:42 Build from: git@github.com:haproxytech/kubernetes-ingress.git
2021/02/03 17:19:42 Build date: 2021-01-21T10:15:17
2021/02/03 17:19:42 ConfigMap: default/haproxy-kubernetes-ingress
2021/02/03 17:19:42 Ingress class:
2021/02/03 17:19:42 Publish service:
2021/02/03 17:19:42 Default backend service: default/haproxy-kubernetes-ingress-default-backend
2021/02/03 17:19:42 Default ssl certificate: default/haproxy-kubernetes-ingress-default-cert
2021/02/03 17:19:42 Frontend HTTP listening on: 0.0.0.0:80
2021/02/03 17:19:42 Frontend HTTPS listening on: 0.0.0.0:443
2021/02/03 17:19:42 Controller sync period: 5s
$ helm install haproxy haproxytech/kubernetes-ingress \
--set controller.logging.level=debug
apiVersion: v1
kind: ConfigMap
metadata:
name: haproxy-kubernetes-ingress
namespace: default
data:
syslog-server: "address:stdout, format: raw, facility:daemon"
$ kubectl apply -f configmap.yaml
$ helm install haproxy haproxytech/kubernetes-ingress \
--set controller.logging.level=debug \
--set controller.logging.traffic.address=stdout \
--set controller.logging.traffic.format=raw \
--set controller.logging.traffic.facility=daemon
syslog-server: "address:stdout, format: raw, facility:daemon"
syslog-server: "address:127.0.0.1, facility:local0"
syslog-server: "address: syslog.monitoring.svc.cluster.local, facility:local0"
10.244.0.1:5793 [10/Apr/2020:10:32:50.132] https~ test-echo1-8080/SRV_TFW8V 0/0/1/2/3 200 653 - - ---- 1/1/0/0/0 0/0 "GET test.k8s.local/ HTTP/2.0
apiVersion: v1
kind: ConfigMap
metadata:
name: haproxy-kubernetes-ingress
namespace: default
data:
request-capture: hdr(X-Amzn-Trace-Id)
10.13.19.44:10550 [10/Oct/2020:19:36:52.985] http default-service-log-statsd-haproxy-http/SRV_REhnI 0/0/0/-1/2 -1 0 - - SD-- 8/8/0/0/0 0/0 {Root=1-5e9df9d4-ca09fd0867923f2862d8504a} "HEAD stats.staging.example.com/check HTTP/1.1"
apiVersion: v1
kind: ConfigMap
metadata:
name: haproxy-kubernetes-ingress
namespace: default
data:
request-capture: hdr(Authorization),field(1," ")
apiVersion: v1
kind: ConfigMap
metadata:
name: haproxy-kubernetes-ingress
namespace: default
data:
rate-limit-requests: 5
request-capture: sc0_http_req_rate(RateLimit-1000)
10.244.1.1:27774 [10/Oct/2020:14:11:06.216] http echo-http-8080/SRV_GWfOI 0/0/0/0/0 200 656 - - ---- 1/1/0/0/0 0/0 {1} "GET echo-1.k8s.local/ HTTP/1.1"
[....]
10.244.1.1:4415 [10/Oct/2020:14:11:06.264] http echo-http-8080/SRV_VHnHJ 0/0/0/0/0 200 656 - - ---- 1/1/0/0/0 0/0 {5} "GET echo-1.k8s.local/ HTTP/1.1"
2172.18.0.2:7523 [10/Oct/2020:14:11:06.275] http http/<NOSRV> 0/-1/-1/-1/0 403 212 - - PR-- 1/1/0/0/0 0/0 {} "GET echo-1.k8s.local/ HTTP/1.1"
apiVersion: v1
kind: ConfigMap
metadata:
name: haproxy-kubernetes-ingress
namespace: default
data:
request-capture: |
ssl_fc_is_resumed
ssl_c_s_dn
ssl_fc_cipher
172.18.0.2:5099 [10/Oct/2020:15:14:08.677] https~ echo-http-8080/SRV_VHnHJ 0/0/0/0/0 200 732 - - ---- 1/1/0/0/0 0/0 {0||TLS_AES_256_GCM_SHA384} "GET echo-1.k8s.local/echo-1 HTTP/2.0"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment