Unable to apply memory lock to deploy elastic 8 on k8s

I am running into issues with deploying elastic version 8.7 on kubernetes (k8s)

I am using this docker image for elastic version 8.7

I have enabled bootstrap memory_lock as "true" but I see these error logs in my elastic master statefulset

[1] bootstrap checks failed. You must address the points described in the following [1] lines before starting Elasticsearch.
bootstrap check failure [1] of [1]: memory locking requested for elasticsearch process but memory is not locked

In the first part of the pod log I see

[WARN ][o.e.b.JNANatives         ] [elasticsearch-master-2]These can be adjusted by modifying /etc/security/limits.conf, for example:
	# allow user 'elasticsearch' mlockall
	elasticsearch soft memlock unlimited
	elasticsearch hard memlock unlimited

I am trying to set the ulimit for memory lock via an init container (before elasticsearch master container starts up)

   initContainers:
      - command:
        - sh
        - -c
        - ulimit -l unlimited

But still elasticsearch master is running into this on kubernetes (k8s) issue - it cannot recognize the memory lock

Has anyone encountered this problem and resolved it?

Can anyone assist on this?

Welcome to our community! :smiley:

Are you using ECK?

thanks Mark!

I am not using the operator - I am using the elastic helm chart but I cannot figure out how to set the proper ulimits to allow memory locking

Tried init containers and other solutions

Is there to enable memory lock for kubernetes elastic pods running as non-root?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.