minikube/deploy/addons/auto-pause/haproxy.cfg.tmpl

38 lines
1.3 KiB
Cheetah
Raw Normal View History

2021-02-09 00:24:29 +00:00
#---------------------------------------------------------------------
# Configure HAProxy for Kubernetes API Server
#---------------------------------------------------------------------
listen stats
bind *:9000
mode http
stats enable
stats hide-version
2021-02-09 22:30:00 +00:00
stats uri /
2021-02-09 00:24:29 +00:00
stats refresh 30s
option httplog
# change haproxy.cfg file with the following
global
2021-02-16 02:40:29 +00:00
lua-load /etc/haproxy/unpause.lua
2021-02-09 00:24:29 +00:00
############## Configure HAProxy Secure Frontend #############
frontend k8s-api-https-proxy
2021-02-09 22:30:00 +00:00
bind *:6443
2021-02-09 00:24:29 +00:00
mode tcp
tcp-request inspect-delay 5s
tcp-request content accept if { req.ssl_hello_type 1 }
default_backend k8s-api-https
############## Configure HAProxy SecureBackend #############
backend k8s-api-https
balance roundrobin
mode tcp
2021-02-16 02:40:29 +00:00
#tcp-request inspect-delay 10s
#tcp-request content lua.foo_action
tcp-request inspect-delay 10s
2021-05-18 01:07:04 +00:00
tcp-request content lua.unpause {{.NetworkInfo.ControlPlaneNodeIP}} 8080
2021-02-16 02:40:29 +00:00
tcp-request content reject if { var(req.blocked) -m bool }
2021-02-09 00:24:29 +00:00
option tcplog
option tcp-check
default-server inter 10s downinter 5s rise 2 fall 2 slowstart 60s maxconn 250 maxqueue 256 weight 100
2021-05-18 01:30:18 +00:00
server k8s-api-1 {{.NetworkInfo.ControlPlaneNodeIP}}:{{.NetworkInfo.ControlPlaneNodePort}} check
2021-02-09 22:30:00 +00:00