Skip to content

Commit ec8e5e1

Browse files
committed
deployments/buildmaster: Update, Cleanup, add backup cron job
1 parent 824403d commit ec8e5e1

File tree

1 file changed

+83
-13
lines changed

1 file changed

+83
-13
lines changed

deployments/buildmaster.yml

Lines changed: 83 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,13 @@ spec:
3131
mountPath: /var/instances/master/x86_gcc2
3232
- name: buildmaster-data-riscv64
3333
mountPath: /var/instances/master/riscv64
34-
- name: buildmaster-package-buffer
35-
mountPath: /var/instances/haikuports
3634
- name: buildmaster-x86-64
37-
image: ghcr.io/haikuports/haikuporter/buildmaster:1.3.1-28-gd668
35+
image: ghcr.io/haikuports/haikuporter/buildmaster:1.3.1-32-g6720
3836
#command: ["bootstrap", "x86_64"]
3937
command: ["loop"]
4038
volumeMounts:
41-
- name: buildmaster-package-buffer
42-
mountPath: /var/packages
39+
- name: buildmaster-sources
40+
mountPath: /var/sources
4341
- name: buildmaster-data-x86-64
4442
mountPath: /var/buildmaster
4543
- name: storage-secrets-master
@@ -57,12 +55,12 @@ spec:
5755
- name: REPOSITORY_TRIGGER_URL
5856
value: "https://depot.haiku-os.org/__repository/haikuports/source/haikuports_x86_64/import"
5957
- name: buildmaster-x86-gcc2
60-
image: ghcr.io/haikuports/haikuporter/buildmaster:1.3.1-28-gd668
58+
image: ghcr.io/haikuports/haikuporter/buildmaster:1.3.1-32-g6720
6159
#command: ["bootstrap", "x86_gcc2"]
6260
command: ["loop"]
6361
volumeMounts:
64-
- name: buildmaster-package-buffer
65-
mountPath: /var/packages
62+
- name: buildmaster-sources
63+
mountPath: /var/sources
6664
- name: buildmaster-data-x86-gcc2
6765
mountPath: /var/buildmaster
6866
- name: storage-secrets-master
@@ -80,12 +78,12 @@ spec:
8078
- name: REPOSITORY_TRIGGER_URL
8179
value: "https://depot.haiku-os.org/__repository/haikuports/source/haikuports_x86_gcc2/import"
8280
- name: buildmaster-riscv64
83-
image: ghcr.io/haikuports/haikuporter/buildmaster:1.3.1-28-gd668
81+
image: ghcr.io/haikuports/haikuporter/buildmaster:1.3.1-32-g6720
8482
#command: ["bootstrap", "riscv64"]
8583
command: ["loop"]
8684
volumeMounts:
87-
- name: buildmaster-package-buffer
88-
mountPath: /var/packages
85+
- name: buildmaster-sources
86+
mountPath: /var/sources
8987
- name: buildmaster-data-riscv64
9088
mountPath: /var/buildmaster
9189
- name: storage-secrets-master
@@ -103,6 +101,9 @@ spec:
103101
- name: REPOSITORY_TRIGGER_URL
104102
value: "https://depot.haiku-os.org/__repository/haikuports/source/haikuports_riscv64/import"
105103
volumes:
104+
- name: buildmaster-sources
105+
persistentVolumeClaim:
106+
claimName: buildmaster-sources-pvc
106107
- name: buildmaster-data-x86-gcc2
107108
persistentVolumeClaim:
108109
claimName: buildmaster-data-x86-gcc2-pvc
@@ -112,9 +113,9 @@ spec:
112113
- name: buildmaster-data-riscv64
113114
persistentVolumeClaim:
114115
claimName: buildmaster-data-riscv64-pvc
115-
- name: buildmaster-package-buffer
116+
- name: buildmaster-old-packages
116117
persistentVolumeClaim:
117-
claimName: buildmaster-package-buffer-pvc
118+
claimName: buildmaster-packages-pvc
118119
- name: storage-secrets-master
119120
projected:
120121
sources:
@@ -279,3 +280,72 @@ spec:
279280
name: irccat
280281
port:
281282
number: 80
283+
---
284+
apiVersion: batch/v1
285+
kind: CronJob
286+
metadata:
287+
name: buildmaster-pvbackup
288+
spec:
289+
schedule: "0 6 * * 0"
290+
successfulJobsHistoryLimit: 1
291+
failedJobsHistoryLimit: 1
292+
jobTemplate:
293+
spec:
294+
template:
295+
spec:
296+
# volumes are attached to a single physical node (RWO), this ensures the backup
297+
# job always starts on the same physical node where trac is running
298+
affinity:
299+
podAffinity:
300+
requiredDuringSchedulingIgnoredDuringExecution:
301+
- labelSelector:
302+
matchExpressions:
303+
- key: app
304+
operator: In
305+
values:
306+
- buildmaster
307+
topologyKey: kubernetes.io/hostname
308+
containers:
309+
- name: pvbackup
310+
image: ghcr.io/haiku/pvbackup:1.4
311+
args: ["backup", "buildmaster-data"]
312+
env:
313+
- name: S3_HOST
314+
value: "https://s3.eu-west-1.wasabisys.com"
315+
- name: S3_BUCKET
316+
value: haiku-backups
317+
- name: S3_MAX_AGE
318+
value: 15d
319+
- name: S3_KEY
320+
valueFrom:
321+
secretKeyRef:
322+
name: s3-backup
323+
key: s3_key
324+
- name: S3_SECRET
325+
valueFrom:
326+
secretKeyRef:
327+
name: s3-backup
328+
key: s3_secret
329+
- name: TWOSECRET
330+
valueFrom:
331+
secretKeyRef:
332+
name: s3-backup
333+
key: twosecret
334+
volumeMounts:
335+
- name: buildmaster-data-x86-64
336+
mountPath: /pvs/buildmaster-data/x86_64
337+
- name: buildmaster-data-x86-gcc2
338+
mountPath: /pvs/buildmaster-data/x86_gcc2
339+
- name: buildmaster-data-riscv64
340+
mountPath: /pvs/buildmaster-data/riscv64
341+
volumes:
342+
- name: buildmaster-data-x86-64
343+
persistentVolumeClaim:
344+
claimName: buildmaster-data-x86-64-pvc
345+
- name: buildmaster-data-x86-gcc2
346+
persistentVolumeClaim:
347+
claimName: buildmaster-data-x86-gcc2-pvc
348+
- name: buildmaster-data-riscv64
349+
persistentVolumeClaim:
350+
claimName: buildmaster-data-riscv64-pvc
351+
restartPolicy: Never

0 commit comments

Comments
 (0)