-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheks_cluster_prod.tf
203 lines (196 loc) · 9.18 KB
/
eks_cluster_prod.tf
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
// cluster env
module "k8s_metrics_prod" {
source = "./modules/eks"
cluster_name = "eks_metrics_prod"
eks_version = "1.19"
subnet_ids = var.subnet_ids["prod"]
endpoint_private_access = true
endpoint_public_access = true
public_access_cidrs = var.public_access_cidrs
role_eks = var.role_eks
encryption_config_kms_arn = var.encryption_kms_arn
security_group_ids = ["${aws_security_group.eks_cluster_metrics_prod.id}"]
tags = var.tags
}
// node prod workload general
module "k8s_metrics_prod_node_general" {
source = "./modules/eks-worker-nodes"
cluster_name = module.k8s_metrics_prod.cluster_name
eks_version = "1.19"
cluster_endpoint = module.k8s_metrics_prod.cluster_endpoint
cluster_certificate_autority = module.k8s_metrics_prod.cluster_certificate_autority
node_group_name = "general"
node_role_arn = var.node_role_arn
security_groups = ["${aws_security_group.eks_cluster_metrics_prod.id}","${module.k8s_metrics_prod.cluster_security_group_id}","${aws_security_group.eks_node_metrics_prod.id}"]
subnet_ids = var.subnet_ids_nodes["prod"]
instance_type = "m5.xlarge"
disk_size = 100
labels = {
workload = "general"
}
capacity_type = "ON_DEMAND"
desired_size = 4
min_size = 4
max_size = 4
tags = var.tags
depends_on = [
module.k8s_metrics_env,
kubernetes_config_map.aws_auth_prod
]
}
// node workload thanos query
module "k8s_metrics_prod_node_thanos_query_shared" {
source = "./modules/eks-worker-nodes"
cluster_name = module.k8s_metrics_prod.cluster_name
eks_version = "1.19"
cluster_endpoint = module.k8s_metrics_prod.cluster_endpoint
cluster_certificate_autority = module.k8s_metrics_prod.cluster_certificate_autority
node_group_name = "thanos-query-shared"
node_role_arn = var.node_role_arn
security_groups = ["${aws_security_group.eks_cluster_metrics_prod.id}","${module.k8s_metrics_prod.cluster_security_group_id}","${aws_security_group.eks_node_metrics_prod.id}"]
subnet_ids = var.subnet_ids_nodes["prod"]
instance_type = "m5.xlarge"
disk_size = 100
labels = {
workload = "thanos-query-shared"
}
capacity_type = "ON_DEMAND"
desired_size = 6
min_size = 6
max_size = 20
tags = var.tags
depends_on = [
module.k8s_metrics_prod,
kubernetes_config_map.aws_auth_env
]
}
// node env workload thanos receive and store shared AZ-A
module "k8s_metrics_prod_node_thanos_receive_shared_az_a" {
source = "./modules/eks-worker-nodes"
cluster_name = module.k8s_metrics_prod.cluster_name
eks_version = "1.19"
cluster_endpoint = module.k8s_metrics_prod.cluster_endpoint
cluster_certificate_autority = module.k8s_metrics_prod.cluster_certificate_autority
node_group_name = "thanos-receive-shared-az-a"
node_role_arn = var.node_role_arn
security_groups = ["${aws_security_group.eks_cluster_metrics_prod.id}","${module.k8s_metrics_prod.cluster_security_group_id}","${aws_security_group.eks_node_metrics_prod.id}"]
subnet_ids = var.subnet_ids_nodes["prod-a"]
instance_type = "m5.2xlarge"
disk_size = 700
labels = {
workload = "thanos-receive-shared"
}
capacity_type = "ON_DEMAND"
desired_size = 13
min_size = 13
max_size = 100
tags = var.tags
depends_on = [
module.k8s-metrics-prod,
kubernetes_config_map.aws_auth_prod
]
}
// node env workload thanos receive and store shared AZ-B
module "k8s_metrics_prod_node_thanos_receive_shared_az_b" {
source = "./modules/eks-worker-nodes"
cluster_name = module.k8s_metrics_prod.cluster_name
eks_version = "1.19"
cluster_endpoint = module.k8s_metrics_prod.cluster_endpoint
cluster_certificate_autority = module.k8s_metrics_prod.cluster_certificate_autority
node_group_name = "thanos-receive-shared-az-b"
node_role_arn = var.node_role_arn
security_groups = ["${aws_security_group.eks_cluster_metrics_prod.id}","${module.k8s_metrics_prod.cluster_security_group_id}","${aws_security_group.eks_node_metrics_prod.id}"]
subnet_ids = var.subnet_ids_nodes["prod-b"]
instance_type = "m5.2xlarge"
disk_size = 700
labels = {
workload = "thanos-receive-shared"
}
capacity_type = "ON_DEMAND"
desired_size = 13
min_size = 13
max_size = 100
tags = var.tags
depends_on = [
module.k8s-metrics-prod,
kubernetes_config_map.aws_auth_prod
]
}
// node env workload thanos receive and store shared AZ-C
module "k8s_metrics_prod_node_thanos_receive_shared_az_c" {
source = "./modules/eks-worker-nodes"
cluster_name = module.k8s_metrics_prod.cluster_name
eks_version = "1.19"
cluster_endpoint = module.k8s_metrics_prod.cluster_endpoint
cluster_certificate_autority = module.k8s_metrics_prod.cluster_certificate_autority
node_group_name = "thanos-receive-shared-az-c"
node_role_arn = var.node_role_arn
security_groups = ["${aws_security_group.eks_cluster_metrics_prod.id}","${module.k8s_metrics_prod.cluster_security_group_id}","${aws_security_group.eks_node_metrics_prod.id}"]
subnet_ids = var.subnet_ids_nodes["prod-c"]
instance_type = "m5.2xlarge"
disk_size = 700
labels = {
workload = "thanos-receive-shared"
}
capacity_type = "ON_DEMAND"
desired_size = 13
min_size = 13
max_size = 100
tags = var.tags
depends_on = [
module.k8s_metrics_prod,
kubernetes_config_map.aws_auth_prod
]
}
// node env workload monitoring and store shared
module "k8s_metrics_prod_node_monitoring_shared" {
source = "./modules/eks-worker-nodes"
cluster_name = module.k8s_metrics_prod.cluster_name
eks_version = "1.19"
cluster_endpoint = module.k8s_metrics_prod.cluster_endpoint
cluster_certificate_autority = module.k8s_metrics_prod.cluster_certificate_autority
node_group_name = "monitoring"
node_role_arn = var.node_role_arn
security_groups = ["${aws_security_group.eks_cluster_metrics_prod.id}","${module.k8s_metrics_prod.cluster_security_group_id}","${aws_security_group.eks_node_metrics_prod.id}"]
subnet_ids = var.subnet_ids_nodes["prod"]
instance_type = "r5.2xlarge"
disk_size = 400
labels = {
workload = "monitoring"
}
capacity_type = "ON_DEMAND"
desired_size = 2
min_size = 2
max_size = 4
tags = var.tags
depends_on = [
module.k8s_metrics_prod,
kubernetes_config_map.aws_auth_prod
]
}
// node env workload Grafana and store shared
module "k8s_metrics_env_node_grafana_shared" {
source = "./modules/eks-worker-nodes"
cluster_name = module.k8s_metrics_prod.cluster_name
eks_version = "1.19"
cluster_endpoint = module.k8s_metrics_prod.cluster_endpoint
cluster_certificate_autority = module.k8s_metrics_prod.cluster_certificate_autority
node_group_name = "grafana"
node_role_arn = var.node_role_arn
security_groups = ["${aws_security_group.eks_cluster_metrics_prod.id}","${module.k8s_metrics_prod.cluster_security_group_id}","${aws_security_group.eks_node_metrics_prod.id}"]
subnet_ids = var.subnet_ids_nodes["prod"]
instance_type = "t3a.large"
disk_size = 20
labels = {
workload = "grafana"
}
capacity_type = "ON_DEMAND"
desired_size = 3
min_size = 3
max_size = 4
tags = var.tags
depends_on = [
module.k8s_metrics_prod,
kubernetes_config_map.aws_auth_prod
]
}