-
Notifications
You must be signed in to change notification settings - Fork 35
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
Running with Nomad inside containerd #126
Comments
@the-maldridge Do you have a job spec? |
Ask and ye shall receive:
|
@the-maldridge Works fine for me!
Logs from Nomad
Nomad alloc logs
|
Yes I expect on an un-namespaced system it would. They key point of my question though is that nomad is itself running under containerd in an isolated mount namespace. I want to know what paths from the host I need to map for nomad to be able to use the containerd driver. |
@the-maldridge I am not sure if I completely follow your question. When you say What do you mean by
|
That's fair, this is a slightly unorthodox environment and I haven't really explained it that well. In my environment I am using linuxkit/linuxkit to build my machine images, and this means that the init and supervision system at the OS layer is containerd. This means that nomad is itself a task being started and managed by containerd with filesystem isolation. What I want to do is use the containerd-driver to have nomad interact with the host containerd in much the same way that binding the docker socket into a container allows that container to start additional docker containers on the host. So to recap, what I have is:
And what I want to do is be able to do this:
To do this with a dockerd that's running adjacent to nomad I bind the following paths to Nomad's mount namespace:
The important paths for the docker driver are Hopefully that makes sense, but please don't hesitate to ask if there's more information I can provide. |
@the-maldridge Why not run This way your |
Hmm, my apologies as it seems I had not clearly communicated how this was configured. Nomad is running as a containerd container already, and has access to the containerd on the host. However, like all containerd containers, there is default file system isolation which means there are going to be some directories that nomad needs to be able to share between its namespace and the namespace that the host containerd is going to want to bind in. Mostly this is the data directory that contains all the alloc subdirectories, but it seemed like the nomad driver wanted to use things in I can crawl the code if the answer to "what directories does the containerd driver need to use" is "we don't know" but I'd hoped for an easy answer to this problem. |
I don't think
The error you posted seems to be coming from Most container supervisors (e.g. containerd) setup a block device (and a file system on top of that) which is mounted somewhere on the host, and when your container process is started, your container PID1 will be I would put a |
@the-maldridge did you make this working? with host network its working for me - I am sharing below directories with the host. BUT when I try with "bridge" network I get some weird errors. Here is linuxkit yml for nomad
This is my nomad config, otherwise I run with
Here is my jobspec (if you just change bridge network to host (or without network), it just work fine, and I could see it create the redis container in containerd and redis work there. BUT with below job spec I get error while starting container.
With no network or with host network it just work and I can see containerd create a new containerd namespace called "nomad" and run the containers within that namespace.
Containerd has the container running
BUT when I use above job spec with "bridge" network, I can see nomad talk to CNI and get the bridge and get the IP from it and all, BUT when it try to create the container, it just errorout for some reason. BTW in case of containerd, the nomad containerd driver does mostly everything like talking to CNI, getting IP, preparing the files for container etc, and containerd is just to run them which is different from docker. here is nomad alloc status says - it shows the error
Below are from nomad logs nomad get the request
It talked to CNI and get the stuffs done and get the IP and other details back from it, and it prepared the direcotories etc.
Now the driver starting the container
BTW in containerd, setting up the container including starting the container (environment), and running the processes inside that container are different steps - starting the container environment is successful as seen above, BUT starting the task (process) inside the container i.e actually starting it failed.
At the same time, I am NOT getting lot of useful information from containerd on why it is failing. BTW this is from console, so some of the logs are mixed Here is what is seen when the CNI create stuffs there
Now containerd got the reaquest to start the container
Now here is what we see next - if you see below - directly it shows "failed to delete task" - where are the logs attempting starting the task? Maybe its not reaching to containerd somehow, need to see whats happening on the containerd driver
|
I'm interested in supporting this driver within the ResinStack distribution that I have developed for a more readily deployable version of the nomad ecosystem. In this environment I have nomad itself running as a containerd task, and I'm trying to work out either what needs to be mounted in, or if I can change the mount paths. Right now I'm hung up on this error and would appreciate advice:
/tmp from the host is available to the container, so I'm not really sure what's wrong here.
The text was updated successfully, but these errors were encountered: