Kibana Helm Chart

November 16, 2022 ยท View on GitHub

Build Status Artifact HUB

This Helm chart is a lightweight way to configure and run our official Kibana Docker image.

Warning When it comes to running the Elastic on Kubernetes infrastructure, we recommend Elastic Cloud on Kubernetes (ECK) as the best way to run and manage the Elastic Stack.

ECK offers many operational benefits for both our basic-tier and our enterprise-tier customers, such as spinning up cluster nodes that were lost on failed infrastructure, seamless upgrades, rolling cluster changes, and much much more.

With the release of the Elastic Stack Helm charts for Elastic version 8.5.1, we are handing over the ongoing maintenance of our Elastic Stack Helm charts to the community and contributors. This repository will finally be archived after 6 months time. Elastic Stacks deployed on Kubernetes through Helm charts will still be fully supported under EOL limitations.

Since we want to provide an even better experience for our customers by running the Elastic Stack on Kubernetes, we will continue maintaining the Helm charts applicable to ECK Custom Resources. These charts can be found in the ECK repository.

Helm charts will currently be maintained for ECK Enterprise-tier customers, however, we encourage the community to engage with the existing Helm charts for the Elastic Stack and continue supporting their ongoing maintenance.

See https://github.com/elastic/helm-charts/issues/1731 for more details.

Requirements

See supported configurations for more details.

Installing

Install a released version using the Helm repository

  • Add the Elastic Helm charts repo: helm repo add elastic https://helm.elastic.co

  • Install it: helm install kibana elastic/kibana

Install a development version using the main branch

  • Clone the git repo: git clone git@github.com:elastic/helm-charts.git

  • Install it: helm install kibana ./helm-charts/kibana --set imageTag=8.5.1

Upgrading

Please always check CHANGELOG.md and BREAKING_CHANGES.md before upgrading to a new chart version.

Usage notes

  • Automated testing of this chart is currently only run against GKE (Google Kubernetes Engine).

  • This repo includes several examples of configurations that can be used as a reference. They are also used in the automated testing of this chart.

Configuration

ParameterDescriptionDefault
affinityConfigurable affinity{}
annotationsConfigurable annotations on the deployment object{}
automountTokenWhether or not to automount the service account token in the Podtrue
elasticsearchHostsThe URLs used to connect to Elasticsearchhttps://elasticsearch-master:9200
elasticsearchCertificateSecretThe name of the K8S secret that contains the Elasticsearch certificateelasticsearch-master-certs
elasticsearchCertificateAuthoritiesFileThe name of the certificate file into the elasticsearchCertificateSecret K8S secretca.crt
elasticsearchCredentialSecretThe name of the K8S secret that contains the Elasticsearch credentialselasticsearch-master-credentials
envFromTemplatable string to be passed to the environment from variables which will be appended to the envFrom: definition for the container[]
extraContainersTemplatable string of additional containers to be passed to the tpl function[]
extraEnvsExtra environment variables which will be appended to the env: definition for the containersee values.yaml
extraInitContainersTemplatable string of additional containers to be passed to the tpl function[]
extraVolumeMountsConfiguration for additional volumeMounts[]
extraVolumesConfiguration for additional volumes[]
fullnameOverrideOverrides the full name of the resources. If not set the name will default to " .Release.Name - .Values.nameOverride orChart.Name """
healthCheckPathThe path used for the readinessProbe to check that Kibana is ready. If you are setting server.basePath you will also need to update this to /${basePath}/app/kibana/app/kibana
hostAliasesConfigurable hostAliases[]
httpPortThe http port that Kubernetes will use for the healthchecks and the service5601
imagePullPolicyThe Kubernetes imagePullPolicyvalueIfNotPresent
imagePullSecretsConfiguration for imagePullSecrets so that you can use a private registry for your image[]
imageTagThe Kibana Docker image tag8.5.1
imageThe Kibana Docker imagedocker.elastic.co/kibana/kibana
ingressConfigurable ingress to expose the Kibana service.see values.yaml
kibanaConfigAllows you to add any config files in /usr/share/kibana/config/ such as kibana.yml See values.yaml for an example of the formatting{}
labelsConfigurable labels applied to all Kibana pods{}
lifecycleAllows you to add lifecycle hooks. See values.yaml for an example of the formatting{}
nameOverrideOverrides the chart name for resources. If not set the name will default to .Chart.Name""
nodeSelectorConfigurable nodeSelector so that you can target specific nodes for your Kibana instances{}
podAnnotationsConfigurable annotations applied to all Kibana pods{}
podSecurityContextAllows you to set the securityContext for the podsee values.yaml
priorityClassNameThe name of the PriorityClass. No default is supplied as the PriorityClass must be created first""
protocolThe protocol that will be used for the readinessProbe. Change this to https if you have server.ssl.enabled: true sethttp
readinessProbeConfiguration for the readiness probesee values.yaml
replicasKubernetes replica count for the Deployment (i.e. how many pods)1
resourcesAllows you to set the resources for the Deploymentsee values.yaml
secretMountsAllows you easily mount a secret as a file inside the Deployment. Useful for mounting certificates and other secrets. See values.yaml for an example[]
securityContextAllows you to set the securityContext for the containersee values.yaml
serverHostThe server.host Kibana setting. This is set explicitly so that the default always matches what comes with the Docker image0.0.0.0
serviceAccountAllows you to overwrite the "default" serviceAccount for the pod[]
serviceConfigurable service to expose the Kibana service.see values.yaml
tolerationsConfigurable tolerations)[]
updateStrategyAllows you to change the default updateStrategy for the Deployment. A standard upgrade of Kibana requires a full stop and start which is why the default strategy is set to Recreatetype: Recreate

FAQ

How to deploy this chart on a specific K8S distribution?

This chart is highly tested with GKE, but some K8S distribution also requires specific configurations.

We provide examples of configuration for the following K8S providers:

How to use Kibana with security (authentication and TLS) enabled?

Starting with 8.x the default Elasticsearch Helm chart is automatically configured with security enabled (authentification and TLS).

As the Elasticsearch credentials and certificates are available in some Kubernetes secrets generated by the Elasticsearch chart, the Kibana chart is configured to read these secrets to configure the secure connection to Elasticsearch (The secrets names can be overrided in the chart values).

Therefore, Kibana is automatically configured to required authentication. You can connect to Kibana with the elastic user account that comes from Elasticsearch. The password can be find in the elasticsearchCredentialSecret (see the chart notes).

:warning: Note that in production, the elastic user should only be used to create new users.

This Helm chart can also use existing Kubernetes secrets to set up TLS certificates. These secrets should be created outside of this chart and accessed using the environment variables and volumes.

An example can be found in examples/security.

How to install plugins?

The recommended way to install plugins into our Docker images is to create a custom Docker image.

The Dockerfile would look something like this:

ARG kibana_version
FROM docker.elastic.co/kibana/kibana:${kibana_version}

RUN bin/kibana-plugin install <plugin_url>

And then updating the image in values to point to your custom image.

There are a couple of reasons we recommend this:

  1. Tying the availability of Kibana to the download service to install plugins is not a great idea or something that we recommend. Especially in Kubernetes where it is normal and expected for a container to be moved to another host at random times.
  2. Mutating the state of a running Docker image (by installing plugins) goes against the best practices of containers and immutable infrastructure.

How to import objects post-deployment?

You can use postStart lifecycle hooks to run code triggered after a container is created.

Here is an example of postStart hook to import an index-pattern and a dashboard:

lifecycle:
  postStart:
    exec:
      command:
        - bash
        - -c
        - |
          #!/bin/bash
          # Import a dashboard
          KB_URL=http://localhost:5601
          while [[ "$(curl -s -o /dev/null -w '%{http_code}\n' -L $KB_URL)" != "200" ]]; do sleep 1; done
          curl -XPOST "$KB_URL/api/kibana/dashboards/import" -H "Content-Type: application/json" -H 'kbn-xsrf: true' -d'{"objects":[{"type":"index-pattern","id":"my-pattern","attributes":{"title":"my-pattern-*"}},{"type":"dashboard","id":"my-dashboard","attributes":{"title":"Look at my dashboard"}}]}'

Contributing

Please check CONTRIBUTING.md before any contribution or for any questions about our development and testing process.