Skip to content

Commit ded2b99

Browse files
committed
Add cluster-announce-ip
1 parent 808a17c commit ded2b99

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

internal/controller/valkey_controller.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2253,9 +2253,9 @@ func (r *ValkeyReconciler) upsertStatefulSet(ctx context.Context, valkey *hyperv
22532253
Name: Valkey,
22542254
ImagePullPolicy: "IfNotPresent",
22552255
Command: []string{
2256-
"valkey-server",
2257-
"/valkey/etc/valkey.conf",
2258-
"--protected-mode", "no",
2256+
"sh",
2257+
"-c",
2258+
"exec valkey-server /valkey/etc/valkey.conf --protected-mode no --cluster-announce-ip $POD_IP",
22592259
},
22602260
Env: []corev1.EnvVar{
22612261
{
@@ -2286,6 +2286,14 @@ func (r *ValkeyReconciler) upsertStatefulSet(ctx context.Context, valkey *hyperv
22862286
Name: "VALKEY_PORT_NUMBER",
22872287
Value: "6379",
22882288
},
2289+
{
2290+
Name: "POD_IP",
2291+
ValueFrom: &corev1.EnvVarSource{
2292+
FieldRef: &corev1.ObjectFieldSelector{
2293+
FieldPath: "status.podIP",
2294+
},
2295+
},
2296+
},
22892297
},
22902298
Ports: []corev1.ContainerPort{
22912299
{

0 commit comments

Comments
 (0)