Skip to content

Commit 2f8a414

Browse files
authored
feat(base-cluster): add kube-janitor (#1011)
1 parent 798a7c7 commit 2f8a414

File tree

5 files changed

+55
-5
lines changed

5 files changed

+55
-5
lines changed

charts/base-cluster/Chart.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dependencies:
22
- name: common
33
repository: oci://ghcr.io/teutonet/teutonet-helm-charts
4-
version: 1.0.0
5-
digest: sha256:acfa022eb3ff1b32622813ee173a127c23c729abb6fe8235795b668bb496ed2e
6-
generated: "2024-04-12T13:36:20.75023109+02:00"
4+
version: 1.2.0
5+
digest: sha256:62ef92fb03b60b1bf481b96b8b856f3b3156c10cc50a50e3604c8b679ef71497
6+
generated: "2024-07-01T11:48:12.942337506+02:00"

charts/base-cluster/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ home: https://teuto.net
1616
description: A common base for every kubernetes cluster
1717
dependencies:
1818
- name: common
19-
version: 1.0.0
19+
version: 1.2.0
2020
repository: oci://ghcr.io/teutonet/teutonet-helm-charts
2121
annotations:
2222
artifacthub.io/images: |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{{- if dig "kube-janitor" "enabled" false .Values.AsMap -}}
2+
apiVersion: helm.toolkit.fluxcd.io/v2
3+
kind: HelmRelease
4+
metadata:
5+
name: kube-janitor
6+
namespace: kube-system
7+
labels: {{- include "common.labels.standard" $ | nindent 4 }}
8+
app.kubernetes.io/component: kube-janitor
9+
spec:
10+
chart:
11+
spec: {{- include "base-cluster.helm.chartSpec" (dict "repo" "kube-janitor" "chart" "kube-janitor" "context" $) | nindent 6 }}
12+
interval: 1h
13+
driftDetection:
14+
mode: enabled
15+
values:
16+
priorityClassName: cluster-components
17+
{{- $image := dict -}}
18+
{{- if .Values.global.imageRegistry -}}
19+
{{- $image = set $image "repository" (printf "%s/hjacobs/kube-janitor" $.Values.global.imageRegistry) -}}
20+
{{- end }}
21+
{{- with dig "kube-janitor" "charts" "kube-janitor" "tag" "" .Values.global.helmRepositories -}}
22+
{{- $image = set $image "tag" . -}}
23+
{{- end }}
24+
{{- with $image }}
25+
image: {{- toYaml $image | nindent 6 }}
26+
{{- end }}
27+
resources:
28+
limits:
29+
memory: 1Gi
30+
{{- end -}}

charts/base-cluster/values.schema.json

+10-1
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@
818818
},
819819
"additionalProperties": false
820820
},
821-
"sidecar": {
821+
"sidecar": {
822822
"type": "object",
823823
"properties": {
824824
"resourcesPreset": {
@@ -1552,6 +1552,15 @@
15521552
],
15531553
"additionalProperties": false
15541554
},
1555+
"kube-janitor": {
1556+
"type": "object",
1557+
"properties": {
1558+
"enabled": {
1559+
"type": "boolean"
1560+
}
1561+
},
1562+
"additionalProperties": false
1563+
},
15551564
"common": {
15561565
"type": "object",
15571566
"description": "Values for sub-chart"

charts/base-cluster/values.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,14 @@ global:
172172
charts:
173173
opentelemetry-collector: 0.x.x
174174
condition: "{{ and .Values.monitoring.tracing.enabled .Values.monitoring.prometheus.enabled }}"
175+
kube-janitor:
176+
url: https://codeberg.org/hjacobs/kube-janitor
177+
charts:
178+
kube-janitor:
179+
path: unsupported/helm
180+
tag: 23.7.0
181+
type: git
182+
condition: '{{ dig "kube-janitor" "enabled" false .Values.AsMap }}'
175183
authentication:
176184
grafana:
177185
authenticationPath: /protocol/openid-connect/auth
@@ -436,3 +444,6 @@ backup:
436444
limits:
437445
cpu: 500m
438446
memory: 500Mi
447+
448+
kube-janitor:
449+
enabled: false

0 commit comments

Comments
 (0)