Skip to content

Commit

Permalink
[stable/kibana] possility customize url for dashboard import script (h…
Browse files Browse the repository at this point in the history
…elm#23192)

* [stable/kibana] possility customize url for dashboard import script

Signed-off-by: mikhail_znak <[email protected]>

* [stable/kibana] possility customize url for dashboard import script

Signed-off-by: mikhail_znak <[email protected]>

Co-authored-by: mikhail_znak <[email protected]>
  • Loading branch information
2 people authored and KinsheX committed Jul 20, 2020
1 parent 5699aef commit b32080a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion stable/kibana/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: kibana
version: 3.2.6
version: 3.2.7
appVersion: 6.7.0
description: Kibana is an open source data visualization plugin for Elasticsearch
icon: https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt8781708f8f37ed16/5c11ec2edf09df047814db23/logo-elastic-kibana-lt.svg
Expand Down
1 change: 1 addition & 0 deletions stable/kibana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ The following table lists the configurable parameters of the kibana chart and th
| `tolerations` | List of node taints to tolerate | `[]` |
| `dashboardImport.enabled` | Enable dashboard import | `false` |
| `dashboardImport.timeout` | Time in seconds waiting for Kibana to be in green overall state | `60` |
| `dashboardImport.basePath` | Customizing base path url during dashboard import | `/` |
| `dashboardImport.xpackauth.enabled` | Enable Xpack auth | `false` |
| `dashboardImport.xpackauth.username` | Optional Xpack username | `myuser` |
| `dashboardImport.xpackauth.password` | Optional Xpack password | `mypass` |
Expand Down
6 changes: 3 additions & 3 deletions stable/kibana/templates/configmap-dashboardimport.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ data:
echo "Waiting up to {{ .Values.dashboardImport.timeout }} seconds for Kibana to get in green overall state..."
for i in {1..{{ .Values.dashboardImport.timeout }}}; 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
curl -s localhost:5601{{ .Values.dashboardImport.basePath }}/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
Expand All @@ -34,11 +34,11 @@ data:
echo "${DASHBOARD_FILE} is not valid JSON, assuming it's an URL..."
TMP_FILE="$(mktemp)"
curl -s $(cat ${DASHBOARD_FILE}) > ${TMP_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 @${TMP_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{{ .Values.dashboardImport.basePath }}/api/kibana/dashboards/import?force=true -H 'kbn-xsrf:true' -H 'Content-type:application/json' -d @${TMP_FILE}
rm ${TMP_FILE}
else
echo "Valid JSON found in ${DASHBOARD_FILE}, importing..."
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}
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{{ .Values.dashboardImport.basePath }}/api/kibana/dashboards/import?force=true -H 'kbn-xsrf:true' -H 'Content-type:application/json' -d @./${DASHBOARD_FILE}
fi
if [ "$?" != "0" ]; then
Expand Down
1 change: 1 addition & 0 deletions stable/kibana/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ podLabels: {}
dashboardImport:
enabled: false
timeout: 60
basePath: /
xpackauth:
enabled: false
username: myuser
Expand Down

0 comments on commit b32080a

Please sign in to comment.