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

Define whole cluster #17

Closed
RaSerge opened this issue Aug 14, 2024 · 5 comments
Closed

Define whole cluster #17

RaSerge opened this issue Aug 14, 2024 · 5 comments

Comments

@RaSerge
Copy link

RaSerge commented Aug 14, 2024

Hello, @kvaps !
Is it possible to describe whole talos cluster through talm (not per server, something like a talhelper nodes definition)?

@kvaps
Copy link
Member

kvaps commented Aug 14, 2024

Hi, initially Talm was designed to generate configs using data downloaded from Talos API.

But you can drop official library chart, and write your own template without lookup functions, and use it as following:

talm template -t templates/generic-worker.yaml --offline >  nodes/generic-worker.yaml
talm apply -f nodes/generic-worker.yaml -e 192.168.100.11 -n 192.168.100.11
talm apply -f nodes/generic-worker.yaml -e 192.168.100.12 -n 192.168.100.12
talm apply -f nodes/generic-worker.yaml -e 192.168.100.13 -n 192.168.100.13

or even:

talm template -t templates/generic-worker.yaml --offline | talm apply -f - -e 192.168.100.11 -n 192.168.100.11
talm template -t templates/generic-worker.yaml --offline | talm apply -f - -e 192.168.100.12 -n 192.168.100.12
talm template -t templates/generic-worker.yaml --offline | talm apply -f - -e 192.168.100.13 -n 192.168.100.13

@kvaps
Copy link
Member

kvaps commented Aug 14, 2024

It should be also possuble to do with official library chart:

talm template -t templates/worker.yaml -e 192.168.100.11 -n 192.168.100.11 | talm apply -f - 
talm template -t templates/worker.yaml -e 192.168.100.12 -n 192.168.100.12 | talm apply -f - 
talm template -t templates/worker.yaml -e 192.168.100.13 -n 192.168.100.13 | talm apply -f - 

But we preffer to save output of talm template to have this configuration recorded in the git.

@RaSerge
Copy link
Author

RaSerge commented Aug 14, 2024

Thank you!
I also prefer to keep configurations recorded in git.
It seems that you describe another case - how to offline generate templates for talos servers.

My question is more general. How to use talm for cluster management? i tried tools like a talhelper, clustertool and they provide slightly different way to do so.
I saw video Cozystack on Talos Linux and understood talm configuration paradigm (the clue to understand was # talm: nodes=... at head of template file that keep connection parameters and source template). In my case #2 looks like a really helpful feature.

@kvaps
Copy link
Member

kvaps commented Aug 14, 2024

You can generate multiple files for the nodes:

talm template -t templates/control-plane.yaml -e 192.168.100.11 -n 192.168.100.11 > nodes/srv1.yaml
talm template -t templates/control-plane.yaml -e 192.168.100.12 -n 192.168.100.12 > nodes/srv2.yaml
talm template -t templates/control-plane.yaml -e 192.168.100.13 -n 192.168.100.13 > nodes/srv3.yaml

Then manage them simple as kubectl:

talm apply -f nodes1/srv1.yaml -f nodes1/srv2.yaml -f nodes1/srv3.yaml

And to refresh them:

talm template -f nodes1/srv1.yaml -f nodes1/srv2.yaml -f nodes1/srv3.yaml --in-place

We probably need to add some documentation, currenly we have it only for Cozystack project
https://cozystack.io/docs/talos/configuration/talm/

@RaSerge
Copy link
Author

RaSerge commented Aug 14, 2024

Thank you! We really need better documentation for talm.

@RaSerge RaSerge closed this as completed Aug 14, 2024
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