We got EKS and worker nodes running of course on AWS. We are using gcr.io/google_containers/elasticsearch:v6.3.0. However now we want to add curator to take snapshots of ES indexes and store them in S3 bucket. For this ES needs a repository-s3 plugin.
So we decided to extend this image and create our own with the plugin installed. Dockerfile is:
FROM gcr.io/google_containers/elasticsearch:v6.3.0
RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch repository-s3
This returns:
Step 2/2 : RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch repository-s3
---> Running in 8d96a792a7e3
Exception in thread "main" java.lang.IllegalArgumentException: Could not resolve placeholder 'MINIMUM_MASTER_NODES'
at org.elasticsearch.common.settings.PropertyPlaceholder.parseStringValue(PropertyPlaceholder.java:116)
at org.elasticsearch.common.settings.PropertyPlaceholder.replacePlaceholders(PropertyPlaceholder.java:69)
at org.elasticsearch.common.settings.Settings$Builder.replacePropertyPlaceholders(Settings.java:1263)
at org.elasticsearch.common.settings.Settings$Builder.replacePropertyPlaceholders(Settings.java:1213)
at org.elasticsearch.node.InternalSettingsPreparer.initializeSettings(InternalSettingsPreparer.java:128)
at org.elasticsearch.node.InternalSettingsPreparer.prepareEnvironment(InternalSettingsPreparer.java:107)
at org.elasticsearch.cli.EnvironmentAwareCommand.createEnv(EnvironmentAwareCommand.java:95)
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124)
at org.elasticsearch.cli.MultiCommand.execute(MultiCommand.java:79)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124)
at org.elasticsearch.cli.Command.main(Command.java:90)
at org.elasticsearch.plugins.PluginCli.main(PluginCli.java:48)
The command '/bin/sh -c /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch repository-s3' returned a non-zero code: 1
The same thing happens when I try to install the plugin on the running es instances.
And I can sudo to elasticsearch user and run the command again and it still gives ends up with the same issue:
It appears environment is missing the following variables as when I add them in Dockerfile with ARG it appears to complete the image (certainly those values are hardcoded but just to prove the point):
MINIMUM_MASTER_NODES
HTTP_PORT
NODE_DATA
NODE_MASTER
NODE_NAME
TRANSPORT_PORT
Not sure what am I missing in this whole story.