siderolabs / cluster-api-bootstrap-provider-talos

A cluster-api bootstrap provider for deploying Talos clusters.
https://www.talos-systems.com
Mozilla Public License 2.0
111 stars 28 forks source link

allow variables in config patches #96

Open smira opened 3 years ago

smira commented 3 years ago

e.g. we could have used machine name as machine's hostname

alternatively, this could be just a feature enabled in the spec

dimatha commented 2 years ago

That would be perfect!

If I understand it right, there is no way as of now to get the machine name from CAPI and set it on the Talos node(s)?

smira commented 2 years ago

well, that depends on the infrastructure provider in general - e.g. on AWS VM name will match Machine name, but hostname will be different (driven by AWS cloud controller logic).

on bare-metal (with Sidero) there's no way to push machine name down to the host.

dimatha commented 2 years ago

I'm currently on CAPV (vSphere). Sorry, forgot to mention that one

dimatha commented 2 years ago

Not sure if that's following Talos approach but I'll leave it here for a reference. CAPI kubeadm bootstrap: https://cluster-api.sigs.k8s.io/tasks/kubeadm-bootstrap.html Cloud-init config-data is used to deliver the hostname of the Machine and it can be used with a mixture of shell commands to set the hostname, etc.

Is that something that should go into the Platform config - https://github.com/talos-systems/talos/blob/release-0.13/internal/app/machined/pkg/runtime/v1alpha1/platform/vmware/vmware_amd64.go ?