Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/go_modules/k8s.io/apimachinery-0.…
Browse files Browse the repository at this point in the history
…32.2
  • Loading branch information
dmolik authored Feb 14, 2025
2 parents 43eaccf + ce7e30e commit 934b4f7
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Dockerfile.valkey
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ RUN apk add --no-cache --virtual .build-deps \
git=2.47.2-r0 \
coreutils=9.5-r2 \
linux-headers=6.6-r1 \
musl-dev=1.2.5-r8 \
musl-dev=1.2.5-r9 \
openssl-dev=3.3.3-r0 \
gcc=14.2.0-r4 \
curl=8.11.1-r1 \
curl=8.12.1-r0 \
make=4.4.1-r2 \
&& curl -L https://github.com/valkey-io/valkey/archive/refs/tags/${VALKEY_VERSION}.tar.gz -o valkey.tar.gz \
&& tar -xzf valkey.tar.gz --strip-components=1 \
Expand Down
8 changes: 8 additions & 0 deletions api/v1/valkey_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ type ValkeySpec struct {

// Tolerations
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

// 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:="ip"
// +kubebuilder:validation:Enum=ip;hostname;unknown-endpoint
ClusterPreferredEndpointType string `json:"clusterPreferredEndpointType,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.

14 changes: 14 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,15 @@ spec:
default: cluster.local
description: Cluster Domain - used for DNS
type: string
clusterPreferredEndpointType:
default: ip
description: Which endpoint is shown as the preferred endpoint valid
values are 'ip', 'hostname', or 'unknown-endpoint'.
enum:
- ip
- hostname
- unknown-endpoint
type: string
exporterImage:
description: Exporter Image to use
type: string
Expand Down Expand Up @@ -211,6 +220,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
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ require (
github.com/spf13/cobra v1.8.1
github.com/valkey-io/valkey-go v1.0.54
go.uber.org/zap v1.27.0
k8s.io/api v0.32.1
k8s.io/api v0.32.2
k8s.io/apimachinery v0.32.2
k8s.io/client-go v0.32.1
k8s.io/client-go v0.32.2
sigs.k8s.io/controller-runtime v0.20.1
)

Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,14 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
k8s.io/api v0.32.1 h1:f562zw9cy+GvXzXf0CKlVQ7yHJVYzLfL6JAS4kOAaOc=
k8s.io/api v0.32.1/go.mod h1:/Yi/BqkuueW1BgpoePYBRdDYfjPF5sgTr5+YqDZra5k=
k8s.io/api v0.32.2 h1:bZrMLEkgizC24G9eViHGOPbW+aRo9duEISRIJKfdJuw=
k8s.io/api v0.32.2/go.mod h1:hKlhk4x1sJyYnHENsrdCWw31FEmCijNGPJO5WzHiJ6Y=
k8s.io/apiextensions-apiserver v0.32.1 h1:hjkALhRUeCariC8DiVmb5jj0VjIc1N0DREP32+6UXZw=
k8s.io/apiextensions-apiserver v0.32.1/go.mod h1:sxWIGuGiYov7Io1fAS2X06NjMIk5CbRHc2StSmbaQto=
k8s.io/apimachinery v0.32.2 h1:yoQBR9ZGkA6Rgmhbp/yuT9/g+4lxtsGYwW6dR6BDPLQ=
k8s.io/apimachinery v0.32.2/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE=
k8s.io/client-go v0.32.1 h1:otM0AxdhdBIaQh7l1Q0jQpmo7WOFIk5FFa4bg6YMdUU=
k8s.io/client-go v0.32.1/go.mod h1:aTTKZY7MdxUaJ/KiUs8D+GssR9zJZi77ZqtzcGXIiDg=
k8s.io/client-go v0.32.2 h1:4dYCD4Nz+9RApM2b/3BtVvBHw54QjMFUl1OLcJG5yOA=
k8s.io/client-go v0.32.2/go.mod h1:fpZ4oJXclZ3r2nDOv+Ux3XcJutfrwjKTCHz2H3sww94=
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/kube-openapi v0.0.0-20241212222426-2c72e554b1e7 h1:hcha5B1kVACrLujCKLbr8XWMxCxzQx42DY8QKYJrDLg=
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
3 changes: 2 additions & 1 deletion internal/controller/valkey_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -2102,7 +2102,8 @@ func (r *ValkeyReconciler) upsertStatefulSet(ctx context.Context, valkey *hyperv
},
},
},
Tolerations: valkey.Spec.Tolerations,
Tolerations: valkey.Spec.Tolerations,
NodeSelector: valkey.Spec.NodeSelector,
Containers: []corev1.Container{
{
Image: image,
Expand Down

0 comments on commit 934b4f7

Please sign in to comment.