Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions base-defaultconfig/init.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
set -x
set -exo pipefail
[ "$(pwd)" != "/etc/mysql/conf.d" ] && cp * /etc/mysql/conf.d/

HOST_ID=${HOSTNAME##*-}
Expand Down Expand Up @@ -32,8 +32,8 @@ function wsrepForceBootstrap {

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

# https://github.com/docker-library/mariadb/blob/master/10.2/docker-entrypoint.sh#L62
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
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
7 changes: 7 additions & 0 deletions base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=https://json.schemastore.org/kustomization.json
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

Expand All @@ -6,3 +7,9 @@ resources:
- mariadb-ready-service.yaml
- mysql-service.yaml
- mariadb-statefulset.yaml

images:
- name: mariadb
newTag: 10.11.7-jammy@sha256:f94bd863dc16bf7b44957586d0c325462d4a65598d04ab952a9b73120a259b21
- name: prom/mysqld-exporter
newTag: v0.14.0@sha256:eb6fe170738bf9181c51f5bc89f93adb26672ec49ffdcb22f55c24834003b45d
6 changes: 3 additions & 3 deletions base/mariadb-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ spec:
mountPath: /etc/mysql/conf.d
- name: initdb
mountPath: /docker-entrypoint-initdb.d
image: mariadb:10.5.19-focal@sha256:ce75a36261b12948b411f6debb71254d92889c8a06e2ebc34c761f90416b1024
image: mariadb
containers:
- name: mariadb
image: mariadb:10.5.19-focal@sha256:ce75a36261b12948b411f6debb71254d92889c8a06e2ebc34c761f90416b1024
image: mariadb
ports:
- containerPort: 3306
name: mysql
Expand Down Expand Up @@ -85,7 +85,7 @@ spec:
- name: initdb
mountPath: /docker-entrypoint-initdb.d
- name: metrics
image: prom/mysqld-exporter:v0.14.0@sha256:eb6fe170738bf9181c51f5bc89f93adb26672ec49ffdcb22f55c24834003b45d
image: prom/mysqld-exporter
env:
- name: DATA_SOURCE_NAME
# https://github.com/prometheus/mysqld_exporter#required-grants
Expand Down