elastic https disabled
This commit is contained in:
parent
65c544476b
commit
f7dc107107
@ -306,7 +306,7 @@ postStart:
|
||||
set -euo pipefail
|
||||
echo "[postStart] Waiting for Elasticsearch to be ready..." >&2
|
||||
for ((i=1; i<=MAX_RETRIES; i++)); do
|
||||
if /usr/bin/curl --cacert "$CA_CERT" -s -u "$ES_USERNAME:$ELASTIC_PASSWORD" "$ES_URL" >/dev/null; then
|
||||
if /usr/bin/curl -s "$ES_URL" >/dev/null; then # Removed --cacert and -u flags
|
||||
echo "[postStart] Elasticsearch is up after $i attempts!" >&2
|
||||
break
|
||||
fi
|
||||
@ -316,30 +316,69 @@ postStart:
|
||||
fi
|
||||
sleep 5
|
||||
done
|
||||
echo "[postStart] Loading index template from $TEMPLATE_PATH" >&2
|
||||
if ! /usr/bin/curl --cacert "$CA_CERT" -X PUT "$ES_URL/chat" \
|
||||
-u "$ES_USERNAME:$ES_PASSWORD" \
|
||||
echo "[postStart] Loading index templates..." >&2
|
||||
if ! /usr/bin/curl -X PUT "$ES_URL/chat" \ # Removed auth flags
|
||||
-H 'Content-Type: application/json' \
|
||||
--data-binary @"$TEMPLATE_PATH_1"; then
|
||||
echo "[postStart] ERROR: Failed to apply index template!" >&2
|
||||
echo "[postStart] ERROR: Failed to apply chat template!" >&2
|
||||
exit 1
|
||||
fi
|
||||
if ! /usr/bin/curl --cacert "$CA_CERT" -X PUT "$ES_URL/message" \
|
||||
-u "$ES_USERNAME:$ELASTIC_PASSWORD" \
|
||||
if ! /usr/bin/curl -X PUT "$ES_URL/message" \
|
||||
-H 'Content-Type: application/json' \
|
||||
--data-binary @"$TEMPLATE_PATH_2"; then
|
||||
echo "[postStart] ERROR: Failed to apply index template!" >&2
|
||||
echo "[postStart] ERROR: Failed to apply message template!" >&2
|
||||
exit 1
|
||||
fi
|
||||
if ! /usr/bin/curl --cacert "$CA_CERT" -X PUT "$ES_URL/user" \
|
||||
-u "$ES_USERNAME:$ELASTIC_PASSWORD" \
|
||||
if ! /usr/bin/curl -X PUT "$ES_URL/user" \
|
||||
-H 'Content-Type: application/json' \
|
||||
--data-binary @"$TEMPLATE_PATH_3"; then
|
||||
echo "[postStart] ERROR: Failed to apply index template!" >&2
|
||||
echo "[postStart] ERROR: Failed to apply user template!" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "[postStart] Index template 'chat_v1_idx' applied." >&2
|
||||
echo "Debug message" >> /poststart.log 2>&1
|
||||
echo "[postStart] All index templates applied successfully." >&2
|
||||
#postStart:
|
||||
# exec:
|
||||
# command:
|
||||
# - /bin/bash
|
||||
# - -c
|
||||
# - |
|
||||
# set -euo pipefail
|
||||
# echo "[postStart] Waiting for Elasticsearch to be ready..." >&2
|
||||
# for ((i=1; i<=MAX_RETRIES; i++)); do
|
||||
# if /usr/bin/curl --cacert "$CA_CERT" -s -u "$ES_USERNAME:$ELASTIC_PASSWORD" "$ES_URL" >/dev/null; then
|
||||
# echo "[postStart] Elasticsearch is up after $i attempts!" >&2
|
||||
# break
|
||||
# fi
|
||||
# if [ "$i" -eq "$MAX_RETRIES" ]; then
|
||||
# echo "[postStart] ERROR: Elasticsearch did not become ready after $MAX_RETRIES attempts." >&2
|
||||
# exit 1
|
||||
# fi
|
||||
# sleep 5
|
||||
# done
|
||||
# echo "[postStart] Loading index template from $TEMPLATE_PATH" >&2
|
||||
# if ! /usr/bin/curl --cacert "$CA_CERT" -X PUT "$ES_URL/chat" \
|
||||
# -u "$ES_USERNAME:$ES_PASSWORD" \
|
||||
# -H 'Content-Type: application/json' \
|
||||
# --data-binary @"$TEMPLATE_PATH_1"; then
|
||||
# echo "[postStart] ERROR: Failed to apply index template!" >&2
|
||||
# exit 1
|
||||
# fi
|
||||
# if ! /usr/bin/curl --cacert "$CA_CERT" -X PUT "$ES_URL/message" \
|
||||
# -u "$ES_USERNAME:$ELASTIC_PASSWORD" \
|
||||
# -H 'Content-Type: application/json' \
|
||||
# --data-binary @"$TEMPLATE_PATH_2"; then
|
||||
# echo "[postStart] ERROR: Failed to apply index template!" >&2
|
||||
# exit 1
|
||||
# fi
|
||||
# if ! /usr/bin/curl --cacert "$CA_CERT" -X PUT "$ES_URL/user" \
|
||||
# -u "$ES_USERNAME:$ELASTIC_PASSWORD" \
|
||||
# -H 'Content-Type: application/json' \
|
||||
# --data-binary @"$TEMPLATE_PATH_3"; then
|
||||
# echo "[postStart] ERROR: Failed to apply index template!" >&2
|
||||
# exit 1
|
||||
# fi
|
||||
# echo "[postStart] Index template 'chat_v1_idx' applied." >&2
|
||||
# echo "Debug message" >> /poststart.log 2>&1
|
||||
|
||||
sysctlInitContainer:
|
||||
enabled: true
|
||||
|
||||
Loading…
Reference in New Issue
Block a user