-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathsecret-redis-proxy.yaml
66 lines (61 loc) · 2.08 KB
/
secret-redis-proxy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{{- if and (.Values.app.cache.redis.enabled) (.Values.app.cache.redis.sentinelProxy.enabled) }}
{{- $type := "sec" -}}
{{- $action := "redis-proxy" -}}
{{- $Name := include "passbolt-library.fullname" . -}}
{{- $fullName := printf "%s-%s-%s" $Name $type $action -}}
apiVersion: v1
kind: Secret
metadata:
name: {{ $fullName }}
labels:
{{- include "passbolt-library.labels" . | nindent 4 }}
{{- include "passbolt-library.selectorLabels" . | nindent 4 }}
{{- include "passbolt-library.typelabels" (dict "action" $action "type" $type) | nindent 4 }}
annotations:
helm.sh/hook: pre-upgrade,pre-install
helm.sh/hook-weight: "-6"
helm.sh/hook-delete-policy: before-hook-creation
type: Opaque
stringData:
haproxy.cfg: |
global
log stdout format raw local0
maxconn 1024
resolvers mydns
parse-resolv-conf
hold valid 10s
defaults REDIS
default-server init-addr libc,none
log global
mode tcp
timeout connect 4s
timeout server 330s
timeout client 330s
timeout check 2s
option redispatch
retries 300
frontend ft_redis_master
bind 127.0.0.1:6379
use_backend bk_redis_master
backend bk_redis_master
mode tcp
option tcp-check
tcp-check connect
{{- if .Values.redis.auth.enabled -}}
{{- if .Values.redis.global.redis.password -}}
tcp-check send AUTH\ {{ .Values.redis.global.redis.password }}\r\n
{{- else }}
tcp-check send AUTH\ {{ .Values.redis.auth.password }}\r\n
{{- end }}
{{- end }}
tcp-check send PING\r\n
tcp-check expect string +PONG
tcp-check send info\ replication\r\n
tcp-check expect string role:master
tcp-check send QUIT\r\n
tcp-check expect string +OK
{{- $nodeCount := int .Values.redis.replica.replicaCount }}
{{- range $i := until $nodeCount }}
server R{{ $i }} {{ $.Release.Name }}-redis-node-{{ $i }}.{{ $.Release.Name }}-redis-headless.{{ $.Release.Namespace }}.svc.cluster.local:6379 resolvers mydns check inter 1s fall 1 rise 1
{{- end }}
{{- end }}