Coder Social home page Coder Social logo

Comments (10)

kokhang avatar kokhang commented on August 17, 2024 1

Hi Ivan, I work with @aramisjohnson. I got a question. Is there a way to use the docker.sock from the host in all the k8s nodes? That way, we can run whatever we need in a container with --net=host and not have the k8s nodes run with --net=host? Great project by the way!

from kubeadm-dind-cluster.

ivan4th avatar ivan4th commented on August 17, 2024 1

Thanks @kokhang . You may try editing the script (dind-cluster-v1.6.sh, the place is here) and adding -v /var/run/docker.sock:/var/run/outer-docker.sock. Then you can use export DOCKER_HOST=unix:///var/run/outer-docker.sock inside DIND containers to connect to the outer docker (If you're doing this from a pod, you'll also need to mount /var/run/outer-docker.sock into the pod using hostPath).

from kubeadm-dind-cluster.

ivan4th avatar ivan4th commented on August 17, 2024

Unfortunately I'm afraid it's not possible to set --net=host for docker containers that represent nodes. The problem is that every node must have it's own IP address, it's impossible to run several kubelets on single IP. Or did I misunderstand the question?.. Could you please describe what's the problem with rbd commands exactly?

from kubeadm-dind-cluster.

aramisjohnson avatar aramisjohnson commented on August 17, 2024

hmm... the problem is I am create a rook pod/cluster inside of v1.6 cluster but when I attempt to launch a pod that mounts a created block or filesystem volume it times out waiting for mount operation to complete. When I use just straight kubeadm, this starting a pod that consumes a block volume succeeds (not Dind). The only thing different I see between what your scripts do and kubeadm init does, is weave. Although I do see weave as an option for CNI_PLUGIN in your script, but my vm just hung create the k8s cluster. Im going to restore my vm from a snapshot and try it again, to see if I can get weave to work with the mirantis script.

from kubeadm-dind-cluster.

ivan4th avatar ivan4th commented on August 17, 2024

I didn't try Rook on DIND yet, it may be very well some deep Ceph-related issue. I'll definitely try it, although can't guarantee that I'll be able to do it quickly unfortunately. As of weave, it should work with 1.6, please try to do ./dind-cluster.sh clean before changing CNI_PLUGIN

from kubeadm-dind-cluster.

ivan4th avatar ivan4th commented on August 17, 2024

But frankly I doubt Weave will help wigh rook, to fix this it's necessary to look inside rook's pod

from kubeadm-dind-cluster.

ivan4th avatar ivan4th commented on August 17, 2024

Please try it and let me know whether it works, although I'm not quite sure how to add this functionality to the script myself because it's a bit exotic use of DIND.

from kubeadm-dind-cluster.

kokhang avatar kokhang commented on August 17, 2024

Thanks @ivan4th. This worked for me. I couldnt map the socke to /var/run/outer-docker.sock in the container node but i was able to map it to /opt/outer-docker.sock. I think this should unblock @aramisjohnson and not have to do net=host for rook.

from kubeadm-dind-cluster.

ivan4th avatar ivan4th commented on August 17, 2024

Glad it helped. I actually thought about adding a mechanism to access host docker socket from within containers, it can be useful for e.g. implementing flexvolume driver based on docker volumes (such volumes can be accessible from all nodes in DIND, with possibility to add minikube-like automatic provisioning later). Today I stumbled upon a problem in k8s flexvolume code though, it fails to unmount volumes mounted using mount --bind, so don't know whether this will make sense unless I fix flexvolume code in k8s....

from kubeadm-dind-cluster.

lukaszo avatar lukaszo commented on August 17, 2024

It looks like the issue is solved for now

from kubeadm-dind-cluster.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.