File tree Expand file tree Collapse file tree 3 files changed +14
-7
lines changed Expand file tree Collapse file tree 3 files changed +14
-7
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
2- set  -x 
2+ set  -exo pipefail 
33[ " $( pwd) " !=  " /etc/mysql/conf.d" &&  cp *  /etc/mysql/conf.d/
44
55HOST_ID=${HOSTNAME##* -} 
@@ -32,8 +32,8 @@ function wsrepForceBootstrap {
3232
3333if  [ $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" 
9393fi 
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
Original file line number Diff line number Diff line change 1+ #  yaml-language-server: $schema=https://json.schemastore.org/kustomization.json
12apiVersion : kustomize.config.k8s.io/v1beta1 
23kind : 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 
Original file line number Diff line number Diff 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 
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
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments