File tree Expand file tree Collapse file tree 6 files changed +40
-5
lines changed Expand file tree Collapse file tree 6 files changed +40
-5
lines changed Original file line number Diff line number Diff line change @@ -1170,7 +1170,24 @@ control_plane_load_balancer_internal: "none"
1170
1170
# fs.inotify.max_user_watches = 100000
1171
1171
sysctl_settings : " "
1172
1172
1173
-
1173
+ # kube-janitor configuration
1174
+ {{if eq .Cluster.Environment "production"}}
1175
+ # This makes kube-janitor opt-in for production clusters
1176
+
1177
+ # IMPORTANT:
1178
+ # Please note that before enabling kube-janitor for a production cluster, you
1179
+ # must ensure that no existing resources should be annotated with a TTL.
1180
+ # This can happen in the case where a test deployment is deployed to production
1181
+ # as is. Currently, it's a no-op since kube-janitor doesn't run in production.
1182
+ #
1183
+ # This is needed until we can implement namespace prefix matching to reduce
1184
+ # the scope of kube-janitor to a set of namespace names that aren't known
1185
+ # at the time of enaling kube-janitor. Once the feature is in place, it would
1186
+ # be easier to limit the scope.
1187
+ kube_janitor_enabled : " false"
1188
+ {{else}}
1189
+ kube_janitor_enabled : " true"
1190
+ {{end}}
1174
1191
1175
1192
# scheduling_controls
1176
1193
teapot_admission_controller_scheduling_controls_enabled : " false"
Original file line number Diff line number Diff line change @@ -330,3 +330,21 @@ post_apply:
330
330
kind : ServiceAccount
331
331
namespace : kube-system
332
332
{{- 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 }}
Original file line number Diff line number Diff line change 1
- # {{ if ne .Cluster.Environment "production " }}
1
+ # {{ if eq .Cluster.ConfigItems.kube_janitor_enabled "true " }}
2
2
# {{ $image := "container-registry.zalando.net/teapot/kube-janitor:23.7.0-main-2" }}
3
3
# {{ $version := index (split (index (split $image ":") 1) "-") 0 }}
4
4
apiVersion : apps/v1
Original file line number Diff line number Diff line change 1
- {{ if ne .Cluster.Environment "production " }}
1
+ {{ if eq .Cluster.ConfigItems.kube_janitor_enabled "true " }}
2
2
apiVersion : v1
3
3
kind : ServiceAccount
4
4
metadata :
Original file line number Diff line number Diff line change 1
- # {{ if ne .Cluster.Environment "production " }}
1
+ # {{ if eq .Cluster.ConfigItems.kube_janitor_enabled "true " }}
2
2
apiVersion : v1
3
3
kind : ConfigMap
4
4
metadata :
Original file line number Diff line number Diff line change 1
- {{ if ne .Cluster.Environment "production " }}
1
+ {{ if eq .Cluster.ConfigItems.kube_janitor_enabled "true " }}
2
2
apiVersion : autoscaling.k8s.io/v1
3
3
kind : VerticalPodAutoscaler
4
4
metadata :
You can’t perform that action at this time.
0 commit comments