Skip to content

Commit

Permalink
Merge pull request #42 from hoatle/bugs/#41-mysqlha-backup
Browse files Browse the repository at this point in the history
Bugs/#41 mysqlha backup
  • Loading branch information
hoatle authored Sep 6, 2022
2 parents 892b1c3 + b7731eb commit 9074aa7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- name: Create kind cluster
uses: helm/[email protected]
with:
config: e2e-kind/kind-config.yaml
config: kind/kind-config.yaml
if: steps.list-changed.outputs.changed == 'true'

# should create different k8s cluster versions
Expand Down
2 changes: 1 addition & 1 deletion charts/mysqlha/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: mysqlha
version: 0.4.1-alpha.1
version: 0.4.1-alpha.2
apiVersion: v1
appVersion: 5.7.13
description: MySQL cluster with a single master and zero or more slave replicas
Expand Down
15 changes: 6 additions & 9 deletions charts/mysqlha/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,15 @@ spec:
# In case of container restart, attempt this at-most-once.
cp change_master_to.sql.in change_master_to.sql.orig
mysql -h 127.0.0.1 --verbose<<EOF
STOP SLAVE IO_THREAD;
$(<change_master_to.sql.orig),
cat > change_master_to.sql.orig <<EOF
MASTER_HOST='{{ template "fullname" . }}-0.{{ template "fullname" . }}',
MASTER_USER='${MYSQL_REPLICATION_USER}',
MASTER_PASSWORD='${MYSQL_REPLICATION_PASSWORD}',
MASTER_CONNECT_RETRY=10;
MASTER_CONNECT_RETRY=10
EOF
mysql -h 127.0.0.1 --verbose<<EOF
STOP SLAVE IO_THREAD;
$(<change_master_to.sql.orig);
START SLAVE;
EOF
fi
Expand All @@ -247,11 +249,6 @@ spec:
env:
- name: MYSQL_HOST
value: 127.0.0.1
- name: MYSQL_PWD
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
key: mysql-root-password
- name: MYSQL_REPLICATION_USER
value: {{ .Values.mysqlha.mysqlReplicationUser }}
- name: MYSQL_REPLICATION_PASSWORD
Expand Down
7 changes: 2 additions & 5 deletions charts/mysqlha/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
kubeMeta:
appsApiVersion: apps/v1

mysqlImage: mysql:5.7.13
# TODO(hoatle): use teracy/xtrabackup:2.4 by default instead
xtraBackupImage: gcr.io/google-samples/xtrabackup:1.0
mysqlImage: mysql:5.7.36
xtraBackupImage: teracy/xtrabackup:2.4
imagePullPolicy: IfNotPresent

mysqlha:
Expand All @@ -26,7 +25,6 @@ mysqlha:
# mysqlUser:
# mysqlPassword: ## Default: random 10 character string


## Allow unauthenticated access, uncomment to enable
##
# mysqlAllowEmptyPassword: true
Expand Down Expand Up @@ -100,4 +98,3 @@ backup:
xtrabackup --backup --compress --host=$MYSQL_HOST --user=$MYSQL_REPLICATION_USER --password=$MYSQL_REPLICATION_PASSWORD
tail -f /dev/null # keep running
extraVolumeMounts:

0 comments on commit 9074aa7

Please sign in to comment.