Closed fersarr closed 5 years ago
In the docs you linked readOnly
is under volumeMounts
not volumes
, does that make a difference?
You are absolutely right! it made all the difference! Sorry and Thank you!
it worked by using:
'volume_mounts': [
{
'mountPath': '/mytest',
'name': 'mytest',
'readOnly': True
},
more details regarding the bug - KubeSpawner is based on kubernetes_asyncio specification. I checked their docs and it has this difference:
https://kubernetes-asyncio.readthedocs.io/en/latest/kubernetes_asyncio.client.models.v1_volume_mount.html - has read_only
https://kubernetes-asyncio.readthedocs.io/en/latest/kubernetes_asyncio.client.models.v1_volume.html - no read_only
Even when Kube API supports read_only
in both interfaces, with this package it only works for volume_mount
attribute.
I am trying to use
kubespawner_override
to mount a volume withreadOnly
set totrue
. But I cannot seem to get it right after trying different possibilities: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:
Indicating that the
True
value is not being set.