The cluster in CoreOS is managed by fleet, and if you want to see how, look under the 'hidden' etcd
key /_coreos.com/fleet
$ etcdctl ls /_coreos.com/fleet
/_coreos.com/fleet/machines
/_coreos.com/fleet/engine
/_coreos.com/fleet/lease
/_coreos.com/fleet/unit
/_coreos.com/fleet/job
/_coreos.com/fleet/state
/_coreos.com/fleet/states
If you could somehow change the key prefix used by fleet, then you should be able to have separate clusters using the same etcd.
The cloud-config section for fleet does support this via the etcd_key_prefix
setting. By default this is /_coreos.com/fleet/
so set this to a similar sort of value with a leading and trailing slash and you should be good to go.
I've not tried this, but I'd be interested to hear whether this works for you. If the cloud-config setting works, then each machine should have a configuration in something like /run/systemd/system/fleet.service.d/20-cloudinit.conf
which includes a FLEET_ETCD_KEY_PREFIX
environment variable. Then, you should be able to use etcdctl
to view the key and verify fleetctl
operations are working.