Skip to content

Commit 1664dbc

Browse files
committed
make kube-janitor opt-in for production clusters
1 parent aa7f9e5 commit 1664dbc

File tree

6 files changed

+29
-5
lines changed

6 files changed

+29
-5
lines changed

cluster/config-defaults.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1170,7 +1170,13 @@ control_plane_load_balancer_internal: "none"
11701170
# fs.inotify.max_user_watches = 100000
11711171
sysctl_settings: ""
11721172

1173-
1173+
# kube-janitor configuration
1174+
{{if eq .Cluster.Environment "production"}}
1175+
# This makes kube-janitor opt-in for production clusters
1176+
kube_janitor_enabled: "false"
1177+
{{else}}
1178+
kube_janitor_enabled: "true"
1179+
{{end}}
11741180

11751181
# scheduling_controls
11761182
teapot_admission_controller_scheduling_controls_enabled: "false"

cluster/manifests/deletions.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,3 +330,21 @@ post_apply:
330330
kind: ServiceAccount
331331
namespace: kube-system
332332
{{- end }}
333+
{{- if ne .Cluster.ConfigItems.kube_janitor_enabled "true" }}
334+
- name: kube-janitor
335+
kind: Deployment
336+
namespace: kube-system
337+
- name: kube-janitor
338+
kind: ConfigMap
339+
namespace: kube-system
340+
- name: kube-janitor
341+
kind: VerticalPodAutoscaler
342+
namespace: kube-system
343+
- name: kube-janitor
344+
kind: ServiceAccount
345+
namespace: kube-system
346+
- name: kube-janitor
347+
kind: ClusterRole
348+
- name: kube-janitor
349+
kind: ClusterRoleBinding
350+
{{- end }}

cluster/manifests/kube-janitor/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# {{ if ne .Cluster.Environment "production" }}
1+
# {{ if eq .Cluster.ConfigItems "kube_janitor_enabled" "true" }}
22
# {{ $image := "container-registry.zalando.net/teapot/kube-janitor:23.7.0-main-2" }}
33
# {{ $version := index (split (index (split $image ":") 1) "-") 0 }}
44
apiVersion: apps/v1

cluster/manifests/kube-janitor/rbac.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{ if ne .Cluster.Environment "production" }}
1+
{{ if eq .Cluster.ConfigItems "kube_janitor_enabled" "true" }}
22
apiVersion: v1
33
kind: ServiceAccount
44
metadata:

cluster/manifests/kube-janitor/rules-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# {{ if ne .Cluster.Environment "production" }}
1+
# {{ if eq .Cluster.ConfigItems "kube_janitor_enabled" "true" }}
22
apiVersion: v1
33
kind: ConfigMap
44
metadata:

cluster/manifests/kube-janitor/vpa.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{ if ne .Cluster.Environment "production" }}
1+
{{ if eq .Cluster.ConfigItems "kube_janitor_enabled" "true" }}
22
apiVersion: autoscaling.k8s.io/v1
33
kind: VerticalPodAutoscaler
44
metadata:

0 commit comments

Comments
 (0)