Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Worker.yaml file has wrong type: controlplane #14

Open
tavrez opened this issue Jul 25, 2024 · 7 comments
Open

Worker.yaml file has wrong type: controlplane #14

tavrez opened this issue Jul 25, 2024 · 7 comments

Comments

@tavrez
Copy link

tavrez commented Jul 25, 2024

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
Copy link
Member

kvaps commented Jul 26, 2024

Hi! These files generated on this step

type: ${role}

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
Copy link
Member

kvaps commented Jul 26, 2024

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

talosctl gen config "${cluster_name}" "${k8s_endpoint}" --with-secrets=secrets.yaml ${patches} --config-patch="${machine_config}" --force || exit $?

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

@tavrez
Copy link
Author

tavrez commented Jul 26, 2024

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
Copy link
Member

kvaps commented Jul 26, 2024

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
Copy link
Author

tavrez commented Jul 27, 2024

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
Copy link
Member

kvaps commented Jul 27, 2024

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
Copy link
Author

tavrez commented Jul 28, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants