Skip to content

Commit

Permalink
feat(controller): Support nodeSelector
Browse files Browse the repository at this point in the history
Add nodeSelector key to API spec to control NodeSelector set on statefulset.
  • Loading branch information
kurtmc committed Feb 13, 2025
1 parent 5d5e4ca commit 5f01063
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/v1/valkey_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ type ValkeySpec struct {

// Service Password
ServicePassword *corev1.SecretKeySelector `json:"servicePassword,omitempty"`

// Node Selector
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
}

// ExternalAccess defines the external access configuration
Expand Down
7 changes: 7 additions & 0 deletions api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions config/crd/bases/hyperspike.io_valkeys.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,11 @@ spec:
image:
description: Image to use
type: string
nodeSelector:
additionalProperties:
type: string
description: Node Selector
type: object
nodes:
default: 3
description: Number of shards
Expand Down
1 change: 1 addition & 0 deletions internal/controller/valkey_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -2102,6 +2102,7 @@ func (r *ValkeyReconciler) upsertStatefulSet(ctx context.Context, valkey *hyperv
},
},
},
NodeSelector: valkey.Spec.NodeSelector,
Containers: []corev1.Container{
{
Image: image,
Expand Down

0 comments on commit 5f01063

Please sign in to comment.