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

Add support for adding 'standard' fields to pods

Open JoostvdB94 opened this issue 2 years ago • 7 comments

For our cluster configuration we need a few fields to be present on the Helm chart to use the cluster in an production environment:

  • Annotations on pods (mainly for metric collection and sidecar container injection)
  • PriorityClass support

Looking at other helm template, this seems like a standard/good practice to add as variables. Could you please consider adding these fields?

JoostvdB94 avatar Aug 31 '22 08:08 JoostvdB94

Hi @JoostvdB94. Just to clarify: Do you want to set these fields on the pod of the operator itself or on the pods of the opensearch clusters created by the operator? And if the opensearch pods would you rather set them in the helm chart so the operator applies them to all clusters and pods created or would you rather set them using the OpensearchCluster CRD on a per-cluster basis?

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

Both would be needed in our case. PriorityClass is needed as we want to give operators another priority over the instances that it creates. Labels are needed especially for metric and loggign collection and annotation in our case, so they should be present on the instances especially.

JoostvdB94 avatar Sep 21 '22 08:09 JoostvdB94

@JoostvdB94 thanks for the clarification. I can see where this would be helpful, so I believe this is something we can add. No idea on a timeline though, so if you want to give it a shot yourself, PRs are always welcome.

swoehrl-mw avatar Sep 23 '22 12:09 swoehrl-mw

Allowing to set labels on the opensearch pods and operator would also be nice.

CodeGlitcher avatar Oct 20 '22 14:10 CodeGlitcher

Allowing to set labels on the opensearch pods and operator would also be nice.

At least for the opensearch pods this is already possible. Via spec.nodePools.[].labels you can configure additional labels that are added to the pods.

swoehrl-mw avatar Oct 20 '22 14:10 swoehrl-mw

yes, but this only applies to the nodes. We cannot set the label on opensearch dashboard. The labels are not set on the bootstrap or security config pod. also labels are added in the selector so the are inmutable after the creation of the cluster.

CodeGlitcher avatar Oct 24 '22 11:10 CodeGlitcher

also labels are added in the selector so the are inmutable after the creation of the cluster.

There is a PR (#318) to fix the selector so that labels that can change are only added to the STS object itself and the pods and not the selector.

Everything else, yeah, currently not yet possible.

swoehrl-mw avatar Oct 24 '22 14:10 swoehrl-mw