Branch: refs/heads/master
Home:
https://github.com/tribe29/checkmk
Commit: 02d43c209366c8558e7073a5544e4ce752c537dc
https://github.com/tribe29/checkmk/commit/02d43c209366c8558e7073a5544e4ce75…
Author: Benedikt Seidl <benedikt.seidl(a)tribe29.com>
Date: 2021-05-25 (Tue, 25 May 2021)
Changed paths:
A .werks/12788
M cmk/special_agents/agent_kubernetes.py
Log Message:
-----------
12788 FIX Kubernetes: agent: handle pending pods
Before this werk, the kubernetes special agent could not handle pods that are
pending. The error message was:
TypeError: '<' not supported between instances of 'NoneType' and
'str'
This should now be fixed.
Full Traceback:
Traceback (most recent call last):
File "/omd/sites/cmk200d/share/check_mk/agents/special/agent_kubernetes", line
12, in <module>
sys.exit(main())
File "/omd/sites/cmk200d/lib/python3/cmk/special_agents/agent_kubernetes.py",
line 1499, in main
print(api_data.node_sections())
File "/omd/sites/cmk200d/lib/python3/cmk/special_agents/agent_kubernetes.py",
line 1371, in node_sections
g.join('k8s_resources', self.pods.resources_per_node())
File "/omd/sites/cmk200d/lib/python3/cmk/special_agents/agent_kubernetes.py",
line 976, in resources_per_node
pods_sorted = sorted(self, key=lambda pod: pod.node)
TypeError: '<' not supported between instances of 'NoneType' and
'str'
Pending pods don't have an assigned node:
$ kubectl get pods -o wide
NAME READY STATUS RESTARTS AGE IP NODE
NOMINATED NODE READINESS GATES
my-kubeview-54f9bc7d9f-v4sjh 1/1 Running 0 16h 10.42.1.4 k3s-01-02
<none> <none>
svclb-my-kubeview-x2kqd 0/1 Pending 0 16h <none>
<none> <none> <none>
svclb-my-kubeview-vql8c 0/1 Pending 0 16h <none>
<none> <none> <none>
Change-Id: Idb14c2a958458d1071ac2be594eea30d99004db6