Haproxy installation in OCP Document
Haproxy installation in OCP Document
containers:
- name: haproxy
#image:
registry.apigw.finopaymentbank.in:9443/haproxy/haproxy:1.8.23-1624151643
#image: registry.connect.redhat.com/haproxytech/haproxy
image: registry.connect.redhat.com/haproxytech/haproxy:1.8.23-1624151643
env:
- name: TZ
value: "Asia/Kolkata"
ports:
- containerPort: 8004
volumeMounts:
- name: haproxy-config-volume
mountPath: /etc/haproxy/haproxy.cfg
subPath: haproxy.cfg
volumes:
- name: haproxy-config-volume
configMap:
name: haproxy-config
4. Create HAproxy.cfg file
global
log 10.181.0.68:514 len 1024 local5 info
pidfile /var/lib/haproxy/haproxy.pid
maxconn 4000
#---------------------------------------------------------------------
# common defaults that all the 'listen' and 'backend' sections will
# use if not designated in their block
#---------------------------------------------------------------------
defaults
mode http
log global
option httplog
option dontlognull
option http-server-close
option forwardfor except 127.0.0.0/8
option redispatch
retries 3
timeout http-request 90s
timeout queue 90s
timeout connect 90s
timeout client 90s
timeout server 90s
timeout http-keep-alive 90s
timeout check 130s
maxconn 3000
default-server init-addr last,libc,none
#---------------------------------------------------------------------
# round robin balancing between the various backends
#---------------------------------------------------------------------
listen sts-bll-servers
bind *:8004
log-format %H\ %ci:%cp\ [%t]\ %ft\ %b/%s\ %Tq/%Tw/%Tc/%Tr/%Tt\ %ST\ %B\
%CC\ %fp\ %CS\ %tsc\ %ac/%fc/%bc/%sc/%rc\ %sq/%bq\ %hr\ %hs\ %{+Q}r
log 10.181.0.68 local5
balance roundrobin
server node1_10.182.0.200 10.182.0.200:8003 check inter 20s
server node2_10.182.0.201 10.182.0.201:8003 check inter 20s
server node3_10.182.0.202 10.182.0.202:8003 check inter 20s
server node4_10.182.0.203 10.182.0.203:8003 check inter 20s
5. Create service to call HAProxy BLL
kind: Service
apiVersion: v1
metadata:
namespace: 3scale-apicast
name: sts-api-servers
spec:
ports:
- name: sts-api-servers
port: 80
targetPort: 8004