Skip to content

Commit ae15bc7

Browse files
committed
headless PublishNotReadyAddresses
Signed-off-by: Jordan Rodgers <jrodgers@mux.com>
1 parent e5425a5 commit ae15bc7

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

k8sutils/services.go

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ func generateServiceDef(serviceMeta metav1.ObjectMeta, epp exporterPortProvider,
5555
}
5656
if headless {
5757
service.Spec.ClusterIP = "None"
58+
service.Spec.PublishNotReadyAddresses = true
5859
}
5960
if exporterPort, ok := epp(); ok {
6061
redisExporterService := enableMetricsPort(exporterPort)

k8sutils/services_test.go

+8-6
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,10 @@ func TestGenerateServiceDef(t *testing.T) {
102102
Protocol: corev1.ProtocolTCP,
103103
},
104104
},
105-
Selector: map[string]string{"role": "sentinel"},
106-
ClusterIP: "None",
107-
Type: corev1.ServiceTypeClusterIP,
105+
Selector: map[string]string{"role": "sentinel"},
106+
ClusterIP: "None",
107+
Type: corev1.ServiceTypeClusterIP,
108+
PublishNotReadyAddresses: true,
108109
},
109110
},
110111
},
@@ -184,9 +185,10 @@ func TestGenerateServiceDef(t *testing.T) {
184185
Protocol: corev1.ProtocolTCP,
185186
},
186187
},
187-
Selector: map[string]string{"role": "redis"},
188-
ClusterIP: "None",
189-
Type: corev1.ServiceTypeClusterIP,
188+
Selector: map[string]string{"role": "redis"},
189+
ClusterIP: "None",
190+
Type: corev1.ServiceTypeClusterIP,
191+
PublishNotReadyAddresses: true,
190192
},
191193
},
192194
},

0 commit comments

Comments
 (0)