
We add haproxy side-cont to the galera pod. We bind galera to port 33306 and haproxy takes its place with 3306. Haproxy starts with non-working backend. After it start, it checks for current leader in etcd, if there is none, it set current leader to itself. After that it updates its backend to connect to current leader. It does polling of this logic each 5 sec and if leader is changed it will update backend again. Other nodes do the same, so, in the end, each node will be connected to the same, single galera node. Change-Id: Ieb611661857de1828259b28f54f5a0390b1dd196
2 lines
91 B
Plaintext
2 lines
91 B
Plaintext
haproxy ALL=(root) NOPASSWD: /bin/chown -R haproxy\: /run/haproxy, /bin/mkdir /run/haproxy
|