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