Skip to content

Commit fe28a39

Browse files
authored
chore: adopt old cluster without restart (#2437) (#2438)
1 parent 33299bb commit fe28a39

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

addons/clickhouse/scripts/clickhouse-ping.sh

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
set -euo pipefail
33

44
PORT="${CLICKHOUSE_HTTP_PORT:-8123}"
5-
CURL_ARGS=(
6-
-sf
7-
--max-time 3
8-
"http://127.0.0.1:${PORT}/ping"
9-
)
105

116
if [[ "${TLS_ENABLED:-false}" == "true" ]]; then
127
PORT="${CLICKHOUSE_HTTPS_PORT:-8443}"
@@ -18,9 +13,20 @@ if [[ "${TLS_ENABLED:-false}" == "true" ]]; then
1813
--key /etc/pki/tls/key.pem
1914
"https://127.0.0.1:${PORT}/ping"
2015
)
21-
fi
22-
23-
if ! /shared-tools/curl "${CURL_ARGS[@]}" >/dev/null; then
24-
echo "Readiness probe failed" >&2
25-
exit 1
16+
if ! /shared-tools/curl "${CURL_ARGS[@]}" >/dev/null; then
17+
echo "Readiness probe failed" >&2
18+
exit 1
19+
fi
20+
else
21+
wget_args=(
22+
-O /dev/null
23+
-q
24+
-T 3
25+
--tries=1
26+
)
27+
endpoint="http://127.0.0.1:${PORT}/ping"
28+
if ! /shared-tools/wget "${wget_args[@]}" "${endpoint}"; then
29+
echo "Readiness probe failed accessing ${endpoint}" >&2
30+
exit 1
31+
fi
2632
fi

addons/clickhouse/templates/cmpd-ch.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ spec:
2525
- -c
2626
- |
2727
cp /bin/curl /shared-tools/curl
28+
cp /bin/wget /shared-tools/wget
2829
chmod +x /shared-tools/curl
30+
chmod +x /shared-tools/wget
2931
volumeMounts:
3032
- name: shared-tools
3133
mountPath: /shared-tools

0 commit comments

Comments
 (0)