Skip to content

Commit 28bfbf4

Browse files
committed
Try defining volumes and volume mounts as dict
1 parent f50e5a5 commit 28bfbf4

File tree

1 file changed

+47
-47
lines changed

1 file changed

+47
-47
lines changed

config/clusters/maap/staging.values.yaml

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ jupyterhub:
4444
- name: home
4545
mountPath: /home/jovyan/shared-group
4646
subPath: _shared-group
47+
storage:
48+
type: null
4749

4850
profileList:
4951
- display_name: Choose your environment and resources
@@ -229,6 +231,51 @@ jupyterhub:
229231
config:
230232
JupyterHub:
231233
authenticator_class: generic-oauth
234+
KubeSpawner:
235+
volumes:
236+
00-home-nfs:
237+
name: home
238+
persistentVolumeClaim:
239+
claimName: home-nfs
240+
01-dev-shm:
241+
name: dev-shm
242+
emptyDir:
243+
medium: Memory
244+
volume_mounts:
245+
00-home-nfs:
246+
name: home
247+
mountPath: /home/jovyan
248+
subPath: "{escaped_username}"
249+
01-home-shared:
250+
name: home
251+
mountPath: /home/jovyan/shared
252+
subPath: _shared
253+
readOnly: true
254+
02-home-shared-public:
255+
name: home
256+
mountPath: /home/jovyan/shared-public
257+
subPath: _shared-public
258+
03-dev-shm:
259+
name: dev-shm
260+
mountPath: /dev/shm
261+
group_overrides:
262+
00-group-CPU-L-extra-volume-mounts:
263+
groups: ["CPU:L"]
264+
spawner_override:
265+
volume_mounts:
266+
00-group-CPU-L-shared-dir:
267+
name: home
268+
mountPath: /home/jovyan/shared-group/CPU_L
269+
subPath: _shared-group/CPU_L
270+
01-group-GPU-T4-extra-volume-mounts:
271+
groups: ["GPU:T4"]
272+
spawner_override:
273+
volume_mounts:
274+
00-group-GPU-T4-shared-dir:
275+
name: home
276+
mountPath: /home/jovyan/shared-group/GPU_T4
277+
subPath: _shared-group/GPU_T4
278+
232279
Authenticator:
233280
admin_users: []
234281
GitHubOAuthenticator:
@@ -261,53 +308,6 @@ jupyterhub:
261308
- CPU:XXL
262309
- CPU:XXXL
263310
- GPU:T4
264-
extraConfig:
265-
00-volumes-and-volume-mounts-as-dict: |
266-
# The base jupyterhub config in zero-to-jupyterhub defines
267-
# volumes and volume_mounts as lists.
268-
# But we can't add new volumes or volume_mounts to the list
269-
# as that replaces the entire list.
270-
# So we convert them to dictionaries, which allows us to
271-
# add new volumes and volume_mounts as needed.
272-
if isinstance(c.KubeSpawner.volumes, list):
273-
existing_volumes = c.KubeSpawner.volumes
274-
c.KubeSpawner.volumes = {}
275-
for volume in existing_volumes:
276-
c.KubeSpawner.volumes[volume["name"]] = volume
277-
if isinstance(c.KubeSpawner.volume_mounts, list):
278-
existing_volume_mounts = c.KubeSpawner.volume_mounts
279-
c.KubeSpawner.volume_mounts = {}
280-
for idx, volume_mount in enumerate(existing_volume_mounts):
281-
c.KubeSpawner.volume_mounts[f"{idx}-{volume_mount['name']}"] = volume_mount
282-
01-group-shared-directories: |
283-
c.KubeSpawner.group_overrides = {
284-
"00-group-CPU-L-extra-volume-mounts": {
285-
"groups": ["CPU:L"],
286-
"spawner_override": {
287-
"volume_mounts": {
288-
"00-group-CPU-L-shared-dir": {
289-
"name": "home",
290-
"mountPath": "/home/jovyan/shared-group/CPU_L",
291-
"subPath": "_shared-group/CPU_L",
292-
"readOnly": False
293-
},
294-
}
295-
},
296-
},
297-
"01-group-GPU-T4-extra-volume-mounts": {
298-
"groups": ["GPU:T4"],
299-
"spawner_override": {
300-
"volume_mounts": {
301-
"00-group-GPU-T4-shared-dir": {
302-
"name": "home",
303-
"mountPath": "/home/jovyan/shared-group/GPU_T4",
304-
"subPath": "_shared-group/GPU_T4",
305-
"readOnly": False
306-
},
307-
}
308-
},
309-
}
310-
}
311311
ingress:
312312
hosts: [staging.hub.maap.2i2c.cloud]
313313
tls:

0 commit comments

Comments
 (0)