-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontrol_plane.bu.mustache
More file actions
310 lines (272 loc) · 8.09 KB
/
control_plane.bu.mustache
File metadata and controls
310 lines (272 loc) · 8.09 KB
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
variant: fcos
version: 1.5.0
passwd:
users:
- name: core
ssh_authorized_keys:
- {{ssh_authorized_key}}
storage:
files:
- path: /etc/otelcol-contrib/config.yaml
contents:
local: files/otelcol.yaml
mode: 0644
- path: /etc/rancher/k3s/config.yaml
contents:
local: files/k3s-config.yaml
mode: 0600
- path: /etc/rancher/k3s/tls/server-ca.crt
contents:
local: certs/server-ca.crt
mode: 0644
- path: /etc/rancher/k3s/tls/server-ca.key
contents:
local: certs/server-ca.key
mode: 0600
- path: /etc/rancher/k3s/tls/client-ca.crt
contents:
local: certs/client-ca.crt
mode: 0644
- path: /etc/rancher/k3s/tls/client-ca.key
contents:
local: certs/client-ca.key
mode: 0600
- path: /usr/local/bin/configure-vpc.sh
mode: 0755
contents:
local: files/configure-vpc.sh
- path: /usr/local/bin/k3s-init.sh
mode: 0755
contents:
local: files/k3s-init.sh
- path: /etc/rancher/k3s/manifests/fleetlock.yaml
contents:
local: files/fleetlock.yaml
mode: 0644
- path: /etc/rancher/k3s/manifests/traefik-config.yaml
contents:
local: files/traefik-config.yaml
mode: 0644
- path: /etc/rancher/k3s/manifests/external-dns.yaml
contents:
local: files/external-dns.yaml
mode: 0644
- path: /etc/rancher/k3s/manifests/vultr-dns-secret.yaml
contents:
local: files/vultr-dns-secret.yaml
mode: 0600
- path: /etc/rancher/k3s/manifests/vultr-csi-secret.yaml
contents:
local: files/vultr-csi-secret.yaml
mode: 0600
- path: /etc/rancher/k3s/manifests/vultr-csi.yaml
contents:
local: vendor/vultr-csi/v0.17.1.yml
mode: 0644
- path: /etc/rancher/k3s/manifests/cert-manager.yaml
contents:
local: files/cert-manager.yaml
mode: 0644
- path: /etc/rancher/k3s/manifests/cert-manager-webhook-vultr.yaml
contents:
local: files/cert-manager-webhook-vultr.yaml
mode: 0644
- path: /etc/rancher/k3s/manifests/cluster-issuer.yaml
contents:
local: files/cluster-issuer.yaml
mode: 0644
- path: /etc/rancher/k3s/manifests/keel.yaml
contents:
local: files/keel.yaml
mode: 0644
- path: /etc/rancher/k3s/manifests/otelcol-k8s.yaml
contents:
local: files/otelcol-k8s.yaml
mode: 0600
- path: /usr/local/bin/upgrade-os.sh
mode: 0755
contents:
local: files/upgrade-os.sh
- path: /usr/local/bin/fleetlock-release.sh
mode: 0755
contents:
local: files/fleetlock-release.sh
- path: /var/lib/.fresh-deploy
mode: 0644
contents:
inline: ""
- path: /etc/rancher/k3s/manifests/agent-cleanup-rbac.yaml
contents:
local: files/agent-cleanup-rbac.yaml
mode: 0644
- path: /etc/rancher/k3s/manifests/coredns-autoscaler.yaml
contents:
local: files/coredns-autoscaler.yaml
mode: 0644
- path: /usr/local/bin/rebase-os.sh
mode: 0755
contents:
local: files/rebase-os.sh
- path: /usr/local/bin/enforce-taint.sh
mode: 0755
contents:
local: files/enforce-taint.sh
systemd:
units:
- name: rebase-os.service
enabled: true
contents: |
[Unit]
Description=Rebase to custom FCOS image
After=network-online.target
Requires=network-online.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/local/bin/rebase-os.sh
[Install]
WantedBy=multi-user.target
- name: otelcol-contrib.service
enabled: true
contents: |
[Unit]
Description=OpenTelemetry Collector Contrib
After=rebase-os.service network-online.target
Requires=rebase-os.service
[Service]
ExecStart=/usr/bin/otelcol-contrib --config /etc/otelcol-contrib/config.yaml
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
- name: configure-vpc.service
enabled: true
contents: |
[Unit]
Description=Configure VPC network interface from Vultr metadata
After=network-online.target
Requires=network-online.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/local/bin/configure-vpc.sh 10.0.0.3
[Install]
WantedBy=multi-user.target
- name: k3s-init.service
enabled: true
contents: |
[Unit]
Description=Initialize k3s (IP detection, TLS cert management)
After=rebase-os.service var-lib-rancher-k3s.mount configure-vpc.service network-online.target
Requires=rebase-os.service var-lib-rancher-k3s.mount configure-vpc.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/local/bin/k3s-init.sh
[Install]
WantedBy=multi-user.target
- name: k3s.service
enabled: true
contents: |
[Unit]
Description=k3s control plane
After=k3s-init.service network-online.target
Requires=k3s-init.service
[Service]
ExecStart=/usr/bin/k3s server
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
- name: upgrade-os.service
enabled: false
contents: |
[Unit]
Description=Check for and apply OS image upgrades
After=network-online.target
Requires=network-online.target
ConditionPathExists=/var/lib/.rebase-complete
[Service]
Type=oneshot
ExecStart=/usr/local/bin/upgrade-os.sh
- name: upgrade-os.timer
enabled: true
contents: |
[Unit]
Description=Periodic OS image upgrade check
[Timer]
OnBootSec=5min
OnUnitActiveSec=6h
RandomizedDelaySec=30min
[Install]
WantedBy=timers.target
- name: enforce-taint.service
enabled: true
contents: |
[Unit]
Description=Enforce control-plane taint
After=k3s.service
Requires=k3s.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/local/bin/enforce-taint.sh
[Install]
WantedBy=multi-user.target
- name: fleetlock-release.service
enabled: true
contents: |
[Unit]
Description=Release FleetLock after reboot
After=network-online.target k3s.service
Requires=network-online.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/local/bin/fleetlock-release.sh
[Install]
WantedBy=multi-user.target
- name: format-vdb.service
enabled: true
contents: |
[Unit]
Description=Partition /dev/vdb if needed
DefaultDependencies=no
After=dev-vdb.device
Before=local-fs.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/bash -c 'blkid /dev/vdb | grep -q TYPE || sgdisk -Z -n 1:0:0 -t 1:8300 /dev/vdb'
[Install]
WantedBy=multi-user.target
- name: mkfs-vdb1.service
enabled: true
contents: |
[Unit]
Description=Format /dev/vdb1 if needed
DefaultDependencies=no
After=dev-vdb1.device format-vdb.service
Before=local-fs.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/bash -c 'blkid /dev/vdb1 | grep -q TYPE || mkfs.ext4 /dev/vdb1'
[Install]
WantedBy=multi-user.target
- name: var-lib-rancher-k3s.mount
enabled: true
contents: |
[Unit]
Description=Mount k3s data volume
After=mkfs-vdb1.service
Requires=mkfs-vdb1.service
[Mount]
What=/dev/vdb1
Where=/var/lib/rancher/k3s
Type=ext4
[Install]
WantedBy=multi-user.target