k3s-io / k3s-ansible

Apache License 2.0
2.01k stars 802 forks source link

Support of multiple cluster? #286

Closed SamLue closed 8 months ago

SamLue commented 8 months ago

Is it possible to manage multiple k3s cluster?

If I define the following inventory: cluster1: children: server: hosts: 192.168.1.1 vars: k3s_version: v1.29.0+k3s1 token: ### ... cluster2: children: server: hosts: 192.168.1.2 192.168.1.3 vars: k3s_version: v1.29.0+k3s1 token: ### ...

In var groups['server'] all servers of all cluster-definitions are listed and not only the server from this specific cluster. Do I use it in a wrong way? Or is the management of muiltiple clusters nor supported yet?

SamLue commented 8 months ago

Here is a link to the inventory.yaml with correct format: https://pastebin.com/raw/sTq5hZzC

At the moment my workaround I see is to use different inventory-files. But that's not the best choice in my use case.

dereknola commented 8 months ago

Management of different clusters within a single inventory is not supported. The intention is only to quickly setup 1 cluster. Having multiple inventory files would be the intended way to manage multiple clusters.