jupyterhub / zero-to-jupyterhub-k8s

Helm Chart & Documentation for deploying JupyterHub on Kubernetes
https://zero-to-jupyterhub.readthedocs.io
Other
1.51k stars 789 forks source link

Failing to override volume_mounts with readOnly set to True #1371

Closed fersarr closed 4 years ago

fersarr commented 4 years ago

I am trying to use kubespawner_override to mount a volume with readOnly set to true. But I cannot seem to get it right after trying different possibilities:

c.KubeSpawner.profile_list.append({
    'kubespawner_override': {
        'volumes': [
            {
                'name': 'mytest',
                'hostPath': {
                    'path': '/my/path',
                    'type': 'Directory',
                    'readOnly': 'true' # tried True, 'true', 1, etc.
                }
            }
        ],
        volume_mounts: [
            {
                'name': 'mytest',
                'mountPath': '/my/path',
            }
        ]
    }
})

readOnly is one of the options mentioned in the kubernetes docs

According to kubespawner_override docs, these options are passed to kubernetes but how exactly should this be done?

The error I keep getting is:

spec.containers[0].volumeMounts[1].readOnly: Invalid value: false: must be read-only

Indicating that the True value is not being set.

fersarr commented 4 years ago

Hm, this might not be the correct place for this issue, I created it again in the kubespawner repo: https://github.com/jupyterhub/kubespawner/issues/344

Feel free to delete it if that's the case. Sorry