add haproxy cfg
This commit is contained in:
parent
e2c4cc762f
commit
598afb19d4
|
|
@ -0,0 +1,28 @@
|
|||
#!/bin/bash
|
||||
|
||||
START_PORT=30000
|
||||
END_PORT=31000
|
||||
|
||||
for PORT in $(seq $START_PORT $END_PORT); do
|
||||
cat <<EOF
|
||||
frontend tcp-$PORT
|
||||
mode tcp
|
||||
bind *:$PORT
|
||||
option tcplog
|
||||
default_backend tcp-$PORT
|
||||
|
||||
backend tcp-$PORT
|
||||
mode tcp
|
||||
balance roundrobin
|
||||
option tcplog
|
||||
option dontlog-normal
|
||||
option dontlognull
|
||||
option tcp-check
|
||||
default-server check maxconn 50
|
||||
server gpu-1 10.140.224.11:$PORT check
|
||||
server gpu-2 10.140.224.12:$PORT check
|
||||
server gpu-3 10.140.224.13:$PORT check
|
||||
|
||||
EOF
|
||||
done
|
||||
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
global
|
||||
log /dev/log local0
|
||||
log /dev/log local1 notice
|
||||
chroot /var/lib/haproxy
|
||||
stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
|
||||
stats timeout 30s
|
||||
user haproxy
|
||||
group haproxy
|
||||
daemon
|
||||
|
||||
# Default SSL material locations
|
||||
ca-base /etc/ssl/certs
|
||||
crt-base /etc/ssl/private
|
||||
|
||||
# See: https://ssl-config.mozilla.org/#server=haproxy&server-version=2.0.3&config=intermediate
|
||||
ssl-default-bind-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
|
||||
ssl-default-bind-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256
|
||||
ssl-default-bind-options ssl-min-ver TLSv1.2 no-tls-tickets
|
||||
|
||||
defaults
|
||||
log global
|
||||
mode http
|
||||
option httplog
|
||||
option dontlognull
|
||||
timeout connect 5000
|
||||
timeout client 50000
|
||||
timeout server 50000
|
||||
errorfile 400 /etc/haproxy/errors/400.http
|
||||
errorfile 403 /etc/haproxy/errors/403.http
|
||||
errorfile 408 /etc/haproxy/errors/408.http
|
||||
errorfile 500 /etc/haproxy/errors/500.http
|
||||
errorfile 502 /etc/haproxy/errors/502.http
|
||||
errorfile 503 /etc/haproxy/errors/503.http
|
||||
errorfile 504 /etc/haproxy/errors/504.http
|
||||
|
||||
frontend http
|
||||
mode http
|
||||
bind :80
|
||||
|
||||
#acl ing_http_acl hdr(host) -f /etc/haproxy/ing_app.acl
|
||||
#use_backend ing_http if ing_http_acl
|
||||
|
||||
default_backend http
|
||||
|
||||
#http-request redirect scheme https code 301 unless { ssl_fc }
|
||||
#redirect scheme https code 301 if !{ ssl_fc }
|
||||
|
||||
frontend https
|
||||
mode tcp
|
||||
bind :443
|
||||
log global
|
||||
#acl ing_https_acl req.ssl_sni -f /etc/haproxy/ing_app.acl
|
||||
#tcp-request inspect-delay 5s
|
||||
#tcp-request content accept if { req.ssl_hello_type 1 }
|
||||
#use_backend ing_https if ing_https_acl
|
||||
default_backend https
|
||||
|
||||
#http-request redirect scheme https code 301 unless { ssl_fc }
|
||||
#redirect scheme https code 301 if !{ ssl_fc }
|
||||
|
||||
backend http
|
||||
mode http
|
||||
balance roundrobin
|
||||
option tcplog
|
||||
option dontlog-normal
|
||||
option dontlognull
|
||||
option tcp-check
|
||||
default-server check maxconn 1500
|
||||
server service1 10.140.224.148:30100 check inter 10s fastinter 2s rise 1 fall 3 weight 1
|
||||
server service2 10.140.224.149:30100 check inter 10s fastinter 2s rise 1 fall 3 weight 1
|
||||
server service3 10.140.224.150:30100 check inter 10s fastinter 2s rise 1 fall 3 weight 1
|
||||
|
||||
backend https
|
||||
mode tcp
|
||||
balance roundrobin
|
||||
option tcplog
|
||||
option dontlog-normal
|
||||
option dontlognull
|
||||
option tcp-check
|
||||
default-server check maxconn 1500
|
||||
server service1 10.140.224.148:30101 check inter 10s fastinter 2s rise 1 fall 3 weight 1
|
||||
server service2 10.140.224.149:30101 check inter 10s fastinter 2s rise 1 fall 3 weight 1
|
||||
server service3 10.140.224.150:30101 check inter 10s fastinter 2s rise 1 fall 3 weight 1
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
global
|
||||
log /dev/log local0
|
||||
log /dev/log local1 notice
|
||||
chroot /var/lib/haproxy
|
||||
stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
|
||||
stats timeout 30s
|
||||
user haproxy
|
||||
group haproxy
|
||||
daemon
|
||||
|
||||
# Default SSL material locations
|
||||
ca-base /etc/ssl/certs
|
||||
crt-base /etc/ssl/private
|
||||
|
||||
# See: https://ssl-config.mozilla.org/#server=haproxy&server-version=2.0.3&config=intermediate
|
||||
ssl-default-bind-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
|
||||
ssl-default-bind-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256
|
||||
ssl-default-bind-options ssl-min-ver TLSv1.2 no-tls-tickets
|
||||
|
||||
defaults
|
||||
log global
|
||||
mode http
|
||||
option httplog
|
||||
option dontlognull
|
||||
timeout connect 5000
|
||||
timeout client 50000
|
||||
timeout server 50000
|
||||
errorfile 400 /etc/haproxy/errors/400.http
|
||||
errorfile 403 /etc/haproxy/errors/403.http
|
||||
errorfile 408 /etc/haproxy/errors/408.http
|
||||
errorfile 500 /etc/haproxy/errors/500.http
|
||||
errorfile 502 /etc/haproxy/errors/502.http
|
||||
errorfile 503 /etc/haproxy/errors/503.http
|
||||
errorfile 504 /etc/haproxy/errors/504.http
|
||||
|
||||
# Frontend 설정: Kubernetes API에 대한 트래픽을 수신하는 부분
|
||||
frontend kubernetes_api
|
||||
mode tcp # TCP 모드로 작동
|
||||
bind *:6443 # 모든 IP에서 6443 포트에 바인딩
|
||||
option tcplog # TCP 요청에 대한 로그 기록 활성화
|
||||
default_backend kubernetes_master # 기본 백엔드로 kubernetes_master 설정
|
||||
|
||||
# Backend 설정: Kubernetes 마스터 노드에 대한 트래픽을 처리하는 부분
|
||||
backend kubernetes_master
|
||||
mode tcp # TCP 모드로 작동
|
||||
balance roundrobin # 라운드 로빈 방식으로 트래픽 분산
|
||||
option tcplog # TCP 요청에 대한 로그 기록 활성화
|
||||
option dontlog-normal # 정상적인 요청에 대한 로그 기록 비활성화
|
||||
option dontlognull # NULL 요청에 대한 로그 기록 비활성화
|
||||
option tcp-check # TCP 체크 기능 활성화 (서버 상태 확인)
|
||||
default-server check maxconn 1500 # 기본 서버에 대한 체크 및 최대 연결 수 설정
|
||||
|
||||
# Kubernetes 마스터 서버 설정
|
||||
server master1 10.140.224.141:6443 check # 첫 번째 마스터 노드
|
||||
server master2 10.140.224.142:6443 check # 두 번째 마스터 노드
|
||||
server master3 10.140.224.143:6443 check # 세 번째 마스터 노드
|
||||
|
||||
frontend http
|
||||
mode http
|
||||
bind :80
|
||||
# different with nexus
|
||||
|
||||
default_backend http
|
||||
|
||||
#http-request redirect scheme https code 301 unless { ssl_fc }
|
||||
#redirect scheme https code 301 if !{ ssl_fc }
|
||||
|
||||
frontend https
|
||||
mode tcp
|
||||
bind :443
|
||||
|
||||
default_backend https
|
||||
|
||||
#http-request redirect scheme https code 301 unless { ssl_fc }
|
||||
#redirect scheme https code 301 if !{ ssl_fc }
|
||||
|
||||
backend http
|
||||
mode http
|
||||
balance roundrobin
|
||||
option tcplog
|
||||
option dontlog-normal
|
||||
option dontlognull
|
||||
option tcp-check
|
||||
default-server check maxconn 1500
|
||||
server worker1 10.140.224.144:30100 check inter 10s fastinter 2s rise 1 fall 3 weight 1
|
||||
server worker2 10.140.224.145:30100 check inter 10s fastinter 2s rise 1 fall 3 weight 1
|
||||
server worker3 10.140.224.148:30100 check inter 10s fastinter 2s rise 1 fall 3 weight 1
|
||||
|
||||
backend https
|
||||
mode tcp
|
||||
balance roundrobin
|
||||
option tcplog
|
||||
option dontlog-normal
|
||||
option dontlognull
|
||||
option tcp-check
|
||||
default-server check maxconn 1500
|
||||
server worker1 10.140.224.144:30101 check inter 10s fastinter 2s rise 1 fall 3 weight 1
|
||||
server worker2 10.140.224.145:30101 check inter 10s fastinter 2s rise 1 fall 3 weight 1
|
||||
server worker3 10.140.224.148:30101 check inter 10s fastinter 2s rise 1 fall 3 weight 1
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
for i in $(seq 29 35); do
|
||||
NODE_NAME="gpu-$i"
|
||||
echo "라벨 추가 중: $NODE_NAME ..."
|
||||
kubectl label node "$NODE_NAME" nodegroup=a100 --overwrite
|
||||
done
|
||||
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
for i in $(seq 1 24); do
|
||||
NODE_NAME="gpu-$i"
|
||||
echo "라벨 추가 중: $NODE_NAME ..."
|
||||
kubectl label node "$NODE_NAME" nodegroup=h100 --overwrite
|
||||
done
|
||||
|
||||
Loading…
Reference in New Issue