Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run as non-root Elasticsearch is outdated and not relevant when running on OpenShift #5913

Closed
barkbay opened this issue Aug 2, 2022 · 2 comments · Fixed by #7339
Closed
Assignees
Labels
>docs Documentation v2.11.0

Comments

@barkbay
Copy link
Contributor

barkbay commented Aug 2, 2022

Run as non-root Elasticsearch is outdated:

By default, the Elastisearch container is run as root and its entrypoint is responsible to run the Elasticsearch process with the elasticsearch user (defined with ID 1000). In the background, ECK uses an initContainer to make sure that the data volume is writable for the elasticsearch user.

This is not true since 8.0.0, Elastisearch container is run as user id 1000 by default:

docker run --rm docker.elastic.co/elasticsearch/elasticsearch:7.17.5 id
uid=0(root) gid=0(root) groups=0(root)
docker run --rm docker.elastic.co/elasticsearch/elasticsearch:8.3.3 id
uid=1000(elasticsearch) gid=0(root) groups=0(root)

We should also:

@barkbay barkbay added the >docs Documentation label Aug 2, 2022
@gbschenkel
Copy link

gbschenkel commented Apr 5, 2023

Also when upgrading from 7.x to 8.x the container still use 0, I was needed to run a initContainer to chown the directory to user and group elasticsearch:elasticsearch which is 1000, but I didn't know when this stuck on my Openshift cluster.

This initContainer could be run as preStart of Elasticsearch nodes/pods, this could be like mentioned on #6239 but aimed for correct Elasticsearch pods permissions on upgrading from 7.x.

I still have a elk cluster on 7.17.9 and using eck operator 1.9.0 because that problem which the operator itself not upgrade to newer version.

@barkbay
Copy link
Contributor Author

barkbay commented Apr 27, 2023

We should also document the new default SecurityContext for Elasticsearch containers introduced with #6703

@barkbay barkbay added the v2.8.0 label Apr 27, 2023
@barkbay barkbay added v2.9.0 and removed v2.8.0 labels May 24, 2023
@barkbay barkbay added v2.11.0 and removed v2.9.0 labels Nov 24, 2023
@pebrc pebrc self-assigned this Nov 27, 2023
pebrc added a commit to pebrc/cloud-on-k8s that referenced this issue Nov 27, 2023
Update to reflect changed implementation. Fixes elastic#5913

(cherry picked from commit 8d2e3c9)
pebrc added a commit to pebrc/cloud-on-k8s that referenced this issue Nov 27, 2023
Update to reflect changed implementation. Fixes elastic#5913

(cherry picked from commit 8d2e3c9)
pebrc added a commit to pebrc/cloud-on-k8s that referenced this issue Nov 27, 2023
Update to reflect changed implementation. Fixes elastic#5913

(cherry picked from commit 8d2e3c9)
barkbay pushed a commit to barkbay/cloud-on-k8s that referenced this issue Nov 29, 2023
Update to reflect changed implementation. Fixes elastic#5913
thbkrkr pushed a commit to thbkrkr/cloud-on-k8s that referenced this issue Dec 8, 2023
Update to reflect changed implementation. Fixes elastic#5913

(cherry picked from commit 8d2e3c9)
robbavey pushed a commit to robbavey/cloud-on-k8s that referenced this issue Dec 20, 2023
Update to reflect changed implementation. Fixes elastic#5913
pebrc added a commit to pebrc/cloud-on-k8s that referenced this issue Sep 27, 2024
Update to reflect changed implementation. Fixes elastic#5913

(cherry picked from commit 8d2e3c9)
pebrc added a commit to pebrc/cloud-on-k8s that referenced this issue Sep 27, 2024
Update to reflect changed implementation. Fixes elastic#5913

(cherry picked from commit 8d2e3c9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>docs Documentation v2.11.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants