blob: a953a508bf20424f933d450cb67571f03d9e9461 [file] [log] [blame]
Sylvain Desbureaux47eb4d22020-12-10 12:15:27 +01001{{/*
Sylvain Desbureaux70070412020-11-09 21:58:48 +01002# Copyright © 2018 Amdocs, Bell Canada, AT&T
efiacord12c1672023-03-23 12:10:50 +00003# Modifications Copyright © 2023 Nordix Foundation
Sylvain Desbureaux70070412020-11-09 21:58:48 +01004#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
Sylvain Desbureaux47eb4d22020-12-10 12:15:27 +010016*/}}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010017global
18 log /dev/log local0
19 stats socket /usr/local/etc/haproxy/haproxy.socket mode 660 level admin
20 stats timeout 30s
leila8bd5bf32022-11-16 19:42:09 -050021 # it is required else pod will not come up
22 maxconn 50000
Niharika Sharma22a994c2022-11-25 11:32:27 -050023 user haproxy
24 group haproxy
Sylvain Desbureaux70070412020-11-09 21:58:48 +010025 daemon
26 #################################
27 # Default SSL material locations#
28 #################################
29 ca-base /etc/ssl/certs
30 crt-base /etc/ssl/private
31
32 # Default ciphers to use on SSL-enabled listening sockets.
33 # For more information, see ciphers(1SSL). This list is from:
34 # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
35 # An alternative list with additional directives can be obtained from
36 # https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy
37 tune.ssl.default-dh-param 2048
38
39defaults
40 log global
41 mode http
42 option httplog
leila8bd5bf32022-11-16 19:42:09 -050043 option httpchk
44 http-check send meth GET uri /aai/util/echo ver HTTP/1.1 hdr Host aai hdr X-TransactionId haproxy-0111 hdr X-FromAppId haproxy hdr Accept application/json hdr Authorization 'Basic QUFJOkFBSQ=='
Sylvain Desbureaux70070412020-11-09 21:58:48 +010045 default-server init-addr none
46# option dontlognull
47# errorfile 400 /etc/haproxy/errors/400.http
48# errorfile 403 /etc/haproxy/errors/403.http
49# errorfile 408 /etc/haproxy/errors/408.http
50# errorfile 500 /etc/haproxy/errors/500.http
51# errorfile 502 /etc/haproxy/errors/502.http
52# errorfile 503 /etc/haproxy/errors/503.http
53# errorfile 504 /etc/haproxy/errors/504.http
54
55 option http-server-close
56 option forwardfor except 127.0.0.1
57 retries 6
58 option redispatch
59 maxconn 50000
60 timeout connect 50000
61 timeout client 480000
62 timeout server 480000
63 timeout http-keep-alive 30000
64
leila8bd5bf32022-11-16 19:42:09 -050065frontend stats
66 bind *:8448
67 http-request use-service prometheus-exporter if { path /metrics }
68 stats enable
69 stats uri /stats
70 stats refresh 10s
Sylvain Desbureaux70070412020-11-09 21:58:48 +010071
osk1146127fd7d82021-06-18 00:51:17 +020072frontend IST_8080
73 mode http
74 bind 0.0.0.0:8080
75 log-format "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC \ %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r"
76 option httplog
77 log global
78 option logasap
79 option forwardfor
80 capture request header Host len 100
81 capture response header Host len 100
82 option log-separate-errors
83 option forwardfor
84 http-request set-header X-Forwarded-Proto http
leila8bd5bf32022-11-16 19:42:09 -050085 http-request set-header X-Forwarded-Proto http
86 http-request add-header X-Forwarded-Port 8080
osk1146127fd7d82021-06-18 00:51:17 +020087
88#######################
89#ACLS FOR PORT 8446####
90#######################
91
92 acl is_Port_8446_generic path_reg -i ^/aai/v[0-9]+/search/generic-query$
93 acl is_Port_8446_nodes path_reg -i ^/aai/v[0-9]+/search/nodes-query$
94 acl is_Port_8446_version path_reg -i ^/aai/v[0-9]+/query$
95 acl is_dsl path_reg -i ^/aai/v[0-9]+/dsl$
96 acl is_named-query path_beg -i /aai/search/named-query
97 acl is_search-model path_beg -i /aai/search/model
98 use_backend IST_AAI_8446 if is_Port_8446_generic or is_Port_8446_nodes or is_Port_8446_version or is_named-query or is_search-model or is_dsl
99
100 default_backend IST_Default_8447
101
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100102#######################
103#ACLS FOR PORT 8446####
104#######################
105
106 acl is_Port_8446_generic path_reg -i ^/aai/v[0-9]+/search/generic-query$
107 acl is_Port_8446_nodes path_reg -i ^/aai/v[0-9]+/search/nodes-query$
108 acl is_Port_8446_version path_reg -i ^/aai/v[0-9]+/query$
109 acl is_dsl path_reg -i ^/aai/v[0-9]+/dsl$
110 acl is_named-query path_beg -i /aai/search/named-query
111 acl is_search-model path_beg -i /aai/search/model
112 use_backend IST_AAI_8446 if is_Port_8446_generic or is_Port_8446_nodes or is_Port_8446_version or is_named-query or is_search-model or is_dsl
113
114 default_backend IST_Default_8447
115
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100116#######################
osk1146127fd7d82021-06-18 00:51:17 +0200117#DEFAULT BACKEND 8447##
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100118#######################
119
120backend IST_Default_8447
121 balance roundrobin
leila8bd5bf32022-11-16 19:42:09 -0500122 stick-table type string len 100 size 200k expire 2m
123 stick on path
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100124 http-request set-header X-Forwarded-Port %[src_port]
125 http-response set-header Strict-Transport-Security max-age=16000000;\ includeSubDomains;\ preload;
leila8bd5bf32022-11-16 19:42:09 -0500126 server-template aai-resources.{{.Release.Namespace}} {{$.Values.haproxy.replicas.aaiResources}} aai-resources.{{.Release.Namespace}}.svc.cluster.local:8447 resolvers kubernetes check port 8447
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100127
128#######################
129# BACKEND 8446#########
130#######################
131
132backend IST_AAI_8446
133 balance roundrobin
leila8bd5bf32022-11-16 19:42:09 -0500134 stick-table type string len 100 size 200k expire 2m
135 stick on path
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100136 http-request set-header X-Forwarded-Port %[src_port]
137 http-response set-header Strict-Transport-Security max-age=16000000;\ includeSubDomains;\ preload;
leila8bd5bf32022-11-16 19:42:09 -0500138 server-template aai-traversal.{{.Release.Namespace}} {{$.Values.haproxy.replicas.aaiTraversal}} aai-traversal.{{.Release.Namespace}}.svc.cluster.local:8446 resolvers kubernetes check port 8446