【发布时间】:2020-04-10 15:13:36
【问题描述】:
我正在使用 python 客户端为 kubernetes 编写 python 脚本。
我要统计或计算PODReady状态时间。
In 30 Second pod Ready 或类似。
我现在打算用
'status': {
'conditions': [
{
'last_probe_time': None,
'last_transition_time': datetime.datetime(2019,
12,
17,
13,
14,
58,
tzinfo=tzutc()),
'message': None,
'reason': None,
'status': 'True',
'type': 'Initialized'
},
{
'last_probe_time': None,
'last_transition_time': datetime.datetime(2019,
12,
17,
13,
16,
2,
tzinfo=tzutc()),
'message': None,
'reason': None,
'status': 'True',
'type': 'Ready'
},
{
'last_probe_time': None,
'last_transition_time': datetime.datetime(2019,
12,
17,
13,
16,
2,
tzinfo=tzutc()),
'message': None,
'reason': None,
'status': 'True',
'type': 'ContainersReady'
},
{
'last_probe_time': None,
'last_transition_time': datetime.datetime(2019,
12,
17,
13,
14,
58,
tzinfo=tzutc()),
'message': None,
'reason': None,
'status': 'True',
'type': 'PodScheduled'
}
]
但是期待直接可以从Pod初始化时间得到总Ready状态时间。
任何人都可以提出更好的方法。
非常感谢。
【问题讨论】:
标签: python python-3.x kubernetes google-kubernetes-engine kubernetes-pod