Creating custom images

edit

You can create your own custom Elasticsearch or Kibana image instead of using the base image provided by Elastic. You might want to do this to preload plugins in the image rather than having to install them via init container each time a pod starts. To do this, you must use the official image as the base for it to function properly. For example, if you want to create an Elasticsearch 8.17.0 image with the Google Cloud Storage Repository Plugin, you can do the following:

  1. Create a Dockerfile containing:

    FROM docker.elastic.co/elasticsearch/elasticsearch:8.17.0
    RUN bin/elasticsearch-plugin install --batch repository-gcs
  2. Build the image with:

    docker build --tag elasticsearch-gcs:8.17.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 (see here for more information). To use the image, you can then push to the registry with:

docker tag elasticsearch-gcs:8.17.0 gcr.io/$PROJECT-ID/elasticsearch-gcs:8.17.0
docker push gcr.io/$PROJECT-ID/elasticsearch-gcs:8.17.0

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

spec:
  version: 8.17.0
  image: gcr.io/$PROJECT-ID/elasticsearch-gcs:8.17.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.

For more information, you can check the following references:

References

edit