Newer
Older
resource "rancher2_cluster" "cluster-admin" {
name = "cluster-admin"
description = "cluster for admin tools (argocd, minio, ...)"
rke_config {
kubernetes_version = "v1.22.13-rancher1-1"
network {
plugin = "canal"
}
ingress {
provider = "none"
}
upgrade_strategy {
drain = true
drain_input {
delete_local_data = true
timeout = 300
}
}
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
204
205
206
207
208
}
}
output "cluster-admin-config-summary" {
sensitive = true
value = rancher2_cluster.cluster-admin.kube_config
}
output "cluster-admin-register-command" {
sensitive = true
value = rancher2_cluster.cluster-admin.cluster_registration_token[0].node_command
}
module "rancher-node-admin-mgmt1" {
hostname = "rancher-node-admin-mgmt1"
vmid = 171
source = "../modules/node"
template = var.templates["stable-zfs"]
config = local.config
description = "Admin cluster node with etcd, controlplane and worker roles"
hypervisor = "hypervisor3"
sockets = "1"
cores = "4"
onboot = true
memory = "12288"
balloon = "8192"
networks = [{
id = 0
ip = "192.168.50.45"
gateway = local.config["gateway_ip"]
bridge = local.config["vlan"]
}]
storages = [{
storage = "proxmox"
size = "20G"
}, {
storage = "proxmox"
size = "20G"
}
]
post_provision_steps = [
"systemctl restart docker", # workaround
"${rancher2_cluster.cluster-admin.cluster_registration_token[0].node_command} --etcd --controlplane"
]
}
output "rancher-node-admin-mgmt1_summary" {
value = module.rancher-node-admin-mgmt1.summary
}
module "rancher-node-admin-node01" {
hostname = "rancher-node-admin-node01"
vmid = 172
source = "../modules/node"
template = var.templates["stable-zfs"]
config = local.config
description = "Admin cluster node01"
hypervisor = "hypervisor3"
sockets = "1"
cores = "4"
onboot = true
memory = "16384"
balloon = "8192"
networks = [{
id = 0
ip = "192.168.50.46"
gateway = local.config["gateway_ip"]
bridge = local.config["vlan"]
}]
storages = [{
storage = "proxmox"
size = "20G"
}, {
storage = "proxmox"
size = "20G"
}
]
post_provision_steps = [
"systemctl restart docker", # workaround
"${rancher2_cluster.cluster-admin.cluster_registration_token[0].node_command} --worker"
]
}
output "rancher-node-admin-node01_summary" {
value = module.rancher-node-admin-node01.summary
}
module "rancher-node-admin-node02" {
hostname = "rancher-node-admin-node02"
vmid = 173
source = "../modules/node"
template = var.templates["stable-zfs"]
config = local.config
description = "Admin cluster node02"
hypervisor = "branly"
sockets = "1"
cores = "4"
onboot = true
memory = "16384"
balloon = "8192"
networks = [{
id = 0
ip = "192.168.50.47"
gateway = local.config["gateway_ip"]
bridge = local.config["vlan"]
}]
storages = [{
storage = "proxmox"
size = "20G"
}, {
storage = "proxmox"
size = "20G"
}
]
post_provision_steps = [
"systemctl restart docker", # workaround
"${rancher2_cluster.cluster-admin.cluster_registration_token[0].node_command} --worker"
]
}
output "rancher-node-admin-node02_summary" {
value = module.rancher-node-admin-node02.summary
}
module "rancher-node-admin-node03" {
hostname = "rancher-node-admin-node03"
vmid = 174
source = "../modules/node"
template = var.templates["stable-zfs"]
config = local.config
description = "Admin cluster node03"
hypervisor = "pompidou"
sockets = "1"
cores = "4"
onboot = true
memory = "16384"
balloon = "8192"
networks = [{
id = 0
ip = "192.168.50.48"
gateway = local.config["gateway_ip"]
bridge = local.config["vlan"]
}]
storages = [{
storage = "proxmox"
size = "20G"
}, {
storage = "proxmox"
size = "20G"
}
]
post_provision_steps = [
"systemctl restart docker", # workaround
"${rancher2_cluster.cluster-admin.cluster_registration_token[0].node_command} --worker"
]
}
output "rancher-node-admin-node03_summary" {
value = module.rancher-node-admin-node03.summary
}
resource "rancher2_app_v2" "cluster-admin-rancher-monitoring" {
cluster_id = rancher2_cluster.cluster-admin.id
name = "rancher-monitoring"
namespace = "cattle-monitoring-system"
repo_name = "rancher-charts"
chart_name = "rancher-monitoring"
chart_version = "100.1.3+up19.0.3"
values = <<EOF
prometheus:
enabled: true
prometheusSpec:
externalLabels:
Vincent Sellier
committed
cluster_name: ${rancher2_cluster.cluster-admin.name}
domain: admin
environment: admin
infrastructure: kubernetes
Vincent Sellier
committed
requests:
cpu: 250m
memory: 250Mi
retention: 15d
thanos:
objectStorageConfig:
key: thanos.yaml
name: thanos-objstore-config-secret
thanosIngress:
annotations:
Vincent Sellier
committed
cert-manager.io/cluster-issuer: letsencrypt-production
kubernetes.io/tls-acme: "true"
metallb.universe.tf/allow-shared-ip: clusterIP
nginx.ingress.kubernetes.io/backend-protocol: GRPC
Vincent Sellier
committed
enabled: true
hosts:
- k8s-admin-thanos.internal.admin.swh.network
loadBalancerIP: 192.168.50.44
pathType: Prefix
tls:
- hosts:
- k8s-admin-thanos.internal.admin.swh.network
secretName: thanos-crt
thanosService:
enabled: false
thanosServiceExternal:
annotations:
metallb.universe.tf/allow-shared-ip: clusterIP
Vincent Sellier
committed
enabled: false
loadBalancerIP: 192.168.50.44