Open IshaGirdhar opened 1 year ago
hey @IshaGirdhar I didnt really understood the use case for those hooks, can you please add one more example ?
@idanl21 A few of the use cases are
OpenSearch official Helm Chart supports this as well https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/values.yaml#L409
I think similar request was also made here https://github.com/Opster/opensearch-k8s-operator/issues/435
At present, if you need to configure or execute a command in an OpenSearch or OpenSearch dashboard container that's up, you can only do so by accessing the container and running the command manually. To simplify this process, we could introduce lifecycle hooks, which are a core Kubernetes feature(https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/) as part of the OpenSearch Cluster CR. These hooks will allow users to specify commands that should be executed after the container starts or before it shuts down gracefully. For example:
With these hooks, users can add the necessary commands to the container's configuration and Kubernetes will execute them automatically at the specified lifecycle events. One of the use cases for this is adding a new index template, so that when OS cluster is ready to ingest, it has the right set of index templates available.