opensearch-k8s-operator icon indicating copy to clipboard operation
opensearch-k8s-operator copied to clipboard

Should allow overriding of pod settings via a pod template

Open lowell-criteo opened this issue 2 years ago • 5 comments

Sometimes it is necessary/helpful to be able to override container settings.

Example: I want to make a custom certificate file available on the machines. This in theory could be done via a secret with 'volumes', and 'volumeMounts' configs. However, this does not appear possible in the current version of the operator.

I propose adding a configuration option: podTemplate which lets you specify a kubernetes pod template.

Something like this: https://github.com/apache/flink-kubernetes-operator/blob/af086601fd0d209540b90368e9883a87e08af98a/docs/content/docs/custom-resource/pod-template.md

lowell-criteo avatar Aug 25 '22 13:08 lowell-criteo

Hi @lowell-criteo. It is already possible to add extra configmaps and secrets to the cluster pods via the AdditionalVolumes feature. See the documention: https://github.com/Opster/opensearch-k8s-operator/blob/main/docs/userguide/main.md#additional-volumes Is that in line with what you need?

swoehrl-mw avatar Aug 25 '22 13:08 swoehrl-mw

Note that the current AdditionalVolumes implementation does not support the full range of volume types e.g., CSI driver volumes are not supported. (Mainly because the CRD does not have them in the schema, but I am not sure if some extra code is also needed other than passing the config forward to the pod definition)

Those would be very useful to have for people using https://secrets-store-csi-driver.sigs.k8s.io/ or other special volume types.

max-frank avatar Aug 25 '22 23:08 max-frank

Additional volumes should work for my use case, thanks @swoehrl-mw!

I still think custom pod template would be a nice feature to have, (would add a lot of flexibility, and promotes reuse between operator functionality and k8s functionality).

lowell-criteo avatar Aug 26 '22 14:08 lowell-criteo

Yes , this is much needed feature for example , we could use a INIT container under pod template to perform some task , may be install a plugin ?.

KannappanSomu avatar Aug 31 '22 16:08 KannappanSomu

I still think custom pod template would be a nice feature to have, (would add a lot of flexibility, and promotes reuse between operator functionality and k8s functionality).

I'll mark this issue as a future enhancement. If you want to give it a shot yourself, PRs are always welcome.

swoehrl-mw avatar Sep 03 '22 08:09 swoehrl-mw

We added the option to AdditionalConfig and AdditionalVolumes to OpensSearch-Dashboard

idanl21 avatar May 10 '23 13:05 idanl21