Skip to content

Commit fd2f8ad

Browse files
committed
fix: remove liveness probe from daemonset
This commit removes the liveness probe from the daemonset which fixes the issue of forces Kepler to collect data causing unnecessary overhead and disrupt Kepler's normal collection cycle. Signed-off-by: vprashar2929 <[email protected]>
1 parent 8a57e1e commit fd2f8ad

File tree

2 files changed

+15
-42
lines changed

2 files changed

+15
-42
lines changed

pkg/components/power-monitor/deployment.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -655,21 +655,6 @@ func newPowerMonitorContainer(pmi *v1alpha1.PowerMonitorInternal) corev1.Contain
655655
ContainerPort: int32(PowerMonitorDSPort),
656656
Name: PowerMonitorServicePortName,
657657
}},
658-
LivenessProbe: &corev1.Probe{
659-
ProbeHandler: corev1.ProbeHandler{
660-
Exec: &corev1.ExecAction{
661-
Command: []string{
662-
"curl", "-f", "-s",
663-
fmt.Sprintf("http://%s/metrics", webListenAddress),
664-
},
665-
},
666-
},
667-
FailureThreshold: 5,
668-
InitialDelaySeconds: 10,
669-
PeriodSeconds: 60,
670-
SuccessThreshold: 1,
671-
TimeoutSeconds: 10,
672-
},
673658
VolumeMounts: []corev1.VolumeMount{
674659
{Name: "sysfs", MountPath: SysFSMountPath, ReadOnly: true},
675660
{Name: "procfs", MountPath: ProcFSMountPath, ReadOnly: true},

pkg/components/power-monitor/deployment_test.go

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -109,17 +109,16 @@ func TestPowerMonitorTolerations(t *testing.T) {
109109

110110
func TestPowerMonitorDaemonSet(t *testing.T) {
111111
tt := []struct {
112-
spec v1alpha1.PowerMonitorInternalKeplerSpec
113-
hostPID bool
114-
exporterCommand []string
115-
volumeMounts []corev1.VolumeMount
116-
volumes []corev1.Volume
117-
containers []string
118-
scenario string
119-
addConfigMap bool
120-
configMap *corev1.ConfigMap
121-
annotation map[string]string
122-
expectedLivenessProbeURL string
112+
spec v1alpha1.PowerMonitorInternalKeplerSpec
113+
hostPID bool
114+
exporterCommand []string
115+
volumeMounts []corev1.VolumeMount
116+
volumes []corev1.Volume
117+
containers []string
118+
scenario string
119+
addConfigMap bool
120+
configMap *corev1.ConfigMap
121+
annotation map[string]string
123122
}{
124123
{
125124
spec: v1alpha1.PowerMonitorInternalKeplerSpec{},
@@ -141,9 +140,8 @@ func TestPowerMonitorDaemonSet(t *testing.T) {
141140
k8s.VolumeFromHost("procfs", "/proc"),
142141
k8s.VolumeFromConfigMap("cfm", "power-monitor-internal"),
143142
},
144-
containers: []string{"power-monitor-internal"},
145-
scenario: "default case",
146-
expectedLivenessProbeURL: fmt.Sprintf("http://0.0.0.0:%d/metrics", PowerMonitorDSPort),
143+
containers: []string{"power-monitor-internal"},
144+
scenario: "default case",
147145
},
148146
{
149147
spec: v1alpha1.PowerMonitorInternalKeplerSpec{},
@@ -178,8 +176,7 @@ func TestPowerMonitorDaemonSet(t *testing.T) {
178176
annotation: map[string]string{
179177
ConfigMapHashAnnotation + "-power-monitor-internal": "123",
180178
},
181-
scenario: "configmap case",
182-
expectedLivenessProbeURL: fmt.Sprintf("http://0.0.0.0:%d/metrics", PowerMonitorDSPort),
179+
scenario: "configmap case",
183180
},
184181
{
185182
spec: v1alpha1.PowerMonitorInternalKeplerSpec{
@@ -211,9 +208,8 @@ func TestPowerMonitorDaemonSet(t *testing.T) {
211208
k8s.VolumeFromSecret(SecretTLSCertName, SecretTLSCertName),
212209
k8s.VolumeFromSecret(SecretKubeRBACProxyConfigName, SecretKubeRBACProxyConfigName),
213210
},
214-
containers: []string{"power-monitor-internal", KubeRBACProxyContainerName},
215-
scenario: "rbac case",
216-
expectedLivenessProbeURL: fmt.Sprintf("http://127.0.0.1:%d/metrics", PowerMonitorDSPort),
211+
containers: []string{"power-monitor-internal", KubeRBACProxyContainerName},
212+
scenario: "rbac case",
217213
},
218214
}
219215
for _, tc := range tt {
@@ -252,14 +248,6 @@ func TestPowerMonitorDaemonSet(t *testing.T) {
252248
actualAnnotation := k8s.AnnotationFromDS(ds)
253249
assert.Contains(t, actualAnnotation, ConfigMapHashAnnotation+"-power-monitor-internal")
254250
}
255-
256-
// Validate liveness probe configuration
257-
container := ds.Spec.Template.Spec.Containers[0]
258-
assert.NotNil(t, container.LivenessProbe, "liveness probe should be configured")
259-
260-
expectedCommand := []string{"curl", "-f", "-s", tc.expectedLivenessProbeURL}
261-
assert.Equal(t, expectedCommand, container.LivenessProbe.Exec.Command,
262-
"liveness probe exec command should use curl with correct URL")
263251
})
264252
}
265253
}

0 commit comments

Comments
 (0)