K3d: [FEATURE] Ability to create node, and add it to already existing cluster, on other computer

Created on 12 Jun 2020  路  5Comments  路  Source: rancher/k3d

Scope of your request

Ability to create node, and add it to already existing cluster, on other computer.

Describe the solution you'd like

When I create cluster via k3d/k3s, I would like to be able to add workers to it, from other computers, using k3d ( So that workers will be inside docker containers ).

enhancement

Most helpful comment

I get your use-case. I wouldn't really recommend using k3d for such a "production-like" use-case due to its limitations introduced by the additional docker layer. You will always hit limitations like wanting to expose additional ports after creating the cluster/nodes, etc.
Since you're planning to run one k3d node per physical host, it could actually work network-wise, because you can simply create the nodes with --network host and have them act like any other process on your host machine (network-wise) :+1:

You're right, that this was possible with k3d v1.x, because there we didn't have auto-detection of existing k3d clusters and supporting such use-cases was not really in scope back then.
But I also like the use case and I think this could land in v3.1.0 :+1:

Apart from that, there's an example docker-compose file in the k3s repo, that you could adjust to your needs (https://github.com/rancher/k3s/blob/master/docker-compose.yml).

All 5 comments

Hi @zewelor , thanks for opening this feature request.
Can you describe your use-case, what you want to achieve?
k3d is mostly meant for local development on and with Kubernetes, so possibly this is rather a use-case for plain k3s?

Hi

Thanks for reply !

I was thinking about building some home cluster, with devices like qnap ( there is docker support but adding custom software is somehow limited ), some rpi with kodi only distibution ( there is docker addon, but adding some other custom software is rather hard ). Maybe my desktop ( which I would prefer to keep "clean" so some worker inside docker would be nice ).

I had impression ( from reading issues for versions < 3.x) that its supported, now I see its not longer valid for 3.x.

I could setup master on plain k3s, but workers on docker would be really good. Maybe as you wrote in other comment, doing master in docker and connecting to it from other dockerized workers is too complicated. So maybe plain k3s as master, with dockerized k3s workers ? Or maybe I should look for other solution ? Or maybe i should skip k3d and use https://hub.docker.com/r/rancher/k3s/tags ?

I get your use-case. I wouldn't really recommend using k3d for such a "production-like" use-case due to its limitations introduced by the additional docker layer. You will always hit limitations like wanting to expose additional ports after creating the cluster/nodes, etc.
Since you're planning to run one k3d node per physical host, it could actually work network-wise, because you can simply create the nodes with --network host and have them act like any other process on your host machine (network-wise) :+1:

You're right, that this was possible with k3d v1.x, because there we didn't have auto-detection of existing k3d clusters and supporting such use-cases was not really in scope back then.
But I also like the use case and I think this could land in v3.1.0 :+1:

Apart from that, there's an example docker-compose file in the k3s repo, that you could adjust to your needs (https://github.com/rancher/k3s/blob/master/docker-compose.yml).

Thanks for thorough explanation. I will try with docker-compose example from k3s repo.

Hi there - i'd like to add a little context to this request as i have a similar requirement. Current setup is a cluster of raspberrypis (4 node k3s) as my main cluster which works fantastically well for 95% of the time - the trouble is i need an x86 node for certain images / tasks. Instead of having to purchase another SBC that maybe inferior to what i have i'd like to be able to add a k3d node through my iMac / a.n.other machine and use the architecture label to distribute specific x86 tasks to that node.

Been following the enhancement progress on this and would be very grateful for this to be added!

Many thanks.

Was this page helpful?
0 / 5 - 0 ratings