forked from grafana/loki
-
Notifications
You must be signed in to change notification settings - Fork 1
/
node.go
105 lines (100 loc) · 1.91 KB
/
node.go
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
package sizing
type NodeType struct {
name string
cores int
memoryGB int
readPod NodePod
writePod NodePod
}
type NodePod struct {
cpuRequest float64
cpuLimit float64 // Or null
memoryRequest int
memoryLimit int
rateBytesSecond float64
}
var StandardWrite = NodePod{
cpuRequest: 1,
cpuLimit: 2,
memoryRequest: 6,
memoryLimit: 12,
rateBytesSecond: 3 * 1024 * 1024,
}
var StandardRead = NodePod{
cpuRequest: 3,
cpuLimit: 3, // Undefined TODO: Is this a bug
memoryRequest: 6,
memoryLimit: 8,
rateBytesSecond: 768 * 1024 * 1024,
}
var NodeTypesByProvider = map[string]map[string]NodeType{
"AWS": {
"t2.xlarge": {
name: "t2.xlarge",
cores: 4,
memoryGB: 16,
readPod: StandardRead,
writePod: StandardWrite,
},
"t2.2xlarge": {
name: "t2.2xlarge",
cores: 8,
memoryGB: 32,
readPod: StandardRead,
writePod: StandardWrite,
},
"t2.4xlarge": {
name: "t2.4xlarge",
cores: 16,
memoryGB: 64,
readPod: StandardRead,
writePod: StandardWrite,
},
},
"GCP": {
"e2-standard-4": {
name: "e2-standard-4",
cores: 4,
memoryGB: 16,
readPod: StandardRead,
writePod: StandardWrite,
},
"e2-standard-8": {
name: "e2-standard-8",
cores: 8,
memoryGB: 32,
readPod: StandardRead,
writePod: StandardWrite,
},
"e2-standard-16": {
name: "e2-standard-16",
cores: 16,
memoryGB: 64,
readPod: StandardRead,
writePod: StandardWrite,
},
},
"OVHcloud": {
"b2-30": {
name: "b2-30",
cores: 8,
memoryGB: 30,
readPod: StandardRead,
writePod: StandardWrite,
},
"b2-60": {
name: "b2-60",
cores: 16,
memoryGB: 60,
readPod: StandardRead,
writePod: StandardWrite,
},
"b2-120": {
name: "b2-120",
cores: 32,
memoryGB: 120,
readPod: StandardRead,
writePod: StandardWrite,
},
},
}