-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pather-model.sql
139 lines (122 loc) · 4.14 KB
/
er-model.sql
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
-- -----------------------------------------------------
-- Table `kubernetes`.`Affinity`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `kubernetes`.`Affinity` (
`uid` TEXT NOT NULL,
`name` TEXT NOT NULL,
`namespace` TEXT NOT NULL,
`weight` INT NOT NULL,
`affinity` TEXT NOT NULL,
`created_at` DATETIME NOT NULL)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `kubernetes`.`Container`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `kubernetes`.`Container` (
`pod_uid` TEXT NOT NULL,
`pod` TEXT NOT NULL,
`namespace` TEXT NOT NULL,
`container` TEXT NOT NULL,
`limit_memory` BIGINT NOT NULL,
`limit_cpu` BIGINT NOT NULL,
`limit_disk` BIGINT NOT NULL,
`request_memory` BIGINT NOT NULL,
`request_cpu` BIGINT NOT NULL,
`request_disk` BIGINT NOT NULL,
`created_at` DATETIME NOT NULL)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `kubernetes`.`Endpoint`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `kubernetes`.`Endpoint` (
`uid` TEXT NOT NULL,
`name` TEXT NOT NULL,
`namespace` TEXT NOT NULL,
`hostname` TEXT NOT NULL,
`ip` TEXT NOT NULL,
`portname` TEXT NOT NULL,
`port` INT NOT NULL,
`created_at` DATETIME NOT NULL)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `kubernetes`.`Node`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `kubernetes`.`Node` (
`uid` TEXT NOT NULL,
`name` TEXT NOT NULL,
`namespace` TEXT NOT NULL,
`free_memory` BIGINT NOT NULL,
`free_cpu` BIGINT NOT NULL,
`free_disk` BIGINT NOT NULL,
`capacity_memory` BIGINT NOT NULL,
`capacity_cpu` BIGINT NOT NULL,
`capacity_disk` BIGINT NOT NULL,
`created_at` DATETIME NOT NULL)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `kubernetes`.`Node_Affinity`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `kubernetes`.`Node_Affinity` (
`uid` TEXT NOT NULL,
`name` TEXT NOT NULL,
`namespace` TEXT NOT NULL,
`weight` INT NOT NULL,
`affinity` TEXT NOT NULL,
`created_at` DATETIME NOT NULL)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `kubernetes`.`Node_Metrics`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `kubernetes`.`Node_Metrics` (
`name` TEXT NOT NULL,
`namespace` TEXT NOT NULL,
`window` BIGINT NOT NULL,
`usage_memory` BIGINT NOT NULL,
`usage_cpu` BIGINT NOT NULL,
`usage_disk` BIGINT NOT NULL,
`created_at` DATETIME NOT NULL)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `kubernetes`.`Pod`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `kubernetes`.`Pod` (
`uid` TEXT NOT NULL,
`name` TEXT NOT NULL,
`namespace` TEXT NOT NULL,
`application` TEXT NOT NULL,
`deployment` TEXT NOT NULL,
`node` TEXT NOT NULL,
`ip` TEXT NOT NULL,
`created_at` DATETIME NOT NULL,
PRIMARY KEY (`uid`, `name`))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `kubernetes`.`Pod_Metrics`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `kubernetes`.`Pod_Metrics` (
`pod` TEXT NOT NULL,
`container` TEXT NOT NULL,
`namespace` TEXT NOT NULL,
`window` BIGINT NOT NULL,
`usage_memory` BIGINT NOT NULL,
`usage_cpu` BIGINT NOT NULL,
`usage_disk` BIGINT NOT NULL,
`created_at` DATETIME NOT NULL)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `kubernetes`.`Traffic`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `kubernetes`.`Traffic` (
`src_deployment` TEXT NOT NULL,
`src_namespace` TEXT NOT NULL,
`dst_deployment` TEXT NOT NULL,
`dst_pod` TEXT NOT NULL,
`dst_instance` TEXT NOT NULL,
`dst_service` TEXT NOT NULL,
`dst_namespace` TEXT NOT NULL,
`protocol` TEXT NOT NULL,
`http_status_code` INT NOT NULL,
`grpc_status_code` INT NOT NULL,
`metric` TEXT NOT NULL,
`value` DOUBLE NOT NULL)
ENGINE = InnoDB;