-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
feat(gencommand) Generate talosctl apply and upgrade commands with context of talconfig.yaml
#213
feat(gencommand) Generate talosctl apply and upgrade commands with context of talconfig.yaml
#213
Conversation
talhelper gencommand
talconfig.yaml
Thanks @mirceanton! I have commented on the code. And I also think that the |
@budimanjojo with commit 05b8e40 I added the ability to inject flags into the generated command(s). This way, Thus, by default the command will handle applying changes: root@talhelper-devbox:/workspace# talhelper gencommand --apply
talosctl apply-config --talosconfig=./clusterconfig/talosconfig --nodes=10.0.10.195 --file=./clusterconfig/home-cluster-cp-01.dev.k8s.mirceanton.com.yaml ;
talosctl apply-config --talosconfig=./clusterconfig/talosconfig --nodes=10.0.10.194 --file=./clusterconfig/home-cluster-cp-02.dev.k8s.mirceanton.com.yaml ;
talosctl apply-config --talosconfig=./clusterconfig/talosconfig --nodes=10.0.10.193 --file=./clusterconfig/home-cluster-cp-03.dev.k8s.mirceanton.com.yaml ;
talosctl apply-config --talosconfig=./clusterconfig/talosconfig --nodes=10.0.10.192 --file=./clusterconfig/home-cluster-wkr-01.dev.k8s.mirceanton.com.yaml ;
talosctl apply-config --talosconfig=./clusterconfig/talosconfig --nodes=10.0.10.191 --file=./clusterconfig/home-cluster-wkr-02.dev.k8s.mirceanton.com.yaml ;
talosctl apply-config --talosconfig=./clusterconfig/talosconfig --nodes=10.0.10.190 --file=./clusterconfig/home-cluster-wkr-03.dev.k8s.mirceanton.com.yaml ; But it can be configured to "bootstrap" as well: root@talhelper-devbox:/workspace# talhelper gencommand --apply --extra-flags=--insecure
talosctl apply-config --talosconfig=./clusterconfig/talosconfig --nodes=10.0.10.195 --file=./clusterconfig/home-cluster-cp-01.dev.k8s.mirceanton.com.yaml --insecure;
talosctl apply-config --talosconfig=./clusterconfig/talosconfig --nodes=10.0.10.194 --file=./clusterconfig/home-cluster-cp-02.dev.k8s.mirceanton.com.yaml --insecure;
talosctl apply-config --talosconfig=./clusterconfig/talosconfig --nodes=10.0.10.193 --file=./clusterconfig/home-cluster-cp-03.dev.k8s.mirceanton.com.yaml --insecure;
talosctl apply-config --talosconfig=./clusterconfig/talosconfig --nodes=10.0.10.192 --file=./clusterconfig/home-cluster-wkr-01.dev.k8s.mirceanton.com.yaml --insecure;
talosctl apply-config --talosconfig=./clusterconfig/talosconfig --nodes=10.0.10.191 --file=./clusterconfig/home-cluster-wkr-02.dev.k8s.mirceanton.com.yaml --insecure;
talosctl apply-config --talosconfig=./clusterconfig/talosconfig --nodes=10.0.10.190 --file=./clusterconfig/home-cluster-wkr-03.dev.k8s.mirceanton.com.yaml --insecure; I think this way we can cover both scenarios in one shot |
@mirceanton looks good! one more minor change and I'll merge this. Thanks! |
@budimanjojo I resolved all of the comments. I think this should be ok now. Furthermore, I noticed that we would have the exact same chunk of code repeated ~3 times identically, so I thought in 5072810 that we may be better off extracting it to a |
@mirceanton Yeah that config reading code is being repeated a lot and I have plan to make it exported like u did here but still thinking on how to structure it nicely. I'll merge this now. Thanks for the contribution ❤️ |
This PR aims to implement a new
gencommand
subcommand which will simplify managing Talos clusters by addressing the pain points described in #214 and #215Fixes #214
Fixes #215