Skip to content

Commit

Permalink
feat(controller): Support cluster-preferred-endpoint-type valkey appl…
Browse files Browse the repository at this point in the history
…ication configuration option
  • Loading branch information
kurtmc committed Feb 14, 2025
1 parent 47bb2ed commit befc5f8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions api/v1/valkey_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ type ValkeySpec struct {

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

// Which endpoint is shown as the preferred endpoint valid values are 'ip', 'hostname', or 'unknown-endpoint'.
// +kubebuilder:default:="hostname"
ClusterPreferredEndpointType string `json:"clusterPreferredEndpointType,omitempty"`
}

// ExternalAccess defines the external access configuration
Expand Down
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 @@ -80,6 +80,11 @@ spec:
default: cluster.local
description: Cluster Domain - used for DNS
type: string
clusterPreferredEndpointType:
default: hostname
description: Which endpoint is shown as the preferred endpoint valid
values are 'ip', 'hostname', or 'unknown-endpoint'.
type: string
exporterImage:
description: Exporter Image to use
type: string
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/scripts/valkey.conf
Original file line number Diff line number Diff line change
Expand Up @@ -1746,7 +1746,7 @@ cluster-config-file /data/nodes.conf
# the client to reach out on the same endpoint it used for making the last request, but use
# the port provided in the response.

cluster-preferred-endpoint-type hostname
cluster-preferred-endpoint-type {{ .Spec.ClusterPreferredEndpointType }}

########################## CLUSTER DOCKER/NAT support ########################

Expand Down

0 comments on commit befc5f8

Please sign in to comment.