Custom configuration files and plugins
editCustom configuration files and plugins
editTo run Elasticsearch with specific plugins or configuration files installed on ECK, you have two options:
-
Create a custom container image with the required plugins and configuration files.
This option has the following pros and cons:
- Pro: Deployment is reproducible and reusable.
- Pro: Does not require internet access at runtime.
- Pro: Saves bandwidth and is quicker to start.
- Con: Requires a container registry and build infrastructure to build and host the custom image.
- Con: Version upgrades require building a new container image.
-
Use init containers to install plugins and configuration files.
This option has the following pros and cons:
- Pro: Easier to get started and upgrade versions.
- Con: Requires pods to have internet access.
- Con: Adding new Elasticsearch nodes could randomly fail due to network issues or bad configuration.
- Con: Each Elasticsearch node needs to repeat the download, wasting bandwidth and slowing startup.
- Con: Deployment manifests are more complicated.
See Creating custom images for instructions on how to build custom Docker images based on the official Elastic images.
The following example describes option 2, using a repository plugin. To install the plugin before the Elasticsearch nodes start, use an init container to run the plugin installation tool.
spec: nodeSets: - name: default count: 3 podTemplate: spec: initContainers: - name: install-plugins command: - sh - -c - | bin/elasticsearch-plugin install --batch repository-azure
To install custom configuration files you can use volumes and volume mounts.
The next example shows how to add a synonyms file for the synonym token filter in Elasticsearch. But you can use the same approach for any kind of file you want to mount into the configuration directory of Elasticsearch.