Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust behavior for pod labels #521

Merged
merged 2 commits into from
Jan 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions api/v1beta1/zookeepercluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ type ZookeeperClusterSpec struct {
// Image is the container image. default is zookeeper:0.2.10
Image ContainerImage `json:"image,omitempty"`

// Labels specifies the labels to attach to pods the operator creates for
// the zookeeper cluster.
// Labels specifies the labels to attach to all resources the operator
// creates for the zookeeper cluster, including StatefulSet, Pod,
// PersistentVolumeClaim, Service, ConfigMap, et al.
Labels map[string]string `json:"labels,omitempty"`

// Replicas is the expected size of the zookeeper cluster.
Expand Down Expand Up @@ -433,8 +434,8 @@ func (c *ContainerImage) ToString() string {
// PodPolicy defines the common pod configuration for Pods, including when used
// in deployments, stateful-sets, etc.
type PodPolicy struct {
// Labels specifies the labels to attach to pods the operator creates for
// the zookeeper cluster.
// Labels specifies the labels to attach to pods the operator creates for the
// zookeeper cluster. Overrides any values specified in Spec.Labels.
Labels map[string]string `json:"labels,omitempty"`

// NodeSelector specifies a map of key-value pairs. For the pod to be
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2684,8 +2684,9 @@ spec:
labels:
additionalProperties:
type: string
description: Labels specifies the labels to attach to pods the operator
creates for the zookeeper cluster.
description: Labels specifies the labels to attach to all resources
the operator creates for the zookeeper cluster, including StatefulSet,
Pod, PersistentVolumeClaim, Service, ConfigMap, et al.
type: object
maxUnavailableReplicas:
description: MaxUnavailableReplicas defines the MaxUnavailable Replicas
Expand Down Expand Up @@ -3875,7 +3876,8 @@ spec:
additionalProperties:
type: string
description: Labels specifies the labels to attach to pods the
operator creates for the zookeeper cluster.
operator creates for the zookeeper cluster. Overrides any values
specified in Spec.Labels.
type: object
nodeSelector:
additionalProperties:
Expand Down
8 changes: 5 additions & 3 deletions config/crd/bases/zookeeper.pravega.io_zookeeperclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2683,8 +2683,9 @@ spec:
labels:
additionalProperties:
type: string
description: Labels specifies the labels to attach to pods the operator
creates for the zookeeper cluster.
description: Labels specifies the labels to attach to all resources
the operator creates for the zookeeper cluster, including StatefulSet,
Pod, PersistentVolumeClaim, Service, ConfigMap, et al.
type: object
maxUnavailableReplicas:
description: MaxUnavailableReplicas defines the MaxUnavailable Replicas
Expand Down Expand Up @@ -3874,7 +3875,8 @@ spec:
additionalProperties:
type: string
description: Labels specifies the labels to attach to pods the
operator creates for the zookeeper cluster.
operator creates for the zookeeper cluster. Overrides any values
specified in Spec.Labels.
type: object
nodeSelector:
additionalProperties:
Expand Down
1 change: 1 addition & 0 deletions pkg/zk/generators.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ func MakeStatefulSet(z *v1beta1.ZookeeperCluster) *appsv1.StatefulSet {
GenerateName: z.GetName(),
Labels: mergeLabels(
z.Spec.Labels,
z.Spec.Pod.Labels,
map[string]string{
"app": z.GetName(),
"kind": "ZookeeperMember",
Expand Down