-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Projecting single files from volumes into a container's FS #19764
Comments
After some thought, I realize that if we do this, there's really no need for #19762 |
So the biggest issue with this is that updating a file atomically across a I'd love to see this be possible, so it is probably worth exploring, but I On Sat, Jan 16, 2016 at 11:37 AM, Paul Morie notifications@github.com
|
@pmorie thanks! another use-case we have is to add files like |
@thockin I think the update to secret content should trigger restart of the container where the secret is projected to. |
This is a point of debate for secrets. DownwardAPI already allows dynamic
|
Some applications expect configuration files directly in /etc. This would be useful for such cases. Yes, we need atomic updates for some cases. |
I think this is also solvable with pre-start hooks |
Apps that NEED it in /etc/foo.conf can provide an image that symlinks I'm not against this feature, I think it would be great, I just don't think On Thu, Jan 21, 2016 at 12:53 PM, Paul Morie notifications@github.com
|
Changing the image is actually a fairly involved process - the statement we On Fri, Jan 22, 2016 at 11:46 AM, Paul Morie notifications@github.com
|
I agree this would be a great feature, I don't think it is "a bit more On Fri, Jan 22, 2016 at 10:10 AM, Clayton Coleman notifications@github.com
|
A customer had a narrower problem which might have a more direct solution -- no sure if it is worthwhile. |
Options I see: a) do the really complicated process for updating a file-projection (enter b) document that single-file projections are not live-updatable c) document the (user-driven) workaround of making an image with d) unpack the volume image ourselves and reconstruct the parent dir and e) convince upstream kernels to support bind-mounting symlinks as symlinks On Fri, Feb 12, 2016 at 11:24 AM, Eric Tune notifications@github.com
|
I'm running into an issue right now where I'm trying to reuse an existing nodejs application which insists on reading a config.js file from it's application root directory. I was really hoping I could use a secret or configmap to inject the single config.js file and avoid "hiding" the application directory, but that does not work. So yeah, this would be a really nice feature. |
It is not sufficient or workable to build the image with the file being a symlink to an empty dir, and let secret or configmap mount into the dir? Not that I don't want this feature, but I want to see the f we can unblock people. |
I know that @derekwaynecarr also had this problem. openshift expects certs and config files to live next to each other in the same directory. Yes, his problem is 'solvable'/'work-arround-able' by creating a custom image with symlinks. But custom images come with their own pain when the original image is updated. |
It's fairly common to have secrets and config mixed (off hand I think
most Java app servers, some webservers, and lots of normal software
have the same directory). I suspect most people would just assume it
would work (that things would end up into the same location). I
suspect they'd be willing to accept one or the other "winning".
It's not the end of the world, but I suspect we'll have lots of users
using config map and secret hit this, then try to do an ugly
workaround.
|
@smarterclayton @eparis @thockin Why not have an all-in-one volume for this for the time being? |
The all-in-one was really ugly, I thought. I guess I am not really against it, it just feels clumsier than it should be. any other answer I have come up with is uglier, though. Still doesn't solve the as-a-file case. |
Does it? I could not figure out how. If I have an app that expects a config file in |
Well, it looks like I figured it out here dshulyak/kubernetes.github.io@d58ba7b but that was a lot harder to find than it should have been. |
getting @deitch's example into the ConfigMap docs would be nice. |
I'm using ployst/nginx-ssl-proxy which looks for all its secrets in command: ["/bin/sh", "-c", "ln -s /etc/auth/htpasswd /etc/secrets/htpasswd && ./start.sh" I wasn't able to mount the cert secrets to I ended up mounting both of my secrets to separate locations, then symlinking all the files I need: command: ["/bin/sh", "-c", "mkdir -p /etc/secrets && \
ln -s /etc/certs/dhparam /etc/secrets/dhparam && \
ln -s /etc/certs/proxycert /etc/secrets/proxycert && \
ln -s /etc/certs/proxykey /etc/secrets/proxykey && \
ln -s /etc/auth/htpasswd /etc/secrets/htpasswd && \
./start.sh" It's an unfortunate amount of jumping through hoops though. |
Bit of a theme.... |
facing same issue, any officially suggested workarounds for this problem? |
nm found it! |
This volumemount setup just injects agent.conf, and avoids mounting the entire /var/lib/juju/agents/application-tag/ directory. This way we don't lose the other things that juju puts in there. This setup doesn't allow kubernetes to update agent.conf when the ConfigMap changes, however, because of the way the mount works. See kubernetes/kubernetes#19764 (comment) Signed-off-by: Michael McCracken <mike.mccracken@canonical.com>
@debianmaster Care to share the official response that you found? |
Just spend several minutes searching for a solution, found it here: #23748 (comment) you need to supply the absolute path including the filename in the |
@schmitzhermes @fearphage sorry for not getting back. you have the right solution @schmitzhermes it wont work from cli though if you have more than 1 file to mount in the same directory. i.e. only works for 1 file |
This volumemount setup just injects agent.conf, and avoids mounting the entire /var/lib/juju/agents/application-tag/ directory. This way we don't lose the other things that juju puts in there. This setup doesn't allow kubernetes to update agent.conf when the ConfigMap changes, however, because of the way the mount works. See kubernetes/kubernetes#19764 (comment) Signed-off-by: Michael McCracken <mike.mccracken@canonical.com>
@schmitzhermes unfortunately, as I can see, configmap can't be updated when subPath is defined :( |
This is not specific to configmap but to any subpath projection.
…On Jul 2, 2017 5:37 AM, "Boyko Alexey" ***@***.***> wrote:
@schmitzhermes <https://github.com/schmitzhermes> unfortunately, as I can
see, configmap can't be updated when subPath is defined :(
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#19764 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFVgVC5eqQSuicV6-HuDwr88aDsC2D6wks5sJ48jgaJpZM4HGVRn>
.
|
I cry a little bit every time I hit this limitation. It's definitely one
of my top 10 usability issues for any complex pod (since a lot of Unix
software uses `/etc/` and we can't project into `/etc` without a hammer or
hacks.
On Sun, Jul 2, 2017 at 11:56 AM, Tim Hockin <notifications@github.com>
wrote:
… This is not specific to configmap but to any subpath projection.
On Jul 2, 2017 5:37 AM, "Boyko Alexey" ***@***.***> wrote:
> @schmitzhermes <https://github.com/schmitzhermes> unfortunately, as I
can
> see, configmap can't be updated when subPath is defined :(
>
> —
> You are receiving this because you modified the open/close state.
> Reply to this email directly, view it on GitHub
> <https://github.com/kubernetes/kubernetes/issues/
19764#issuecomment-312489424>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AFVgVC5eqQSuicV6-
HuDwr88aDsC2D6wks5sJ48jgaJpZM4HGVRn>
> .
>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#19764 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABG_p0oRjXomt9hR5NylVHVEYf6Xzyavks5sJ725gaJpZM4HGVRn>
.
|
@pmorie and I had sketched out a "merge" volume, but we'd need an ower
On Sun, Jul 2, 2017 at 7:38 PM, Clayton Coleman <notifications@github.com>
wrote:
… I cry a little bit every time I hit this limitation. It's definitely one
of my top 10 usability issues for any complex pod (since a lot of Unix
software uses `/etc/` and we can't project into `/etc` without a hammer or
hacks.
On Sun, Jul 2, 2017 at 11:56 AM, Tim Hockin ***@***.***>
wrote:
> This is not specific to configmap but to any subpath projection.
>
> On Jul 2, 2017 5:37 AM, "Boyko Alexey" ***@***.***> wrote:
>
> > @schmitzhermes <https://github.com/schmitzhermes> unfortunately, as I
> can
> > see, configmap can't be updated when subPath is defined :(
> >
> > —
> > You are receiving this because you modified the open/close state.
> > Reply to this email directly, view it on GitHub
> > <https://github.com/kubernetes/kubernetes/issues/
> 19764#issuecomment-312489424>,
> > or mute the thread
> > <https://github.com/notifications/unsubscribe-auth/AFVgVC5eqQSuicV6-
> HuDwr88aDsC2D6wks5sJ48jgaJpZM4HGVRn>
> > .
>
> >
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/kubernetes/kubernetes/issues/
19764#issuecomment-312500042>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/ABG_
p0oRjXomt9hR5NylVHVEYf6Xzyavks5sJ725gaJpZM4HGVRn>
> .
>
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#19764 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFVgVEz5ixnRvQura145oqjmnEX8fWYYks5sKFQdgaJpZM4HGVRn>
.
|
+1 cry every time,any plans for single file volume mapping? |
There are more feature requests than people to implement. ;(
…On Mon, Mar 26, 2018, 1:19 AM funlake ***@***.***> wrote:
+1 cry every time,any plans for single file volume mapping?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#19764 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFVgVPmOkoLAwJFnLl8PbjNClV0NOiyMks5tiKSlgaJpZM4HGVRn>
.
|
Any news? hit the same wall |
This becomes an even bigger issue when you widely enable restricted psps that don't allow for rootfs writes.... which we did last week. In this case I need to mount hostpath:/etc/machine-id into container:/etc/machine-id ... I clearly can't just replace container:/etc w/ hostpath:/etc |
I'd love to see this get worked on, but it needs an owner. I'm happy to reopen if someone wants to tackle it.. |
@thockin what would implementing this take? I saw you mention in one of the related issues that it's technically hard to do. |
This issue is to explore the possibility of allowing users to make projections of individual files from volumes into a container. Example use-case is where the user wants to place volume content into an existing directory without mounting over the existing contents of that directory. Example: say you want to project a file into
/etc/ssl/certs
without making the other files in that directory inaccessible.@mfojtik This is your use-case -- feel free to elaborate.
@thockin @smarterclayton @bgrant0607 @saad-ali @kubernetes/rh-storage
The text was updated successfully, but these errors were encountered: