host volumes from dind on kubernetes
https://files.mcaq.me/8919b.jpg
Here is the terraform:
https://hastebin.com/ipayakinex.nginx
Basically, I want the docker-compose file to, when run, correctly mount from the container, not host. This is not happening.
Any advice would be greatly appreciated :))
Hastebin: Send and Save Text or Code Snippets for Free | Toptal®
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
14 Replies
this is likely because your docker daemon is running in a sidecar
so it's mounting the
test
folder in the sidecar, not your workspaceYeah, that is what I thought. I think if I had access to the sysbox method, it would be fine, but I don't
Have you got any other suggetions? Maybe at this point I move away from k3s and try and find another lightweight k8s equivalent that can run sysbox
if you don't need to provision on >1 node you could just use docker to spawn workspaces
Can I get DIND to run in the same container by making a funky image?
unless this is a PoC for a larger k8s deploy
I don't right now - this is more me using this as an oppertunity to learn k8s
you can do dind if you make the workspace container privileged, instead of a sidecar
if that's acceptable
Yeah, that is acceptable for me
If it comes to running it in a bigger org, I won't have the k3s problem and I can use sysbox
(Which should work fine?)
Is there anything complicated to adding dind to the codercom enterprize image that I should know before I start googling?
yeah, sysbox is basically a wrapper around a privileged container to make it safer
i don't think dind is doing anything really special so it should work just fine on our image, if it doesn't work you can try taking something from here: https://github.com/docker-library/docker/blob/023a45d6e2a9009fdf01da87499c6f9ca6e27bef/23.0-rc/dind/Dockerfile
GitHub
docker/Dockerfile at 023a45d6e2a9009fdf01da87499c6f9ca6e27bef · doc...
Docker Official Image packaging for Docker. Contribute to docker-library/docker development by creating an account on GitHub.
Okay. Cheers :))
Hopefully sysbox + k3s support isn't too far away
Yeah your default image worked with a simple
sudo dockerd &
in the terraform init script.
Thanks for the helping hand. One step closer to getting this done :^)glad to hear! reach back out if you have any more questions 😃
It seems it is causing me problems when I try and run kind
I am not even sure what is causing this mounting problem...
https://github.com/kubernetes-sigs/kind/issues/303#issuecomment-518593664 I think I fixed it with this comment
GitHub
document how to run kind in a kubernetes pod · Issue #303 · kuberne...
NOTE: We do NOT recommend doing this if it is at all avoidable. We don't have another option so we do it ourselves, but it has many footguns. xref: #284 additionally these mounts are known ...