pravega / zookeeper-operator

Kubernetes Operator for Zookeeper
Apache License 2.0
368 stars 206 forks source link

Pod Labels not applied to StatefulSet #511

Closed endzyme closed 1 year ago

endzyme commented 2 years ago

Description

The zookeepercluster.spec.pod.labels are not applied to the final pods or the StatefulSet created by the Zookeeper Operator.

Importance

should-have: If it's in the spec, it should work as intended or be removed. blocker: Since the Solr Operator uses this Zookeeper Operator, it is currently blocking us from adding custom labels to Zookeeper Clusters created with the Solr Operator.

Location

Unsure, would need some help to track it down, but is likely related to https://github.com/pravega/zookeeper-operator/issues/257.

Suggestions for an improvement

Taking into account the features or https://github.com/pravega/zookeeper-operator/issues/257, this should have a merge between the two maps and apply the final merge to the template spec of the StatefulSet.

endzyme commented 1 year ago

@anishakj if you point me in the right direction, I can make a PR.

I am thinking there are two approaches.

  1. Remove the spec.pod.labels from the CRD
  2. Make the behavior the same as spec.labels and document which spec keys override one another
  3. Change the behavior so spec.labels only applies labels to statefulset and let spec.pod.labels be the place for pod label customization

Any thoughts or alternatives?

endzyme commented 1 year ago

@anishakj if you point me in the right direction, I can make a PR.

I am thinking there are two approaches.

  1. Remove the spec.pod.labels from the CRD
  2. Make the behavior the same as spec.labels and document which spec keys override one another
  3. Change the behavior so spec.labels only applies labels to statefulset and let spec.pod.labels be the place for pod label customization

Any thoughts or alternatives?

I ended up taking approach 2.