Skip to content

Commit 851a79d

Browse files
authored
KubeArchive: add vacuum to prevent missing messages (#7385)
Signed-off-by: Hector Martinez <[email protected]>
1 parent 862943a commit 851a79d

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed

components/kubearchive/development/kustomization.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ kind: Kustomization
44
resources:
55
- ../base
66
- postgresql.yaml
7+
- vacuum.yaml
78
- https://github.com/kubearchive/kubearchive/releases/download/v1.3.0/kubearchive.yaml?timeout=90
89

910
namespace: product-kubearchive
@@ -21,6 +22,19 @@ secretGenerator:
2122
type: Opaque
2223

2324
patches:
25+
- patch: |-
26+
apiVersion: batch/v1
27+
kind: CronJob
28+
metadata:
29+
name: vacuum-all
30+
spec:
31+
jobTemplate:
32+
spec:
33+
template:
34+
spec:
35+
containers:
36+
- name: vacuum
37+
image: quay.io/kubearchive/vacuum:v1.3.0
2438
- patch: |-
2539
apiVersion: batch/v1
2640
kind: Job
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
apiVersion: kubearchive.org/v1
3+
kind: ClusterVacuumConfig
4+
metadata:
5+
name: vacuum-config-all
6+
spec:
7+
namespaces: {}
8+
---
9+
apiVersion: batch/v1
10+
kind: CronJob
11+
metadata:
12+
name: vacuum-all
13+
annotations:
14+
# Needed if just the command is changed, otherwise the job needs to be deleted manually
15+
argocd.argoproj.io/sync-options: Force=true,Replace=true
16+
spec:
17+
schedule: "20 1 * * *"
18+
jobTemplate:
19+
spec:
20+
template:
21+
spec:
22+
serviceAccountName: kubearchive-cluster-vacuum
23+
containers:
24+
- name: vacuum
25+
image: quay.io/kubearchive/vacuum:v1.3.0
26+
command: [ "/ko-app/vacuum" ]
27+
args:
28+
- --type
29+
- cluster
30+
- --config
31+
- vacuum-config-all
32+
env:
33+
- name: KUBEARCHIVE_NAMESPACE
34+
valueFrom:
35+
fieldRef:
36+
fieldPath: metadata.namespace
37+
securityContext:
38+
readOnlyRootFilesystem: true
39+
runAsNonRoot: true
40+
resources:
41+
requests:
42+
cpu: 100m
43+
memory: 256Mi
44+
limits:
45+
cpu: 100m
46+
memory: 256Mi
47+
restartPolicy: Never
48+

0 commit comments

Comments
 (0)