Skip to content

Commit 3191d9c

Browse files
loomtsapecloud-bot
authored andcommitted
chore: ck ping use wget instead of curl (#2230)
(cherry picked from commit b708239)
1 parent 637bfd8 commit 3191d9c

File tree

3 files changed

+25
-16
lines changed

3 files changed

+25
-16
lines changed
Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,26 @@
11
#!/bin/bash
22
set -euo pipefail
33

4-
TLS_MOUNT_PATH="/etc/pki/tls"
5-
READINESS_PROBE_TIMEOUT="${READINESS_PROBE_TIMEOUT:-3}"
64
HOST="127.0.0.1"
75
SCHEME="http"
86
PORT="${CLICKHOUSE_HTTP_PORT:-8123}"
97

10-
curl_args=(
11-
--silent
12-
--show-error
13-
--fail
14-
--connect-timeout "${READINESS_PROBE_TIMEOUT}"
15-
--max-time "${READINESS_PROBE_TIMEOUT}"
8+
wget_args=(
9+
--spider
10+
-q
11+
-T 3
12+
--tries=1
1613
)
1714

1815
if [[ "${TLS_ENABLED:-false}" == "true" ]]; then
1916
SCHEME="https"
2017
PORT="${CLICKHOUSE_HTTPS_PORT:-8443}"
21-
if [[ -f "${TLS_MOUNT_PATH}/ca.pem" ]]; then
22-
curl_args+=(--cacert "${TLS_MOUNT_PATH}/ca.pem")
23-
fi
24-
if [[ -f "${TLS_MOUNT_PATH}/cert.pem" && -f "${TLS_MOUNT_PATH}/key.pem" ]]; then
25-
curl_args+=(--cert "${TLS_MOUNT_PATH}/cert.pem" --key "${TLS_MOUNT_PATH}/key.pem")
26-
fi
18+
wget_args+=(--no-check-certificate)
2719
fi
2820

2921
endpoint="${SCHEME}://${HOST}:${PORT}/ping"
3022

31-
if ! curl "${curl_args[@]}" "${endpoint}" >/dev/null; then
23+
if ! /shared-tools/wget "${wget_args[@]}" "${endpoint}"; then
3224
echo "Readiness probe failed accessing ${endpoint}" >&2
3325
exit 1
3426
fi

addons/clickhouse/templates/cmpd-ch.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,18 @@ spec:
1919
fsGroup: 0
2020
seccompProfile:
2121
type: RuntimeDefault
22+
initContainers:
23+
- name: copy-tools
24+
imagePullPolicy: {{ .Values.busyboxImage.pullPolicy }}
25+
command:
26+
- sh
27+
- -c
28+
- |
29+
cp /bin/wget /shared-tools/wget
30+
chmod +x /shared-tools/wget
31+
volumeMounts:
32+
- name: shared-tools
33+
mountPath: /shared-tools
2234
containers:
2335
- name: clickhouse
2436
imagePullPolicy: {{ default "IfNotPresent" .Values.image.pullPolicy }}
@@ -70,12 +82,17 @@ spec:
7082
mountPath: /etc/clickhouse-client
7183
- name: scripts
7284
mountPath: /scripts
85+
- name: shared-tools
86+
mountPath: /shared-tools
7387
env:
7488
- name: CURRENT_POD_NAME
7589
valueFrom:
7690
fieldRef:
7791
apiVersion: v1
7892
fieldPath: metadata.name
93+
volumes:
94+
- name: shared-tools
95+
emptyDir: {}
7996
updateStrategy: BestEffortParallel
8097
logConfigs:
8198
{{- range $name, $pattern := .Values.logConfigs }}

addons/clickhouse/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ backupImage:
4747
registry: ""
4848
repository: apecloud/clickhouse-backup-full
4949
pullPolicy: IfNotPresent
50-
tag: 2.6.14
50+
tag: 2.6.14

0 commit comments

Comments
 (0)