diff --git a/clickhouse-keeper/templates/configmap.yaml b/clickhouse-keeper/templates/configmap.yaml index 17b4319..d04bda9 100644 --- a/clickhouse-keeper/templates/configmap.yaml +++ b/clickhouse-keeper/templates/configmap.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: - name: { { include "clickhouse-keeper.configMapName" . } } + name: {{ include "clickhouse-keeper.configMapName" . }} data: keeper_config.xml: | {{ .Values.keeperConfig | nindent 4 }} @@ -34,7 +34,7 @@ data: set -ex source /conf/env.sh source /conf/keeperFunctions.sh - + HOST=`hostname -s` if [[ $HOST =~ (.*)-([0-9]+)$ ]]; then NAME=${BASH_REMATCH[1]} @@ -89,17 +89,11 @@ data: echo "" } > /tmp/clickhouse-keeper/config.d/generated-keeper-settings.xml fi - - # run clickhouse-keeper + + # run clickhouse-keeper cat /tmp/clickhouse-keeper/config.d/generated-keeper-settings.xml rm -rfv /var/lib/clickhouse-keeper/terminated - # clickhouse-keeper --config-file=/etc/clickhouse-keeper/keeper_config.xml - - if [[ "1" == "$MY_ID" ]]; then - clickhouse-keeper --config-file=/etc/clickhouse-keeper/keeper_config.xml --force-recovery - else - clickhouse-keeper --config-file=/etc/clickhouse-keeper/keeper_config.xml - fi + clickhouse-keeper --config-file=/etc/clickhouse-keeper/keeper_config.xml keeperTeardown.sh: | #!/usr/bin/env bash @@ -157,6 +151,7 @@ data: touch /var/lib/clickhouse-keeper/terminated # Kill the primary process ourselves to circumvent the terminationGracePeriodSeconds ps -ef | grep clickhouse-keeper | grep -v grep | awk '{print $1}' | xargs kill + keeperLive.sh: | #!/usr/bin/env bash @@ -209,7 +204,7 @@ data: exit 0 else echo "clickhouse-keeper instance is ready to add as participant with 1 weight." - + ROLE=participant WEIGHT=1 KEEPER_URL=$(keeperConnectionString) diff --git a/clickhouse-keeper/templates/statefulset.yaml b/clickhouse-keeper/templates/statefulset.yaml index f08eaf0..692372d 100644 --- a/clickhouse-keeper/templates/statefulset.yaml +++ b/clickhouse-keeper/templates/statefulset.yaml @@ -8,7 +8,7 @@ spec: replicas: {{ .Values.replicaCount }} updateStrategy: type: RollingUpdate - podManagementPolicy: Parallel + podManagementPolicy: OrderedReady selector: matchLabels: {{- include "clickhouse-keeper.selectorLabels" . | nindent 6 }} diff --git a/clickhouse-keeper/values.yaml b/clickhouse-keeper/values.yaml index e1810b4..076591d 100644 --- a/clickhouse-keeper/values.yaml +++ b/clickhouse-keeper/values.yaml @@ -53,11 +53,11 @@ livenessProbe: exec: command: - /conf/keeperLive.sh - failureThreshold: 3 - initialDelaySeconds: 60 - periodSeconds: 10 - successThreshold: 1 - timeoutSeconds: 10 + failureThreshold: 3 + initialDelaySeconds: 60 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 10 readinessProbe: exec: