forked from tigera/operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate-controller-dependency-graph.py
executable file
·91 lines (83 loc) · 4.36 KB
/
generate-controller-dependency-graph.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/usr/bin/env python3
from pydot import Dot
from pydot import Edge
from pydot import Node
def main():
graph = Dot('Controller Dependency Graph')
# controller node list
graph.add_node(Node('amazoncloudintegration',
label='AmazonCloudIntegration', shape='box'))
graph.add_node(Node('apiserver', label='APIServer', shape='box'))
graph.add_node(Node('applicationlayer', label='ApplicationLayer', shape='box'))
graph.add_node(Node('authentication', label='Authentication', shape='box'))
graph.add_node(Node('clusterconnection',
label='{ClusterConnection|Standalone\nManagementCluster\nManagementClusterConnection}', shape='record'))
graph.add_node(Node('compliance', label='Compliance', shape='box'))
graph.add_node(Node('installation', label='Installation', shape='box'))
graph.add_node(Node('intrusiondetection',
label='IntrusionDetection', shape='box'))
graph.add_node(Node('logcollector', label='LogCollector', shape='box'))
graph.add_node(Node('logstorage', label='LogStorage', shape='box'))
graph.add_node(Node('manager', label='Manager', shape='box'))
graph.add_node(Node('monitor', label='Monitor', shape='box'))
# The controller dependencies are deduced from controller Reconcile() function.
# This is still a manual process at the moment.
# [AmazonCloudIntegration] -> [Installation]
graph.add_edge(Edge('amazoncloudintegration', 'installation'))
# [APIServer] --> [AmazonCloudIntegration]
# [APIServer] --> [ClusterConnection]
# [APIServer] -> [Installation]
graph.add_edge(Edge('apiserver', 'amazoncloudintegration', label='amazonCRDExists', style='dashed'))
graph.add_edge(Edge('apiserver', 'clusterconnection', label='TSEE', style='dashed'))
graph.add_edge(Edge('apiserver', 'installation'))
# [ApplicationLayer] -> [Installation]
graph.add_edge(Edge('applicationlayer', 'installation'))
# [Authentication] -> [ClusterConnection]
# [Authentication] -> [Installation]
graph.add_edge(Edge('authentication', 'clusterconnection', style='dashed'))
graph.add_edge(Edge('authentication', 'installation'))
# [ClusterConnection|ManagementCluster;ManagementClusterConnection] -> [Installation]
graph.add_edge(Edge('clusterconnection', 'installation', style='dashed'))
# [Compliance] -> [Authentication]
# [Compliance] -> [ClusterConnection]
# [Compliance] -> [Installation]
# [Compliance] -> [LogStorage]
graph.add_edge(Edge('compliance', 'authentication'))
graph.add_edge(Edge('compliance', 'clusterconnection', style='dashed'))
graph.add_edge(Edge('compliance', 'installation'))
graph.add_edge(Edge('compliance', 'logstorage'))
# [IntrusionDetection] -> [ClusterConnection]
# [IntrusionDetection] -> [Installation]
# [IntrusionDetection] -> [LogStorage]
graph.add_edge(Edge('intrusiondetection', 'clusterconnection', style='dashed'))
graph.add_edge(Edge('intrusiondetection', 'installation'))
graph.add_edge(Edge('intrusiondetection', 'logstorage'))
# [LogCollector] --> [ClusterConnection]
# [LogCollector] -> [Installation]
# [LogCollector] -> [LogStorage]
graph.add_edge(Edge('logcollector', 'clusterconnection', label='AdditionalStores', style='dashed'))
graph.add_edge(Edge('logcollector', 'installation'))
graph.add_edge(Edge('logcollector', 'logstorage'))
# [LogStorage] -> [Authentication]
# [LogStorage] -> [ClusterConnection]
# [LogStorage] -> [Installation]
graph.add_edge(Edge('logstorage', 'authentication'))
graph.add_edge(Edge('logstorage', 'clusterconnection', style='dashed'))
graph.add_edge(Edge('logstorage', 'installation'))
# [Manager] -> [Authentication]
# [Manager] -> [ClusterConnection]
# [Manager] -> [Compliance]
# [Manager] -> [Installation]
# [Manager] -> [LogStorage]
graph.add_edge(Edge('manager', 'authentication'))
graph.add_edge(Edge('manager', 'clusterconnection', style='dashed'))
graph.add_edge(Edge('manager', 'compliance'))
graph.add_edge(Edge('manager', 'installation'))
graph.add_edge(Edge('manager', 'logstorage'))
# [Monitor] -> [Authentication]
graph.add_edge(Edge('monitor', 'authentication'))
# [Monitor] -> [Installation]
graph.add_edge(Edge('monitor', 'installation'))
graph.write_svg('controller-dependency-graph.svg')
if __name__ == '__main__':
main()