1
This commit is contained in:
parent
e6e093b7a1
commit
31bec3511e
42
base/haproxy/haproxy-configmap.yaml
Normal file
42
base/haproxy/haproxy-configmap.yaml
Normal file
@ -0,0 +1,42 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: haproxy-config
|
||||
data:
|
||||
haproxy.cfg: |
|
||||
global
|
||||
log /dev/log local0
|
||||
log /dev/log local1 notice
|
||||
daemon
|
||||
|
||||
defaults
|
||||
mode http
|
||||
balance roundrobin
|
||||
timeout client 10s
|
||||
timeout server 10s
|
||||
timeout connect 10s
|
||||
|
||||
frontend fe_8188
|
||||
mode http
|
||||
bind *:8188
|
||||
default_backend be_8188
|
||||
|
||||
frontend stats
|
||||
mode http
|
||||
bind *:8280
|
||||
stats enable
|
||||
stats refresh 10s
|
||||
stats uri /stats
|
||||
stats show-modules
|
||||
|
||||
backend be_8188
|
||||
mode http
|
||||
option httpchk GET /api/hq/sinahealth
|
||||
http-check expect status 200
|
||||
balance roundrobin
|
||||
server s1 119.29.148.232:8188 check
|
||||
server s2 43.139.100.109:8188 check
|
||||
server s3 43.136.103.146:8188 check
|
||||
server s4 119.29.79.240:8188 check
|
||||
server s5 129.204.226.60:8188 check
|
||||
server s6 119.91.60.129:8188 check
|
||||
13
base/haproxy/haproxy-service.yaml
Normal file
13
base/haproxy/haproxy-service.yaml
Normal file
@ -0,0 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: haproxy-service
|
||||
spec:
|
||||
ports:
|
||||
- port: 8188
|
||||
name: haproxy
|
||||
- port: 8280
|
||||
name: stats
|
||||
clusterIP: None
|
||||
selector:
|
||||
app: haproxy
|
||||
30
base/haproxy/haproxy-statefulset.yaml
Normal file
30
base/haproxy/haproxy-statefulset.yaml
Normal file
@ -0,0 +1,30 @@
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: haproxy
|
||||
spec:
|
||||
serviceName: "haproxy"
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: haproxy
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: haproxy
|
||||
spec:
|
||||
containers:
|
||||
- name: haproxy
|
||||
image: haproxy:3.1.8-alpine
|
||||
ports:
|
||||
- containerPort: 8188
|
||||
- containerPort: 8280 # 监控端口
|
||||
volumeMounts:
|
||||
- name: haproxy-config
|
||||
mountPath: /usr/local/etc/haproxy/haproxy.cfg
|
||||
subPath: haproxy.cfg
|
||||
readOnly: true
|
||||
volumes:
|
||||
- name: haproxy-config
|
||||
configMap:
|
||||
name: haproxy-config
|
||||
4
base/haproxy/kustomization.yaml
Normal file
4
base/haproxy/kustomization.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
resources:
|
||||
- haproxy-configmap.yaml
|
||||
- haproxy-statefulset.yaml
|
||||
- haproxy-service.yaml
|
||||
@ -16,6 +16,7 @@ resources:
|
||||
- ../base/redis-nodeport
|
||||
- ../base/tls
|
||||
- ../base/basic-auth
|
||||
- ../base/haproxy
|
||||
- ingress.yaml
|
||||
|
||||
configMapGenerator:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user