-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kubernetes no longer allows RW mounting of config maps #12
Comments
Hi @philosifer. It should work even with the k8s change. I don't think dex requires it to be rw. However I believe subpath mounts were temporarily broken in some k8s versions (1.8.8 iirc) which would cause the dex yaml to fail to work. |
I put the subpaths back in but still with the initcontainer intermediate step and it still works so i think its more to do with the config map than using subpaths. I'm on 1.10.2 btw. |
What error do you get with the Config map @philosifer? |
This is the error I get from kubectl describe pod if i don't do the initcontainer trick Error: failed to start container "dex": Error response from daemon: error setting label on mount source '/var/lib/kubelet/pods/b7f8be8b-65a8-11e8-a1a1-005056a6113c/volume-subpaths/dex-web-templates/dex/5': read-only file system That's repeated for a few of the other subpath mounts before it gives up and fails I've done some more investigating. I have two clusters, development which uses default settings for security and production on which i've set it to use certificates everywhere, https for etcd etc. I only see the read-only issue on the production cluster, it works fine as you wrote it on the dev cluster but i've no idea what exactly is causing that difference. Both are built with virtually identical kubeadm config files apart from the certificate lines added to the production setup. |
@totahuanocotl ping |
@philosifer, sorry for the late response. |
Yes I still have the issue but not much time to troubleshoot it further currently. It is also now affecting my attempt to redeploy harbor with helm (their issue #4496) and i might end up having to use the ReadOnlyAPIDataVolumes feature gate for now as i have too many places to put in workarounds for everything. |
Newer versions of K8S don't allow secrets or config maps to be mounted RW. I ran into a problem with the example dex yamls not starting because the web-templates were mounted RO not RW as expected. "kubectl describe pod" clearly showed the RO error in this case.
A workaround for this is to add an init container to copy the config map to an emptyDir store.
So in dex.yaml I added this volume
volumes:
- name: dex-web
emptyDir: {}
Then the init container
and then for the dex container you would replace the 7 web-template mounts with dex-web instead of dex-web-templates. For mine I just replaced them with this one
That let dex start up and work correctly as it did previously.
The text was updated successfully, but these errors were encountered: