Skip to content

Commit ead659f

Browse files
authored
Merge pull request #39 from Yolean/mariadb-10.11.x
Mariadb 10.11.x
2 parents fe56ddd + 7e8ac56 commit ead659f

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

base-defaultconfig/init.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
set -x
2+
set -exo pipefail
33
[ "$(pwd)" != "/etc/mysql/conf.d" ] && cp * /etc/mysql/conf.d/
44

55
HOST_ID=${HOSTNAME##*-}
@@ -32,8 +32,8 @@ function wsrepForceBootstrap {
3232

3333
if [ $HOST_ID -eq 0 ]; then
3434
echo "This is the 1st statefulset pod. Checking if the statefulset is down ..."
35-
getent hosts mariadb-ready
36-
[ $? -eq 2 ] && {
35+
GETENT_EXIT=0; getent hosts mariadb-ready || GETENT_EXIT="$?"
36+
[ $GETENT_EXIT -eq 2 ] && {
3737
# https://github.com/docker-library/mariadb/commit/f76084f0f9dc13f29cce48c727440eb79b4e92fa#diff-b0fa4b30392406b32de6b8ffe36e290dR80
3838
if [ ! -d "$DATADIR/mysql" ]; then
3939
echo "No database in $DATADIR; configuring $POD_NAME for initial start"
@@ -93,4 +93,4 @@ else
9393
fi
9494

9595
# https://github.com/docker-library/mariadb/blob/master/10.2/docker-entrypoint.sh#L62
96-
mysqld --verbose --help --log-bin-index="$(mktemp -u)" | tee /tmp/mariadb-start-config | grep -e ^version -e ^datadir -e ^wsrep -e ^binlog -e ^character-set -e ^collation
96+
mysqld --verbose --help --log-bin-index="$(mktemp -u)" 2>&1 | tee /tmp/mariadb-start-config | grep -e ^version -e ^datadir -e ^wsrep -e ^binlog -e ^character-set -e ^collation

base/kustomization.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# yaml-language-server: $schema=https://json.schemastore.org/kustomization.json
12
apiVersion: kustomize.config.k8s.io/v1beta1
23
kind: Kustomization
34

@@ -6,3 +7,9 @@ resources:
67
- mariadb-ready-service.yaml
78
- mysql-service.yaml
89
- mariadb-statefulset.yaml
10+
11+
images:
12+
- name: mariadb
13+
newTag: 10.11.7-jammy@sha256:f94bd863dc16bf7b44957586d0c325462d4a65598d04ab952a9b73120a259b21
14+
- name: prom/mysqld-exporter
15+
newTag: v0.14.0@sha256:eb6fe170738bf9181c51f5bc89f93adb26672ec49ffdcb22f55c24834003b45d

base/mariadb-statefulset.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ spec:
4747
mountPath: /etc/mysql/conf.d
4848
- name: initdb
4949
mountPath: /docker-entrypoint-initdb.d
50-
image: mariadb:10.5.19-focal@sha256:ce75a36261b12948b411f6debb71254d92889c8a06e2ebc34c761f90416b1024
50+
image: mariadb
5151
containers:
5252
- name: mariadb
53-
image: mariadb:10.5.19-focal@sha256:ce75a36261b12948b411f6debb71254d92889c8a06e2ebc34c761f90416b1024
53+
image: mariadb
5454
ports:
5555
- containerPort: 3306
5656
name: mysql
@@ -85,7 +85,7 @@ spec:
8585
- name: initdb
8686
mountPath: /docker-entrypoint-initdb.d
8787
- name: metrics
88-
image: prom/mysqld-exporter:v0.14.0@sha256:eb6fe170738bf9181c51f5bc89f93adb26672ec49ffdcb22f55c24834003b45d
88+
image: prom/mysqld-exporter
8989
env:
9090
- name: DATA_SOURCE_NAME
9191
# https://github.com/prometheus/mysqld_exporter#required-grants

0 commit comments

Comments
 (0)