Create custom images
You can create your own custom application images (Elasticsearch, Kibana, APM Server, Beats, Elastic Agent, Elastic Maps Server, Logstash, AutoOps Agent Policy and Package Registry) 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 9.5.5 image with the ICU Analysis Plugin, you can do the following:
Create a
Dockerfilecontaining:FROM docker.elastic.co/elasticsearch/elasticsearch:9.5.5 RUN bin/elasticsearch-plugin install --batch analysis-icuBuild the image with:
docker build --tag elasticsearch-icu:9.5.5 .
There are various hosting options for your images. If you use Google Kubernetes Engine, you can store your custom images in Artifact Registry. Before you push an image, create a Docker repository and configure authentication. Make sure that your cluster has permission to pull images from the repository.
docker tag elasticsearch-icu:9.5.5 ${LOCATION}-docker.pkg.dev/${PROJECT_ID}/${REPOSITORY}/elasticsearch-icu:9.5.5
docker push ${LOCATION}-docker.pkg.dev/${PROJECT_ID}/${REPOSITORY}/elasticsearch-icu:9.5.5
Configure your Elasticsearch specification to use the newly pushed image, for example:
spec:
version: 9.5.5
image: ${LOCATION}-docker.pkg.dev/${PROJECT_ID}/${REPOSITORY}/elasticsearch-icu:9.5.5
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: