mirror of
https://github.com/helm/charts.git
synced 2026-08-23 22:37:45 +00:00
better health check in dashboard import init container if kibana is ready (#7526)
Signed-off-by: André Bauer <andre.bauer@kiwigrid.com>
This commit is contained in:
committed by
k8s-ci-robot
parent
dff594b3af
commit
7f7ddd1ab0
@@ -1,5 +1,5 @@
|
||||
name: kibana
|
||||
version: 0.13.0
|
||||
version: 0.13.1
|
||||
appVersion: 6.4.0
|
||||
description: Kibana is an open source data visualization plugin for Elasticsearch
|
||||
icon: https://raw.githubusercontent.com/elastic/kibana/master/src/ui/public/icons/kibana-color.svg
|
||||
|
||||
@@ -17,26 +17,27 @@ data:
|
||||
|
||||
cd /kibanadashboards
|
||||
|
||||
echo "starting kibana..."
|
||||
echo "Starting Kibana..."
|
||||
|
||||
/usr/local/bin/kibana-docker $@ &
|
||||
|
||||
echo "waiting up to {{ .Values.readinessProbe.initialDelaySeconds }} seconds for kibana to come up..."
|
||||
echo "Waiting up to 60 seconds for Kibana to get in green overall state..."
|
||||
|
||||
for i in {1..{{ .Values.readinessProbe.initialDelaySeconds }}}; do
|
||||
curl -Is localhost:5601/api/status | grep "HTTP.*200" > /dev/null && break || sleep 1
|
||||
for i in {1..60}; do
|
||||
curl -s localhost:5601/api/status | python -c 'import sys, json; print json.load(sys.stdin)["status"]["overall"]["state"]' 2> /dev/null | grep green > /dev/null && break || sleep 1
|
||||
done
|
||||
|
||||
for DASHBOARD_FILE in *; do
|
||||
echo -e "\nimporting ${DASHBOARD_FILE}..."
|
||||
echo -e "Importing ${DASHBOARD_FILE} dashboard..."
|
||||
|
||||
curl {{ if .Values.dashboardImport.xpackauth.enabled }}--user {{ .Values.dashboardImport.xpackauth.username }}:{{ .Values.dashboardImport.xpackauth.password }}{{ end }} -s --connect-timeout 60 --max-time 60 -XPOST localhost:5601/api/kibana/dashboards/import?force=true -H 'kbn-xsrf:true' -H 'Content-type:application/json' -d @./${DASHBOARD_FILE}
|
||||
curl -v {{ if .Values.dashboardImport.xpackauth.enabled }}--user {{ .Values.dashboardImport.xpackauth.username }}:{{ .Values.dashboardImport.xpackauth.password }}{{ end }} -s --connect-timeout 60 --max-time 60 -XPOST localhost:5601/api/kibana/dashboards/import?force=true -H 'kbn-xsrf:true' -H 'Content-type:application/json' -d @./${DASHBOARD_FILE}
|
||||
|
||||
if [ "$?" != "0" ]; then
|
||||
echo -e "\nimport of ${DASHBOARD_FILE} failed... restarting container..."
|
||||
echo -e "\nImport of ${DASHBOARD_FILE} dashboard failed... restarting container in 5 seconds..."
|
||||
sleep 5
|
||||
exit 1
|
||||
else
|
||||
echo -e "\nimport of ${DASHBOARD_FILE} finished :-)"
|
||||
echo -e "\nImport of ${DASHBOARD_FILE} dashboard finished :-)"
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user