From e9a22a23e70504e53d978041a716ddb710e8a0b2 Mon Sep 17 00:00:00 2001 From: Bezalel Brandwine Date: Wed, 9 Feb 2022 09:35:39 +0200 Subject: [PATCH] [housekeeper] add readiness checks --- hostsensorutils/hostsensor.yaml | 6 ++++++ hostsensorutils/hostsensordeploy.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/hostsensorutils/hostsensor.yaml b/hostsensorutils/hostsensor.yaml index 305bd09b..3261b83f 100644 --- a/hostsensorutils/hostsensor.yaml +++ b/hostsensorutils/hostsensor.yaml @@ -50,6 +50,12 @@ spec: volumeMounts: - mountPath: /host_fs name: host-filesystem + readinessProbe: + httpGet: + path: /kernelVersion + port: 7888 + initialDelaySeconds: 1 + periodSeconds: 1 terminationGracePeriodSeconds: 120 dnsPolicy: ClusterFirstWithHostNet automountServiceAccountToken: false diff --git a/hostsensorutils/hostsensordeploy.go b/hostsensorutils/hostsensordeploy.go index ac32fe72..1d029f1a 100644 --- a/hostsensorutils/hostsensordeploy.go +++ b/hostsensorutils/hostsensordeploy.go @@ -179,7 +179,7 @@ func (hsh *HostSensorHandler) updatePodInListAtomic(eventType watch.EventType, p switch eventType { case watch.Added, watch.Modified: - if podObj.Status.Phase == corev1.PodRunning { + if podObj.Status.Phase == corev1.PodRunning && podObj.Status.ContainerStatuses[0].Ready { hsh.HostSensorPodNames[podObj.ObjectMeta.Name] = podObj.Spec.NodeName } else { delete(hsh.HostSensorPodNames, podObj.ObjectMeta.Name)