-
Notifications
You must be signed in to change notification settings - Fork 38.9k
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
ConfigMaps and Secrets mounted with subPath do not update when changed #50345
Comments
/sig storage |
Yes, symlinks are involved. Atomic writer relies on symlinks to update configmaps, secrets and such: https://github.com/kubernetes/kubernetes/blob/master/pkg/volume/util/atomic_writer.go. On the host, the pod volume directory looks something like this:
When you subPath the secret file, that secret.json file is bind mounted into the container. But secret.json is actually a symlink to another secret.json in a timestamped folder (..8988_09_08_14_21_15.788262705). When the secret gets updated, the symlinks get changed around but the file bind mounted into the container remains the same. Not sure what the solution is. Hope this helps somebody else think of one though :) e: Disregarding the symlinking complexity of the atomic writer algorithm for the moment...the tool we have to atomically update the file is a rename, in that case is a solution even possible? The bind mount file will always refer to the same inode yes? |
@thesandlord Maybe your use case is Add ConfigMap data to a specific path in the Volume. I follow the documentation, and it works as expected.
My pod.yaml:
|
@supereagle that is not the same thing. sometimes you want to merge in a few config files into a magic config dir, like, /etc/condor/config.d, but leave the rest of the dir open for other things to drop things in. subPath is the right way to do that I think. but should be able to get updates still. |
Bump |
Any update for this issue?
|
cc @kubernetes/sig-storage-bugs |
@maeb do you see this getting done in the next 5 days for 1.10? |
This issue and its related PRs will be removed from 1.10 at Code Freeze on Monday, unless they are all updated with status/approved-for-milestone and with a progress update. If that's fine, do nothing; if you are still targeting 1.10, please let us know what's going on and update the labels. Thanks! |
As a reminder, this issue is about to be kicked out of 1.10 tracking in 6 hours, because it doesn't have the required labels. If this is actually an 1.10 issue, please update it! @maeb @thesandlord |
I think we just need to document this as a known limitation. Because subpaths are bind mounted by docker, if it was a symlink, then it gets resolved to the actual path during the bindmount. |
/assign |
Changes to configmaps are not propagated when the configmap is mounted via subPath. We can work around this but it would require changes to the async storage server image. See issue kubernetes/kubernetes#50345 for more details. Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Changes to configmaps are not propagated when the configmap is mounted via subPath. We can work around this but it would require changes to the async storage server image. See issue kubernetes/kubernetes#50345 for more details. Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Changes to configmaps are not propagated when the configmap is mounted via subPath. We can work around this but it would require changes to the async storage server image. See issue kubernetes/kubernetes#50345 for more details. Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Changes to configmaps are not propagated when the configmap is mounted via subPath. We can work around this but it would require changes to the async storage server image. See issue kubernetes/kubernetes#50345 for more details. Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Changes to configmaps are not propagated when the configmap is mounted via subPath. We can work around this but it would require changes to the async storage server image. See issue kubernetes/kubernetes#50345 for more details. Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Changes to configmaps are not propagated when the configmap is mounted via subPath. We can work around this but it would require changes to the async storage server image. See issue kubernetes/kubernetes#50345 for more details. Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Changes to configmaps are not propagated when the configmap is mounted via subPath. We can work around this but it would require changes to the async storage server image. See issue kubernetes/kubernetes#50345 for more details. Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Changes to configmaps are not propagated when the configmap is mounted via subPath. We can work around this but it would require changes to the async storage server image. See issue kubernetes/kubernetes#50345 for more details. Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Changes to configmaps are not propagated when the configmap is mounted via subPath. We can work around this but it would require changes to the async storage server image. See issue kubernetes/kubernetes#50345 for more details. Signed-off-by: Angel Misevski <amisevsk@redhat.com>
- Don't use subpath field when mounting to the RamenConfig configuration map, which is known to not refresh within the pod. kubernetes/kubernetes#50345 (comment) Code contributed by Shyam Ranganathan Signed-off-by: Veera Deenadhayalan <vdeenadh@redhat.com>
- Don't use subpath field when mounting to the RamenConfig configuration map, which is known to not refresh within the pod. kubernetes/kubernetes#50345 (comment) Thanks to Shyam Ranganathan for contributing this change. Signed-off-by: Veera Deenadhayalan <vdeenadh@redhat.com>
- Don't use subpath field when mounting to the RamenConfig configuration map, which is known to not refresh within the pod. kubernetes/kubernetes#50345 (comment) Thanks to Shyam Ranganathan for contributing this change. Signed-off-by: Veera Deenadhayalan <vdeenadh@redhat.com>
- Don't use subpath field when mounting to the RamenConfig configuration map, which is known to not refresh within the pod. kubernetes/kubernetes#50345 (comment) Thanks to Shyam Ranganathan for contributing this change. Signed-off-by: Veera Deenadhayalan <vdeenadh@redhat.com>
- Don't use subpath field when mounting to the RamenConfig configuration map, which is known to not refresh within the pod. kubernetes/kubernetes#50345 (comment) Thanks to Shyam Ranganathan for contributing this change. Signed-off-by: Veera Deenadhayalan <vdeenadh@redhat.com>
- Don't use subpath field when mounting to the RamenConfig configuration map, which is known to not refresh within the pod. kubernetes/kubernetes#50345 (comment) Thanks to Shyam Ranganathan for contributing this change. Signed-off-by: Veera Deenadhayalan <vdeenadh@redhat.com>
- Don't use subpath field when mounting to the RamenConfig configuration map, which is known to not refresh within the pod. kubernetes/kubernetes#50345 (comment) Thanks to Shyam Ranganathan for contributing this change. Signed-off-by: Veera Deenadhayalan <vdeenadh@redhat.com>
- Don't use subpath field when mounting to the RamenConfig configuration map, which is known to not refresh within the pod. kubernetes/kubernetes#50345 (comment) Thanks to Shyam Ranganathan for contributing this change. Signed-off-by: Veera Deenadhayalan <vdeenadh@redhat.com>
- Don't use subpath field when mounting to the RamenConfig configuration map, which is known to not refresh within the pod. kubernetes/kubernetes#50345 (comment) Thanks to Shyam Ranganathan for contributing this change. Signed-off-by: Veera Deenadhayalan <vdeenadh@redhat.com>
/kind bug
What happened:
I wanted to mount a ConfigMap and a Secret directly as a file and didn't want to mount it as a full directory, so I used subPath to do so:
When the pod is created, it mounts the ConfigMap and Secret correctly. However, if I change them, the updates are not projected into the currently running pods. New pods get the updated file. According to the documentation, changes to a ConfigMap should be automatically propagated to running containers that mount them.
However, if I don't use subPath and instead mount the ConfigMap and Secret as a directory:
Then the files are updated inside the container when the underlying ConfigMap and Secret are updated and everything works as expected.
Anything else we need to know?:
In both cases, the files are being updated on the host VM. @kelseyhightower and I tried to debug this, and the only conclusion we could come up with is that subPath is using a different method to mount the files (I think it is using symlinks), and these either aren't or can't be updated for whatever reason.
Action:
The behavior that files mounted with subPath don't get updated needs to be documented, or it needs to be fixed so that subPath mounts are updated when the underlying ConfigMap or Secret changes.
Environment: GKE
kubectl version
): 1.6.7uname -a
): 4.4.52+The text was updated successfully, but these errors were encountered: