-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun.py
executable file
·77 lines (31 loc) · 1.46 KB
/
run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/usr/bin/env python
#shortcut to quickly try and test without doing full pyb (TODO: learn some python testcase! probably best do it with testcases)
import sys
import logging
import pydash as _
sys.path.append('src/main/python')
from kk.kube_objects import KubeObjects
from kk.utils import Utils
kk = KubeObjects()
kk.refresh(use_cache = True)
# pod_nodes = kk.pod_nodes()
# for pn in pod_nodes:
# # Utils.print_preety(pn, 'pod_name:70', 'app_name:50', 'namespace', 'pod_state', 'node_group', 'node_lifecycle')
# Utils.print_preety(pn, 'pod.metadata.name:70', 'node.metadata.name:70')
# kiam_pod = kk.get_pod(label_selector = 'app=streamtech-ibms-service/streamtech-cdn-selection-service', field_selector = 'metadata.namespace=streamtech/content/commerce')
# pods = kk.get_pod(exclude='metadata.owner_references[0].kind=DaemonSet')
# print(len(pods))
# for kp in pods:
# Utils.print_preety(kp, False, 'metadata.name:60', 'metadata.namespace')
# print(_.get(kp, 'metadata.owner_references[0].kind'))
# print(_.get(kp, 'status.container_statuses[0].restart_count'))
# break
pod_nodes = kk.pod_nodes( pod_field_selector = 'metadata.namespace=streamtech/content/commerce')
for pn in pod_nodes:
Utils.print_dict(pn, 'node.metadata')
# print(_.get(pn, 'node.metadata'))
break
# print(kiam_pod)
# Utils.print_preety(kiam_pod, 'metadata.name:90')
# print(_.get(kiam_pod, 'metadata'))
# kk.filter_pod(label_selector = '')