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
26 changes: 16 additions & 10 deletions addons/clickhouse/scripts/clickhouse-ping.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
set -euo pipefail

PORT="${CLICKHOUSE_HTTP_PORT:-8123}"
CURL_ARGS=(
-sf
--max-time 3
"http://127.0.0.1:${PORT}/ping"
)

if [[ "${TLS_ENABLED:-false}" == "true" ]]; then
PORT="${CLICKHOUSE_HTTPS_PORT:-8443}"
Expand All @@ -18,9 +13,20 @@ if [[ "${TLS_ENABLED:-false}" == "true" ]]; then
--key /etc/pki/tls/key.pem
"https://127.0.0.1:${PORT}/ping"
)
fi

if ! /shared-tools/curl "${CURL_ARGS[@]}" >/dev/null; then
echo "Readiness probe failed" >&2
exit 1
if ! /shared-tools/curl "${CURL_ARGS[@]}" >/dev/null; then
echo "Readiness probe failed" >&2
exit 1
fi
else
wget_args=(
-O /dev/null
-q
-T 3
--tries=1
)
endpoint="http://127.0.0.1:${PORT}/ping"
if ! /shared-tools/wget "${wget_args[@]}" "${endpoint}"; then
echo "Readiness probe failed accessing ${endpoint}" >&2
exit 1
fi
fi
2 changes: 2 additions & 0 deletions addons/clickhouse/templates/cmpd-ch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ spec:
- -c
- |
cp /bin/curl /shared-tools/curl
cp /bin/wget /shared-tools/wget
chmod +x /shared-tools/curl
chmod +x /shared-tools/wget
volumeMounts:
- name: shared-tools
mountPath: /shared-tools
Expand Down