Closed Tristan971 closed 3 years ago
Thanks for your detailed question! That's a tricky situation, but your workaround seems like a good solution to me. You could even simplify it a bit, perhaps, by simply overriding this image's entrypoint. I'm not a k8s expert but I think it would look something like this:
spec:
containers:
- name: nfs-server
image: erichough/nfs-server
...
command:
- /bin/bash
- -c
- 'while [[ ! -f /nfs/.ready ]]; do sleep 5; done; exec /usr/local/bin/entrypoint.sh
That way, there'd be no need to extend/fork this image. Thoughts?
In the spirit of keeping this image as lean as possible, I'm going to decline incorporating this type functionality into the base image (for now, anyway). Closing this issue but let's keep the discussion going, if you'd like.
Hi, I feel a bit silly not doing that from the get go now!
Thanks for reply and agreed on keeping the image lean! 👍
Hello, thanks for this project first,
I plan to use it on a kubernetes cluster to share a volume (obviously) across pods, and ran into a small issue that might be addressable.
Situation
Here's the layout of the containers I want to run on a given host
The problem
I want the
exports-filler
container to start and finish initializing itself (successfully) before thenfs-server
starts (or at least boots up the whole exports setup)Turns out k8s doesn't have a feature to order containers within a pod (I know, I also assumed it would support this),
So I can't say "start
exports-filler
, wait for it to be up, then startnfs-server
"(N.B.:
initContainers
don't cut it in this case becauseexports-filler
won't/mustn't complete, as it syncs with an upstream provider all the time)Workaround
I made a quick workaround here for now, which involves:
app
container drop it in the exports when it's done doing what it mustSample (naive) implementation here: https://github.com/ehough/docker-nfs-server/compare/develop...Tristan971:support-awaiting-for-exports-readiness?expand=1
First, is it something you might want to support in this? And if so, any idea of nicer ways to go about it? (I'm totally ok with doing the implementation, for what it's worth)
Thanks