-
Problem report
-
Resolution: Fixed
-
Critical
-
6.0.10, 6.2.4
-
Sprint 100 (May 2023)
-
3
"Example: pod did not report a ip address under “pod.status” and thefore the if statement in the “collector item” : “Kubernetes: Get nodes” (key:kube.nodes) would skip it quietly without raising exception or error."
Starting line ~186 /6.2.3:
// --> Added a clause for undefined IP (Pod not started because of error)
if (pod.status.hostIP === internalIP || typeof(pod.status.hostIP)==="undefined") {
pod.spec.containers.forEach(function (container) {
var limits = container.resources.limits,
requests = container.resources.requests;
nodePodsCount++;
if (typeof limits !== 'undefined') {
containers.limits.cpu += Fmt.cpuFormat(limits.cpu);
containers.limits.memory += Fmt.memoryFormat(limits.memory);
}
if (typeof requests !== 'undefined') {
containers.requests.cpu += Fmt.cpuFormat(requests.cpu);
containers.requests.memory += Fmt.memoryFormat(requests.memory);
}
});
// --> No container status due to pod not running
if(typeof(pod.status.containerStatuses)!=="undefined"){
pod.status.containerStatuses.forEach(function (container) {
containers.restartCount += container.restartCount;
});
}
nodePods.push({
name: pod.metadata.name,
namespace: pod.metadata.namespace,
labels: pod.metadata.labels,
annotations: pod.metadata.annotations,
phase: pod.status.phase,
conditions: pod.status.conditions,
startTime: pod.status.startTime,
containers: containers
})
}
"With this change the faulty pod is discovered and items are made. Therefore triggering “Node {#NODE} Pod {#POD} Status: Kubernetes Pod not healthy” as expected for a unhealthy node."