how to install a kibana-plugin in kibana hosted on kubernetes?

1/8/2020

I have an existing Kibana service running on top of Kubernetes. How to install a custom Kibana plugin in it.

I tried to install the plugin by running the following command inside the pod. But the plugin does not work.

bin/kibana-plugin install file:///tmp/myplugin-1.0.0.zip

Should I restart the Kibana service for the plugin to work? If yes, how to restart the Kibana service on Kubernetes? Or, is there any other steps that I am missing?

-- N Lohidasu Reddy
docker
elasticsearch
kibana
kibana-plugin
kubernetes

3 Answers

1/8/2020

It's not recommended to make changes directly to Pods, since they are continuously being replaced.

According to Kibana README.MD there is an option to install Kibana including a Yaml with all the special parameters, including the installation of Plugins.

Here's the full Values.yaml, I encourage you to check all the available parameters.

For Plugin installation we will be looking into lines 179-188 from default Values.yaml:

plugins:
  # set to true to enable plugins installation
  enabled: true
  # 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.31,https://github.com/sivasamyk/logtrail/releases/download/v0.1.31/logtrail-6.6.0-0.1.31.zip

Add or remove the desired plugins respecting the plugin_name,version,url format.

Save your file as values.yaml and run:

$ helm install stable/kibana --generate-name -f values.yaml

The defined plugins will be available once the service starts.

You can verify your values.yaml was processed by looking for the plugin names in the pod description:

$ kubectl --namespace=default describe pods -l "app=kibana"

Name:         kibana-1578496954-595c5856c7-82xbr
...///supressed output///...
Init Containers:
  kibana-plugins-install:
    Container ID:  docker://937c95da139361d8c0e524f9850ad6ab63e9364dc7c51c65a66fe6bb3445ceed
    Image:         docker.elastic.co/kibana/kibana-oss:6.7.0
    Image ID:      docker-pullable://docker.elastic.co/kibana/kibana-oss@sha256:9af7fbceb7c9a746df1f7dc79d2b3bb320f0fddf9b06a3cc12fd8f903902e731
    Command:
      /bin/bash
      -c
      set -e
      rm -rf plugins/lost+found
      plugins=(
      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.31,https://github.com/sivasamyk/logtrail/releases/download/v0.1.31/logtrail-6.6.0-0.1.31.zip
-- willrof
Source: StackOverflow

1/8/2020

You need to extend the kibana docker image with the plugin. Use the extended image to deploy kibana in k8s cluster

refer sample below

FROM docker.elastic.co/kibana/kibana-oss:6.1.1

RUN kibana-plugin install https://github.com/sivasamyk/logtrail/releases/download/v0.1.25/logtrail-6.1.1-0.1.25.zip
-- P Ekambaram
Source: StackOverflow

1/8/2020

I think the easiest way would be to install kibana using the helm chart: https://github.com/helm/charts/tree/master/stable/kibana

Helm lets you install an application on kubernetes while only having to configure some options, and in the case of kibana you can set the list of installed plugins. Check the link above for details about configuring the kibana chart, and you can see more about helm on their website: https://helm.sh/docs/intro/quickstart/

In order to install the chart, you use a file (values.yaml) containing configuration. In that file, present in the chart I linked to, you have the following section:

plugins:
  # 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.31,https://github.com/sivasamyk/logtrail/releases/download/v0.1.31/logtrail-6.6.0-0.1.31.zip
    # - other_plugin

So in your case you would use something like this:

plugins:
  enabled: true
  values:
  - myplugin, 0.1,http://_your_publicly_available_url/myplugin-1.0.0.zip
-- Radu Mazilu
Source: StackOverflow