Skip to content

Commit

Permalink
feat(base-cluster): add kube-janitor (#1011)
Browse files Browse the repository at this point in the history
  • Loading branch information
cwrau committed Jul 2, 2024
1 parent 798a7c7 commit 2f8a414
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 5 deletions.
6 changes: 3 additions & 3 deletions charts/base-cluster/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies:
- name: common
repository: oci://ghcr.io/teutonet/teutonet-helm-charts
version: 1.0.0
digest: sha256:acfa022eb3ff1b32622813ee173a127c23c729abb6fe8235795b668bb496ed2e
generated: "2024-04-12T13:36:20.75023109+02:00"
version: 1.2.0
digest: sha256:62ef92fb03b60b1bf481b96b8b856f3b3156c10cc50a50e3604c8b679ef71497
generated: "2024-07-01T11:48:12.942337506+02:00"
2 changes: 1 addition & 1 deletion charts/base-cluster/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ home: https://teuto.net
description: A common base for every kubernetes cluster
dependencies:
- name: common
version: 1.0.0
version: 1.2.0
repository: oci://ghcr.io/teutonet/teutonet-helm-charts
annotations:
artifacthub.io/images: |
Expand Down
30 changes: 30 additions & 0 deletions charts/base-cluster/templates/global/kube-janitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{{- if dig "kube-janitor" "enabled" false .Values.AsMap -}}
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: kube-janitor
namespace: kube-system
labels: {{- include "common.labels.standard" $ | nindent 4 }}
app.kubernetes.io/component: kube-janitor
spec:
chart:
spec: {{- include "base-cluster.helm.chartSpec" (dict "repo" "kube-janitor" "chart" "kube-janitor" "context" $) | nindent 6 }}
interval: 1h
driftDetection:
mode: enabled
values:
priorityClassName: cluster-components
{{- $image := dict -}}
{{- if .Values.global.imageRegistry -}}
{{- $image = set $image "repository" (printf "%s/hjacobs/kube-janitor" $.Values.global.imageRegistry) -}}
{{- end }}
{{- with dig "kube-janitor" "charts" "kube-janitor" "tag" "" .Values.global.helmRepositories -}}
{{- $image = set $image "tag" . -}}
{{- end }}
{{- with $image }}
image: {{- toYaml $image | nindent 6 }}
{{- end }}
resources:
limits:
memory: 1Gi
{{- end -}}
11 changes: 10 additions & 1 deletion charts/base-cluster/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@
},
"additionalProperties": false
},
"sidecar": {
"sidecar": {
"type": "object",
"properties": {
"resourcesPreset": {
Expand Down Expand Up @@ -1552,6 +1552,15 @@
],
"additionalProperties": false
},
"kube-janitor": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
}
},
"additionalProperties": false
},
"common": {
"type": "object",
"description": "Values for sub-chart"
Expand Down
11 changes: 11 additions & 0 deletions charts/base-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,14 @@ global:
charts:
opentelemetry-collector: 0.x.x
condition: "{{ and .Values.monitoring.tracing.enabled .Values.monitoring.prometheus.enabled }}"
kube-janitor:
url: https://codeberg.org/hjacobs/kube-janitor
charts:
kube-janitor:
path: unsupported/helm
tag: 23.7.0
type: git
condition: '{{ dig "kube-janitor" "enabled" false .Values.AsMap }}'
authentication:
grafana:
authenticationPath: /protocol/openid-connect/auth
Expand Down Expand Up @@ -436,3 +444,6 @@ backup:
limits:
cpu: 500m
memory: 500Mi

kube-janitor:
enabled: false

0 comments on commit 2f8a414

Please sign in to comment.