solr-operator icon indicating copy to clipboard operation
solr-operator copied to clipboard

Full Solr Cloud Initialization (ConfigSet, Collections, Alias, ...)

Open guillaumBrisard opened this issue 2 years ago • 3 comments

I would like everything to be set and ready to use for my client without any additionnal configuration through my pipeline.

Right now I use API for

  1. uploading configset
  2. creating collections
  3. creating aliases
  4. ...

It's superset of these enhancements https://github.com/apache/solr-operator/issues/85 https://github.com/apache/solr-operator/issues/59 or this SIP https://cwiki.apache.org/confluence/display/SOLR/SIP-18%3A+A+Solr+Kubernetes+Module+for+native+integration

It seems that we can't use lifecycle.podstrart because the cluster is not ready yet https://kubernetes.io/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/#discussion Kubernetes sends the postStart event immediately after the Container is created. There is no guarantee, however, that the postStart handler is called before the Container's entrypoint is called. Is someone knows if the probes readiness / liveness start after lifecycle.podstrart or before ?

In waiting this, what is the best practices to do it, right now with 9.2 ?

guillaumBrisard avatar Jul 07 '23 09:07 guillaumBrisard

what kind of pipeline do you use? Because I would recommend writing something to wait for Solr to be healthy and alive, then write "code" in your pipeline to make sure everything is uploaded/created.

HoustonPutman avatar Jul 11 '23 20:07 HoustonPutman

Sorry, I missed your answer. We already use the pipeline (Concourse) for initialization. With this, we are pipeline dependent.

This enhancement will give one way for initialization and it will be faster, safer, simpler.

guillaumBrisard avatar Nov 10 '23 08:11 guillaumBrisard

So the only real way to deal with this, if you can only use lifecycle.podstart, is to add a wait in there. The solr operator will set up the pods such that the readinessProbe or even the startupProbe will let you know when the pod is ready to affect API calls. But if you can only use the lifecycle hooks, there isn't much that can be done.

Also the lifecycle hooks will be done for every pod, and everytime they are restarted, so initializing your environment with them is risky to say the least.

HoustonPutman avatar Nov 28 '23 16:11 HoustonPutman