[stable/kibana] Add kibana plugin installed control (#8581) (#8896)

* [stable/kibana] Add kibana plugin installed control and allow plugin upgrade (#8581)

        * stable/kibana Add kibana plugin installed control and allow plugin upgrade

        Signed-off-by: Jean-Baptiste Delpech <jb.delpech@gmail.com>

        * stable/kibana Add possibility to force plugins reset (remove all plugins before install)

	Signed-off-by: Jean-Baptiste Delpech <jb.delpech@gmail.com>

        * stable/kibana: Bumped Chart version to 0.17.0

        Signed-off-by: Jean-Baptiste Delpech <jb.delpech@gmail.com>

Signed-off-by: Jean-Baptiste Delpech <jb.delpech@gmail.com>

* CI please report

Signed-off-by: Jean-Baptiste Delpech <jb.delpech@gmail.com>
This commit is contained in:
jbdelpech
2018-11-05 05:03:58 -08:00
committed by k8s-ci-robot
parent 7a0265e620
commit e9f8ced10e
5 changed files with 49 additions and 12 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
name: kibana
version: 0.16.4
version: 0.17.0
appVersion: 6.4.2
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
+4 -2
View File
@@ -77,7 +77,9 @@ The following table lists the configurable parameters of the kibana chart and th
| `dashboardImport.xpackauth.username` | Optional Xpack username | `myuser` |
| `dashboardImport.xpackauth.password` | Optional Xpack password | `mypass` |
| `dashboardImport.dashboards` | Dashboards | `{}` |
| `plugins` | List of URLs pointing to zip files of Kibana plugins to install | None: |
| `plugins.enabled` | Enable installation of plugins. | `false` |
| `plugins.reset` | Optional : Remove all installed plugins before installing all new ones | `false` |
| `plugins.values` | List of plugins to install. Format <pluginName,version,URL> with URLs pointing to zip files of Kibana plugins to install | None: |
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
@@ -91,7 +93,7 @@ $ helm install stable/kibana --name my-release \
--set=image.tag=v0.0.2,resources.limits.cpu=200m
```
Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,
Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example :
```console
$ helm install stable/kibana --name my-release -f values.yaml
+9
View File
@@ -0,0 +1,9 @@
---
# enable the plugin init container with plugins retrieved from an URL
plugins:
enabled: true
reset: false
# Use <plugin_name,version,url> to add/upgrade plugin
values:
- logtrail,0.1.30,https://github.com/sivasamyk/logtrail/releases/download/v0.1.30/logtrail-6.4.2-0.1.30.zip
# - other_plugin
+25 -6
View File
@@ -25,7 +25,7 @@ spec:
{{- if .Values.priorityClassName }}
priorityClassName: "{{ .Values.priorityClassName }}"
{{- end }}
{{- if or (.Values.dashboardImport.dashboards) (.Values.plugins) }}
{{- if or (.Values.dashboardImport.dashboards) (.Values.plugins.enabled) }}
initContainers:
{{- if .Values.dashboardImport.dashboards }}
- name: {{ .Chart.Name }}-dashboardimport
@@ -59,7 +59,7 @@ spec:
subPath: {{ $configFile }}
{{- end }}
{{- end }}
{{- if .Values.plugins}}
{{- if .Values.plugins.enabled}}
- name: {{ .Chart.Name }}-plugins-install
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
@@ -69,13 +69,32 @@ spec:
- |
set -e
plugins=(
{{- range .Values.plugins }}
{{- range .Values.plugins.values }}
{{ . }}
{{- end }}
)
if {{ .Values.plugins.reset }}
then
for p in $(./bin/kibana-plugin list | cut -d "@" -f1)
do
./bin/kibana-plugin remove ${p}
done
fi
for i in "${plugins[@]}"
do
./bin/kibana-plugin install $i
IFS=',' read -ra PLUGIN <<< "$i"
pluginInstalledCheck=$(./bin/kibana-plugin list | grep "${PLUGIN[0]}" | cut -d '@' -f1 || true)
pluginVersionCheck=$(./bin/kibana-plugin list | grep "${PLUGIN[0]}" | cut -d '@' -f2 || true)
if [ "${pluginInstalledCheck}" = "${PLUGIN[0]}" ]
then
if [ "${pluginVersionCheck}" != "${PLUGIN[1]}" ]
then
./bin/kibana-plugin remove "${PLUGIN[0]}"
./bin/kibana-plugin install "${PLUGIN[2]}"
fi
else
./bin/kibana-plugin install "${PLUGIN[2]}"
fi
done
env:
{{- range $key, $value := .Values.env }}
@@ -141,7 +160,7 @@ spec:
mountPath: "/usr/share/kibana/config/{{ $configFile }}"
subPath: {{ $configFile }}
{{- end }}
{{- if .Values.plugins}}
{{- if .Values.plugins.enabled}}
- name: plugins
mountPath: /usr/share/kibana/plugins
{{- end }}
@@ -166,7 +185,7 @@ spec:
- name: {{ template "kibana.name" . }}
configMap:
name: {{ template "kibana.fullname" . }}
{{- if .Values.plugins}}
{{- if .Values.plugins.enabled}}
- name: plugins
emptyDir: {}
{{- end }}
+10 -3
View File
@@ -137,7 +137,14 @@ dashboardImport:
dashboards: {}
# k8s: https://raw.githubusercontent.com/monotek/kibana-dashboards/master/k8s-fluentd-elasticsearch.json
# List of pluginns to install using initContainer
# List of plugins to install using initContainer
plugins:
# - https://github.com/sivasamyk/logtrail/releases/download/v0.1.29/logtrail-6.4.0-0.1.29.zip
# - other_plugin
# set to true to enable plugins installation
enabled: false
# set to true to remove all kibana plugins before installation
reset: false
# Use <plugin_name,version,url> to add/upgrade plugin
values:
# - elastalert-kibana-plugin,1.0.1,https://github.com/bitsensor/elastalert-kibana-plugin/releases/download/1.0.1/elastalert-kibana-plugin-1.0.1-6.4.2.zip
# - logtrail,0.1.30,https://github.com/sivasamyk/logtrail/releases/download/v0.1.30/logtrail-6.4.2-0.1.30.zip
# - other_plugin