aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/common/mysql/templates/statefulset.yaml
diff options
context:
space:
mode:
authorNeha Jain <neha.jain3@amdocs.com>2018-04-03 11:34:59 -0400
committerNeha Jain <neha.jain3@amdocs.com>2018-04-03 11:35:04 -0400
commitbaadb38f90168c15b9fc6007b507269ff5c47551 (patch)
treee4b7d55e5d0b721c7e1739efc4db555de32e038d /kubernetes/common/mysql/templates/statefulset.yaml
parente611ada51899fd20ba069e75ad1aa718289d33f8 (diff)
Multi-site High-availability Manual Failover (PoC)
Change-Id: Ib11a01170962a932466bcfb1b12e6e0563476e73 Signed-off-by: Neha Jain <neha.jain3@amdocs.com> Issue-ID: SDNC-214
Diffstat (limited to 'kubernetes/common/mysql/templates/statefulset.yaml')
-rw-r--r--kubernetes/common/mysql/templates/statefulset.yaml6
1 files changed, 4 insertions, 2 deletions
diff --git a/kubernetes/common/mysql/templates/statefulset.yaml b/kubernetes/common/mysql/templates/statefulset.yaml
index 7b55bf2be0..e3f3428fbd 100644
--- a/kubernetes/common/mysql/templates/statefulset.yaml
+++ b/kubernetes/common/mysql/templates/statefulset.yaml
@@ -45,10 +45,11 @@ spec:
# Generate mysql server-id from pod ordinal index.
[[ `hostname` =~ -([0-9]+)$ ]] || exit 1
ordinal=${BASH_REMATCH[1]}
+ siteId={{ .Values.geoSiteId }}
echo BASH_REMATCH=${BASH_REMATCH}
echo [mysqld] > /mnt/conf.d/server-id.cnf
# Add an offset to avoid reserved server-id=0 value.
- echo server-id=$((100 + $ordinal)) >> /mnt/conf.d/server-id.cnf
+ echo server-id=$(($siteId*100 + $ordinal)) >> /mnt/conf.d/server-id.cnf
# Copy appropriate conf.d files from config-map to emptyDir.
if [[ $ordinal -eq 0 ]]; then
cp /mnt/config-map/master.cnf /mnt/conf.d/
@@ -93,7 +94,7 @@ spec:
subPath: mysql
- name: conf
mountPath: /etc/mysql/conf.d
-
+
containers:
#sdnc-db-container
- name: {{ include "common.name" . }}
@@ -236,3 +237,4 @@ spec:
#{{ else }}
emptyDir: {}
#{{ end }}
+