- Deploying elasticsearch as docker in kubernetes
- Trying to add keystore secure password as part of kubernetes init container while deploying the a statefulset but the password is not getting added.
initContainers:
- name: setup
image: $REGISTRY_ADDRESS/elasticsearch:$DOCKER_TAG
env:
- name: XPACK_SECURITY_TRANSPORT_SSL_KEYSTORE_SECURE_PASSWORD
valueFrom:
secretKeyRef:
name: $K8S_SERVICE_SECRETS
key: xpack.security.transport.ssl.keystore.secure_password
command:
- sh
- -c
- |
echo $XPACK_SECURITY_TRANSPORT_SSL_KEYSTORE_SECURE_PASSWORD | /usr/share/elasticsearch/bin/elasticsearch-keystore add --stdin --force xpack.security.transport.ssl.keystore.secure_password
resources:
requests:
cpu: $POD_RESOURCE_REQUESTS_CPU
memory: $POD_RESOURCE_REQUESTS_MEM
limits:
cpu: $POD_RESOURCE_LIMITS_CPU
memory: $POD_RESOURCE_LIMITS_MEM
securityContext:
privileged: true
- Tried adding as docker args but it fails for below reason.
docker run es-local echo abc | /usr/local/share/elasticsearch/bin/elasticsearch-keystore add abc
-bash: /usr/local/share/elasticsearch/bin/elasticsearch-keystore: No such file or directory
write /dev/stdout: broken pipe
Hello,
I have some experience with Docker and the Elasticsearch keystore utilities, but unfortunately I have less experience with Kubernetes. I see you've posted a fragment of your configuration file. Do you think you could create a version of the configuration where I could run kubectl -f sample-conf.yaml and see the problem for myself?
-William