@@ -25,6 +25,7 @@ import (
25
25
corev1 "k8s.io/api/core/v1"
26
26
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
27
27
"k8s.io/apimachinery/pkg/runtime"
28
+ "k8s.io/apimachinery/pkg/util/intstr"
28
29
"k8s.io/utils/ptr"
29
30
"sigs.k8s.io/controller-runtime/pkg/client"
30
31
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
@@ -89,6 +90,7 @@ func (d *deployment) SetMasterDeploymentAsDesired(nfdInstance *nfdv1.NodeFeature
89
90
SecurityContext : getMasterSecurityContext (),
90
91
LivenessProbe : getLivenessProbe (),
91
92
ReadinessProbe : getReadinessProbe (),
93
+ Ports : getPorts (),
92
94
},
93
95
},
94
96
},
@@ -123,6 +125,9 @@ func (d *deployment) SetGCDeploymentAsDesired(nfdInstance *nfdv1.NodeFeatureDisc
123
125
},
124
126
Env : getEnvs (),
125
127
SecurityContext : getGCSecurityContext (),
128
+ LivenessProbe : getLivenessProbe (),
129
+ ReadinessProbe : getReadinessProbe (),
130
+ Ports : getPorts (),
126
131
},
127
132
},
128
133
},
@@ -279,8 +284,12 @@ func getLivenessProbe() *corev1.Probe {
279
284
return & corev1.Probe {
280
285
InitialDelaySeconds : 10 ,
281
286
ProbeHandler : corev1.ProbeHandler {
282
- GRPC : & corev1.GRPCAction {
283
- Port : 8082 ,
287
+ HTTPGet : & corev1.HTTPGetAction {
288
+ Path : "/healthz" ,
289
+ Port : intstr.IntOrString {
290
+ Type : intstr .String ,
291
+ StrVal : "http" ,
292
+ },
284
293
},
285
294
},
286
295
}
@@ -291,9 +300,22 @@ func getReadinessProbe() *corev1.Probe {
291
300
InitialDelaySeconds : 5 ,
292
301
FailureThreshold : 10 ,
293
302
ProbeHandler : corev1.ProbeHandler {
294
- GRPC : & corev1.GRPCAction {
295
- Port : 8082 ,
303
+ HTTPGet : & corev1.HTTPGetAction {
304
+ Path : "/healthz" ,
305
+ Port : intstr.IntOrString {
306
+ Type : intstr .String ,
307
+ StrVal : "http" ,
308
+ },
296
309
},
297
310
},
298
311
}
299
312
}
313
+
314
+ func getPorts () []corev1.ContainerPort {
315
+ return []corev1.ContainerPort {
316
+ {
317
+ ContainerPort : 8080 ,
318
+ Name : "http" ,
319
+ },
320
+ }
321
+ }
0 commit comments