Skip to content

Commit

Permalink
Merge pull request #1913 from minrk/cordon-option
Browse files Browse the repository at this point in the history
image cleaner: expose option to control cordoning
  • Loading branch information
yuvipanda authored Jan 23, 2025
2 parents 243fd34 + c81957f commit 040c9bb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
14 changes: 13 additions & 1 deletion helm-chart/binderhub/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -457,13 +457,19 @@ properties:
imageCleaner:
type: object
additionalProperties: false
required: [enabled]
required:
- enabled
properties:
enabled:
type: boolean
description: |
TODO
image: *image-spec
cordon:
type: boolean
description: |
Whether to cordon the node while cleaning its images.
Disable, e.g. for single-node clusters.
delay:
type: integer
description: |
Expand All @@ -480,6 +486,12 @@ properties:
type: integer
description: |
TODO
extraEnv:
type: [object, array]
additionalProperties: true
description: |
see binderhub.deployment.extraEnv
host:
type: object
additionalProperties: false
Expand Down
5 changes: 5 additions & 0 deletions helm-chart/binderhub/templates/image-cleaner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ spec:
- name: socket-{{ $builderName }}
mountPath: /var/run/docker.sock
env:
{{- if .Values.imageCleaner.cordon }}
- name: DOCKER_IMAGE_CLEANER_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
{{- end }}
- name: DOCKER_IMAGE_CLEANER_PATH_TO_CHECK
value: /var/lib/{{ $builderName }}
- name: DOCKER_IMAGE_CLEANER_DELAY_SECONDS
Expand All @@ -63,6 +65,9 @@ spec:
value: {{ .Values.imageCleaner.imageGCThresholdHigh | quote }}
- name: DOCKER_IMAGE_CLEANER_THRESHOLD_LOW
value: {{ .Values.imageCleaner.imageGCThresholdLow | quote }}
{{- with .Values.imageCleaner.extraEnv }}
{{- include "jupyterhub.extraEnv" . | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: 0
volumes:
{{- if eq $builderName "host" }}
Expand Down
3 changes: 3 additions & 0 deletions helm-chart/binderhub/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -313,11 +313,14 @@ pink:

imageCleaner:
enabled: true
extraEnv: {}
image:
name: quay.io/jupyterhub/docker-image-cleaner
tag: "1.0.0-beta.3"
pullPolicy: ""
pullSecrets: []
# whether to cordon nodes while cleaning
cordon: true
# delete an image at most every 5 seconds
delay: 5
# Interpret threshold values as percentage or bytes
Expand Down

0 comments on commit 040c9bb

Please sign in to comment.