aenix-io / talos-bootstrap

An interactive Talos Linux installer
Apache License 2.0
94 stars 11 forks source link

Worker.yaml file has wrong type: controlplane #14

Open tavrez opened 1 month ago

tavrez commented 1 month ago

Hello, I've bootstraped a server in controlplane mode with almost all the default configurations and no patch or config files present, after files generated, I've noticed the worker.yaml file has type: controlplane instead of type: worker inside of it(but it is a correct worker file in other parts). I think it's a bug, could you take a look at it?

kvaps commented 1 month ago

Hi! These files generated on this step

https://github.com/aenix-io/talos-bootstrap/blob/b6858d102882bbcf440a1ee20c71f9d0af290c49/talos-bootstrap#L335

They are not intented for manual use and regenerated for every new run.

So if you bootstrap your controlplane node, worker.yaml will not be used. And If you bootstrarp worker node, the controlplane.yaml file will not be used.

kvaps commented 1 month ago

talosctl gen config by itseld supports specifying type of output files:

  -t, --output-types strings                     types of outputs to be generated. valid types are: ["controlplane" "worker" "talosconfig"] (default [controlplane,worker,talosconfig])

We just not using it right now, we can consider adding this option to this line https://github.com/aenix-io/talos-bootstrap/blob/b6858d102882bbcf440a1ee20c71f9d0af290c49/talos-bootstrap#L402

eg somehing like: --output-types "${role},talosconfig"

tavrez commented 1 month ago

Thanks for the answer, But how can I add workers to a controlplane created by this tool? I created a controlplane using this tool and then a worker but the worker won't become ready and connected to controlplane. How should I pass tokens and other stuff from my controlplane nodes to it?

kvaps commented 1 month ago

Hmm, so you say if you choose worker on the step 2, it is also writes type: control-plane for worker.yaml file?

Screenshot 2024-07-26 at 17 58 58

tavrez commented 1 month ago

No, What I'm trying to say is "how can we use the worker option" If I select worker in the image you posted while I'm on a empty folder and started talos-bootstrap install from shell, how is the node gonna connect to a controlplane? My problem is mainly because lack of documentation I think. I think I'm using this project on a wrong way...

kvaps commented 1 month ago

Your cluster have the same virtual IP, all the nodes communicating through it. It can be done by specifying virtual floating IP or via external load balancer.

When you bootstrap your first node the cluster.conf is created. It's holding some cluster bootstrap state locally, so you can run talos-bootstrap install again to bootstrap other nodes and join them to the same cluster

tavrez commented 1 month ago

Thanks for clarification, my problem was running talos-bootstrap install on a completely new and empty directory, when I executed it on the same directory as I've used for setting up the control plane, it successfully created the worker nodes and it joined to the cluster. However, talos-bootstrap got stucked on the installing step, even long after worker node becomes ready: image