apache / solr-operator

Official Kubernetes operator for Apache Solr
https://solr.apache.org/operator
Apache License 2.0
243 stars 112 forks source link

Support readOnlyRootFilesystem #648

Closed radu-gheorghe closed 7 months ago

radu-gheorghe commented 8 months ago

This should be the first part (or at least an initial attempt at it) for #624

It adds /tmp as emptyDir to the zk-init init container. It also sets readOnlyRootFilesystem to it. For testing and also why not 🙂 I've tested it with Solr 9.3 and a chroot and I see the chroot and I see readOnlyRootFilesystem in its container definition.

Any feedback is welcome. Once we agree about this, I'd like to check if Solr itself can run as readOnlyRootFilesystem and if not, add support for that, check for issues and iron them out.

radu-gheorghe commented 7 months ago

I just pushed a commit that should fix the breaking tests.

I've also experimented with the Solr container using readOnlyRootFilesystem by doing kubectl edit on the StatefulSet. Solr seems to work just fine (I created a collection, added some docs...). Nothing seems to break, at least at first. Maybe this fixes your problem in #624 @thomaswoeckinger ?

thomaswoeckinger commented 7 months ago

I think so, i will test it on my side and give you feedback then.

radu-gheorghe commented 7 months ago

Sounds good, thanks @thomaswoeckinger !

thomaswoeckinger commented 7 months ago

From my point of view, at least some common request for collection creation, modification, deletion and sharding is working, so i think this is good to go

HoustonPutman commented 7 months ago

Let's keep it just the zk-init container for now (or all the init containers we do). That way we don't break use cases we don't know about. Not sure there's a giant benefit for us to set it by default right now.

radu-gheorghe commented 7 months ago

Sounds good to me! Does this mean that this PR is good to merge, or should I change something?

HoustonPutman commented 7 months ago

I added a changelog entry. Once the tests pass, I'll merge. Thanks for the great work!

radu-gheorghe commented 7 months ago

Awesome! Thanks for checking and merging!