Skip to content

Commit

Permalink
Storage labels: configurable extras
Browse files Browse the repository at this point in the history
Extra storage labels are now configurable through config.yaml and
`singleuser.storageExtraLabels`.
  • Loading branch information
consideRatio committed Sep 19, 2018
1 parent 84d2249 commit a95873b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions images/hub/jupyterhub_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
('node_selector', 'node-selector'),
):
set_config_if_not_none(c.KubeSpawner, trait, 'singleuser.' + cfg_key)
c.KubeSpawner.storage_extra_labels = get_config('singleuser.storage-extra-labels', {})

c.KubeSpawner.image_spec = get_config('singleuser.image-spec')
# Configure dynamically provisioning pvc
Expand Down
6 changes: 6 additions & 0 deletions jupyterhub/templates/hub/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,12 @@ data:
{{- range $key, $value := .Values.singleuser.extraLabels }}
{{ $key | quote }}: {{ $value | quote }}
{{- end }}
{{- if .Values.singleuser.storage.extraLabels }}
singleuser.storage-extra-labels: |
{{- range $key, $value := .Values.singleuser.storage.extraLabels }}
{{ $key | quote }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- if .Values.singleuser.extraEnv }}
singleuser.extra-env: |
{{- range $key, $value := .Values.singleuser.extraEnv }}
Expand Down
1 change: 1 addition & 0 deletions jupyterhub/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ singleuser:
serviceAccountName:
storage:
type: dynamic
extraLabels: {}
extraVolumes: []
extraVolumeMounts: []
static:
Expand Down
3 changes: 2 additions & 1 deletion tools/templates/lint-and-validate-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ singleuser:
- 169.254.169.254/32
events: true
extraLabels: {}
storageExtraLabels: {}
extraEnv: {}
lifecycleHooks:
initContainers:
Expand All @@ -188,6 +187,8 @@ singleuser:
serviceAccountName:
storage:
type: dynamic
extraLabels:
mock-label: mock-value
extraVolumes: []
extraVolumeMounts: []
static:
Expand Down

0 comments on commit a95873b

Please sign in to comment.