Skip to content

Commit

Permalink
fix(clickhouse-keeper): update start script (#168)
Browse files Browse the repository at this point in the history
* fix(clickhouse-keeper): fix deployment, update NOTES.txt

* docs(clickhouse-keeper): add README.md

* feat(clickhouse-keeper): update bash scripts

* fix(clickhouse-keeper): invalid readinessProbe

* fix(clickhouse-keeper): podManagementPolicy=Parallel

* fix(clickhouse-keeper): update start script
  • Loading branch information
duyet authored May 21, 2024
1 parent c9dc7bd commit 3190722
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
19 changes: 12 additions & 7 deletions clickhouse-keeper/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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]}
Expand Down Expand Up @@ -89,11 +89,17 @@ data:
echo "</keeper_server></yandex>"
} > /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
# 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
keeperTeardown.sh: |
#!/usr/bin/env bash
Expand Down Expand Up @@ -151,7 +157,6 @@ 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
Expand Down Expand Up @@ -204,7 +209,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)
Expand Down
2 changes: 1 addition & 1 deletion clickhouse-keeper/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
replicas: {{ .Values.replicaCount }}
updateStrategy:
type: RollingUpdate
podManagementPolicy: OrderedReady
podManagementPolicy: Parallel
selector:
matchLabels:
{{- include "clickhouse-keeper.selectorLabels" . | nindent 6 }}
Expand Down
10 changes: 5 additions & 5 deletions clickhouse-keeper/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 3190722

Please sign in to comment.