So currently I generate my Talos configs via Terraform, but tbh that system is a bit more brittle than I'd like.

The idea was I could integrate the Talos config generation with other terraform, but in practice, no not really viable for my setup.

I don't trust terraform to not explode the rook cluster in particular

What do people like for templating Talos configs? Talm? Talhelper?
#HomeLab #Kubernetes #Talos
Introduction - The Cluster API Book

@praxiscode @rachel Is it possible to adopt a cluster into cluster-api post install? That's what I can't seem to figure out.

(Background, I would love to see my cluster being managing itself through cluster API similar to how OpenShift does it.)

Adopting an existing cluster post-deploy into Cluster API is an exercise in tedium.

You have to manually create *all* of the CAPI objects, while keeping them paused (.spec.paused: true), including all of the interconnecting bits (owners, including their UIDs, etc). You have to create all of the associated secrets, machine objects, (provider)machine objects, (provider)machinetemplate, etc etc etc.

So, technically doable, but not fun at all.

(1/N)

@sheogorath @rachel

Last year I accidentally destroyed my CAPI cluster, and had to rebuild and adopt in my current clusters. The approach that worked was to extract the necessary secrets from the existing cluster and create those objects, then I provisioned a new control plane. I had to set the IPAM address range not to re-use the existing node IPs. I also set the TalosControlPlane object's status to indicate that it had already been initialized, so it wouldn't create a new etcd.

(2/N)

@sheogorath @rachel

The first control plane node joined the existing control plane cluster, then took it over. The subsequent control plane nodes joined right in. Since the secrets had been populated from the existing cluster, the worker nodes just carried right along. I decommed the old CP nodes, then spun up all-new workers with CAPI, and drained/shut down the old workers, migrating all the services to the new nodes.

Much less tedious that way.

(3/3)

@sheogorath @rachel

All that said, CAPI includes commands to migrate existing CAPI cluster objects to a new cluster.

See: clusterctl move

https://cluster-api.sigs.k8s.io/clusterctl/commands/move

See also, "Bootstrap & Pivot" on the same page.

@sheogorath @rachel

move - The Cluster API Book