Create custom images

edit

You can create your own custom application images (Elasticsearch, Kibana, APM Server, Enterprise Search, Beats, Elastic Agent, and Elastic Maps Server) instead of using the base images provided by Elastic. You might want to do this to have a canonical image with all the necessary plugins pre-loaded rather than installing them through an init container each time a Pod starts. You must use the official image as the base for custom images. For example, if you want to create an Elasticsearch 8.16.0 image with the ICU Analysis Plugin, you can do the following:

  1. Create a Dockerfile containing:

    FROM docker.elastic.co/elasticsearch/elasticsearch:8.16.0
    RUN bin/elasticsearch-plugin install --batch analysis-icu
  2. Build the image with:

    docker build --tag elasticsearch-icu:8.16.0

There are various hosting options for your images. If you use Google Kubernetes Engine, it is automatically configured to use the Google Container Registry. Check Using Container Registry with Google Cloud for more information. To use the image, you can then push to the registry with:

docker tag elasticsearch-icu:8.16.0 gcr.io/$PROJECT-ID/elasticsearch-icu:8.16.0
docker push gcr.io/$PROJECT-ID/elasticsearch-icu:8.16.0

Configure your Elasticsearch specification to use the newly pushed image, for example:

spec:
  version: 8.16.0
  image: gcr.io/$PROJECT-ID/elasticsearch-icu:8.16.0

Providing the correct version is always required as ECK reasons about APIs and capabilities available to it based on the version field.

The steps are similar for Azure Kubernetes Service and AWS Elastic Container Registry.

If your custom images follow the naming convention adopted by the official images, and you only want to use your custom images, you can also simply override the container registry.

For more information, check the following references: