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

feat: add custom config support to talosctl cluster create #8333

Conversation

utkuozdemir
Copy link
Member

Allow passing a static, custom config to every machine created by talosctl cluster create. This is useful for testing, e.g., passing partial machine config via cloud user data.

@frezbo
Copy link
Member

frezbo commented Feb 20, 2024

We should probably plan later to support a config file like kind, we have too many options 😅

Copy link
Member

@smira smira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(thinking about having less flags)

would it work if we re-use inputDir flag, and pass same controlplane.yaml/worker.yaml without talosconfig ? (and add handling for empty talosconfig?)

@utkuozdemir
Copy link
Member Author

(thinking about having less flags)

would it work if we re-use inputDir flag, and pass same controlplane.yaml/worker.yaml without talosconfig ? (and add handling for empty talosconfig?)

Yep, I thought about it as well. The main reason to go this way was to be able to pass small configs directly as flags instead of as files. Also they have a less change of being different across control plane and worker. Creating a directory structure to meet this need felt a bit too much for this use case.

I think this is more convenient to use, but I can change, no problem.

@utkuozdemir utkuozdemir force-pushed the support-custom-config-via-talosctl-cluster-create branch 3 times, most recently from 5f46aab to b234dc0 Compare February 20, 2024 14:11
Allow passing a partial config to the machines using the `--input-dir` flag of `talosctl cluster create`.
With this change, it is not required to have talosconfig inside the input directory, neither for the configuration documents to contain a `v1alpha1` config document. They can solely contain maintenance config, e.g., `KmsgLogConfig`.

This is useful for testing scenarios such as partial machine configs being provided via cloud user data.

Signed-off-by: Utku Ozdemir <utku.ozdemir@siderolabs.com>
@utkuozdemir utkuozdemir force-pushed the support-custom-config-via-talosctl-cluster-create branch from b234dc0 to 815a8e9 Compare February 20, 2024 16:09
@utkuozdemir
Copy link
Member Author

(thinking about having less flags)

would it work if we re-use inputDir flag, and pass same controlplane.yaml/worker.yaml without talosconfig ? (and add handling for empty talosconfig?)

Changed it to be that way, hence got significantly simpler.

Copy link
Member

@smira smira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🆒

@utkuozdemir
Copy link
Member Author

/m

@talos-bot talos-bot merged commit 815a8e9 into siderolabs:main Feb 21, 2024
18 checks passed
@utkuozdemir utkuozdemir deleted the support-custom-config-via-talosctl-cluster-create branch February 21, 2024 10:42
utkuozdemir added a commit to utkuozdemir/talos that referenced this pull request Mar 6, 2024
…alosconfig

As `--input-dir` flag now supports partial configs, it should not fail when there is no talosconfig in the directory.

This was the missing part in siderolabs#8333.

Signed-off-by: Utku Ozdemir <utku.ozdemir@siderolabs.com>
utkuozdemir added a commit to utkuozdemir/talos that referenced this pull request Mar 6, 2024
…config

As `--input-dir` flag now supports partial configs, it should not fail when there is no talosconfig in the directory.

This was the missing part in siderolabs#8333.

Signed-off-by: Utku Ozdemir <utku.ozdemir@siderolabs.com>
utkuozdemir added a commit to utkuozdemir/talos that referenced this pull request Mar 6, 2024
…config

As `--input-dir` flag now supports partial configs, it should not fail when there is no talosconfig in the directory.

This was the missing part in siderolabs#8333.

Signed-off-by: Utku Ozdemir <utku.ozdemir@siderolabs.com>
utkuozdemir added a commit to utkuozdemir/talos that referenced this pull request Mar 6, 2024
…config

As `--input-dir` flag now supports partial configs, it should not fail when there is no talosconfig in the directory.

This was the missing part in siderolabs#8333.

Additionally, allow the `--cidr` flag when `--input-dir` is used - it is used even when the input configs are provided.

Signed-off-by: Utku Ozdemir <utku.ozdemir@siderolabs.com>
utkuozdemir added a commit to utkuozdemir/talos that referenced this pull request Mar 7, 2024
…config

As `--input-dir` flag now supports partial configs, it should not fail when there is no talosconfig in the directory.

This was the missing part in siderolabs#8333.

Additionally, allow the `--cidr` flag when `--input-dir` is used - it is used even when the input configs are provided.

Signed-off-by: Utku Ozdemir <utku.ozdemir@siderolabs.com>
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

Successfully merging this pull request may close these issues.

4 participants