Skip to content

Commit 040c9bb

Browse files
authored
Merge pull request jupyterhub#1913 from minrk/cordon-option
image cleaner: expose option to control cordoning
2 parents 243fd34 + c81957f commit 040c9bb

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

helm-chart/binderhub/schema.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,13 +457,19 @@ properties:
457457
imageCleaner:
458458
type: object
459459
additionalProperties: false
460-
required: [enabled]
460+
required:
461+
- enabled
461462
properties:
462463
enabled:
463464
type: boolean
464465
description: |
465466
TODO
466467
image: *image-spec
468+
cordon:
469+
type: boolean
470+
description: |
471+
Whether to cordon the node while cleaning its images.
472+
Disable, e.g. for single-node clusters.
467473
delay:
468474
type: integer
469475
description: |
@@ -480,6 +486,12 @@ properties:
480486
type: integer
481487
description: |
482488
TODO
489+
extraEnv:
490+
type: [object, array]
491+
additionalProperties: true
492+
description: |
493+
see binderhub.deployment.extraEnv
494+
483495
host:
484496
type: object
485497
additionalProperties: false

helm-chart/binderhub/templates/image-cleaner.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,12 @@ spec:
4949
- name: socket-{{ $builderName }}
5050
mountPath: /var/run/docker.sock
5151
env:
52+
{{- if .Values.imageCleaner.cordon }}
5253
- name: DOCKER_IMAGE_CLEANER_NODE_NAME
5354
valueFrom:
5455
fieldRef:
5556
fieldPath: spec.nodeName
57+
{{- end }}
5658
- name: DOCKER_IMAGE_CLEANER_PATH_TO_CHECK
5759
value: /var/lib/{{ $builderName }}
5860
- name: DOCKER_IMAGE_CLEANER_DELAY_SECONDS
@@ -63,6 +65,9 @@ spec:
6365
value: {{ .Values.imageCleaner.imageGCThresholdHigh | quote }}
6466
- name: DOCKER_IMAGE_CLEANER_THRESHOLD_LOW
6567
value: {{ .Values.imageCleaner.imageGCThresholdLow | quote }}
68+
{{- with .Values.imageCleaner.extraEnv }}
69+
{{- include "jupyterhub.extraEnv" . | nindent 8 }}
70+
{{- end }}
6671
terminationGracePeriodSeconds: 0
6772
volumes:
6873
{{- if eq $builderName "host" }}

helm-chart/binderhub/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,11 +313,14 @@ pink:
313313

314314
imageCleaner:
315315
enabled: true
316+
extraEnv: {}
316317
image:
317318
name: quay.io/jupyterhub/docker-image-cleaner
318319
tag: "1.0.0-beta.3"
319320
pullPolicy: ""
320321
pullSecrets: []
322+
# whether to cordon nodes while cleaning
323+
cordon: true
321324
# delete an image at most every 5 seconds
322325
delay: 5
323326
# Interpret threshold values as percentage or bytes

0 commit comments

Comments
 (0)