Skip to content

Commit 8a9baa3

Browse files
committed
Undo port overrides
1 parent cf08338 commit 8a9baa3

File tree

4 files changed

+13
-37
lines changed

4 files changed

+13
-37
lines changed

api/v1/valkey_types.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -88,22 +88,6 @@ type ValkeySpec struct {
8888

8989
// Node Selector
9090
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
91-
92-
// Valkey container port
93-
// +kubebuilder:default:=6379
94-
ContainerPort int32 `json:"containerPort,omitempty"`
95-
96-
// Valkey container bus port
97-
// +kubebuilder:default:=16379
98-
ContainerBusPort int32 `json:"containerBusPort,omitempty"`
99-
100-
// Valkey container port
101-
// +kubebuilder:default:=0
102-
HostPort int32 `json:"hostPort,omitempty"`
103-
104-
// Valkey container bus port
105-
// +kubebuilder:default:=0
106-
HostBusPort int32 `json:"hostBusPort,omitempty"`
10791
}
10892

10993
// ExternalAccess defines the external access configuration

config/manager/manager.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ metadata:
1919
data:
2020
nodes: "3"
2121
valkeyImage: "ghcr.io/halter/valkey:8.0.2"
22-
exporterImage: "ghcr.io/halter/valkey-sidecar:v0.0.51"
22+
exporterImage: "ghcr.io/halter/valkey-sidecar:v0.0.3"
2323
---
2424
apiVersion: apps/v1
2525
kind: Deployment

internal/controller/scripts/valkey.conf

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ protected-mode yes
136136

137137
# Accept connections on the specified port, default is 6379 (IANA #815344).
138138
# If port 0 is specified Valkey will not listen on a TCP socket.
139-
port {{ .Spec.ContainerPort }}
139+
#port 6379
140140

141141
# TCP listen() backlog.
142142
#
@@ -826,7 +826,7 @@ replica-priority 100
826826
# Valkey implements server assisted support for client side caching of values.
827827
# This is implemented using an invalidation table that remembers, using
828828
# a radix key indexed by key name, what clients have which keys. In turn
829-
# this is used in order to send invalidation messages to clients.
829+
# this is used in order to send invalidation messages to clients.
830830
#
831831
# When tracking is enabled for a client, all the read only queries are assumed
832832
# to be cached: this will force Valkey to store information in the invalidation
@@ -1026,9 +1026,9 @@ acllog-max-len 128
10261026
#
10271027
# aclfile /etc/valkey/users.acl
10281028

1029-
# The option effect will be just setting the password for the default user.
1030-
# Clients will still authenticate using AUTH <password> as usually, or more
1031-
# explicitly with AUTH default <password> if they follow the new protocol:
1029+
# The option effect will be just setting the password for the default user.
1030+
# Clients will still authenticate using AUTH <password> as usually, or more
1031+
# explicitly with AUTH default <password> if they follow the new protocol:
10321032
# both will work.
10331033
#
10341034
# The requirepass is not compatible with aclfile option and the ACL LOAD
@@ -1786,8 +1786,6 @@ cluster-preferred-endpoint-type hostname
17861786
# cluster-announce-tls-port 6379
17871787
# cluster-announce-port 0
17881788
# cluster-announce-bus-port 6380
1789-
cluster-announce-port {{ .Spec.HostPort }}
1790-
cluster-announce-bus-port {{ .Spec.HostBusPort }}
17911789

17921790
################################## SLOW LOG ###################################
17931791

internal/controller/valkey_controller.go

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2125,9 +2125,9 @@ func (r *ValkeyReconciler) upsertStatefulSet(ctx context.Context, valkey *hyperv
21252125
Name: Valkey,
21262126
ImagePullPolicy: "IfNotPresent",
21272127
Command: []string{
2128-
"sh",
2129-
"-c",
2130-
`exec valkey-server /valkey/etc/valkey.conf --protected-mode no --cluster-announce-ip ${HOST_IP}`,
2128+
"valkey-server",
2129+
"/valkey/etc/valkey.conf",
2130+
"--protected-mode", "no",
21312131
},
21322132
Env: []corev1.EnvVar{
21332133
{
@@ -2155,24 +2155,18 @@ func (r *ValkeyReconciler) upsertStatefulSet(ctx context.Context, valkey *hyperv
21552155
Value: tls,
21562156
},
21572157
{
2158-
Name: "HOST_IP",
2159-
ValueFrom: &corev1.EnvVarSource{
2160-
FieldRef: &corev1.ObjectFieldSelector{
2161-
FieldPath: "status.hostIP",
2162-
},
2163-
},
2158+
Name: "VALKEY_PORT_NUMBER",
2159+
Value: "6379",
21642160
},
21652161
},
21662162
Ports: []corev1.ContainerPort{
21672163
{
21682164
Name: "tcp-valkey",
2169-
ContainerPort: valkey.Spec.ContainerPort,
2170-
HostPort: valkey.Spec.HostPort,
2165+
ContainerPort: 6379,
21712166
},
21722167
{
21732168
Name: "tcp-valkey-bus",
2174-
ContainerPort: valkey.Spec.ContainerBusPort,
2175-
HostPort: valkey.Spec.HostBusPort,
2169+
ContainerPort: 16379,
21762170
},
21772171
},
21782172
LivenessProbe: &corev1.Probe{

0 commit comments

Comments
 (0)