Skip to content

Commit 42393f8

Browse files
committed
feat(controller): Support nodeSelector
Add nodeSelector key to API spec to control NodeSelector set on statefulset.
1 parent 6666d02 commit 42393f8

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

Diff for: api/v1/valkey_types.go

+3
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ type ValkeySpec struct {
8585

8686
// Tolerations
8787
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
88+
89+
// Node Selector
90+
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
8891
}
8992

9093
// ExternalAccess defines the external access configuration

Diff for: api/v1/zz_generated.deepcopy.go

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: config/crd/bases/hyperspike.io_valkeys.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,11 @@ spec:
211211
image:
212212
description: Image to use
213213
type: string
214+
nodeSelector:
215+
additionalProperties:
216+
type: string
217+
description: Node Selector
218+
type: object
214219
nodes:
215220
default: 3
216221
description: Number of shards

Diff for: internal/controller/valkey_controller.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -2102,7 +2102,8 @@ func (r *ValkeyReconciler) upsertStatefulSet(ctx context.Context, valkey *hyperv
21022102
},
21032103
},
21042104
},
2105-
Tolerations: valkey.Spec.Tolerations,
2105+
Tolerations: valkey.Spec.Tolerations,
2106+
NodeSelector: valkey.Spec.NodeSelector,
21062107
Containers: []corev1.Container{
21072108
{
21082109
Image: image,

0 commit comments

Comments
 (0)