Decouple CLI from API/SDK #5594
Replies: 3 comments
-
you can take a look at this: https://github.com/siderolabs/pulumi-provider-talos/blob/main/provider/pkg/provider/provider.go it doesn't require access to any local files |
Beta Was this translation helpful? Give feedback.
-
First of all, we would love to support any effort to create providers for Talos in Terraform or any other automation tool. Talos exposes Not all things are in perfect order, but we are open to improve things based on the feedback. Sidero Labs also provides some CAPI tooling which relies on the machinery package, so it can be viewed as examples to use the code:
|
Beta Was this translation helpful? Give feedback.
-
Overview
The CLI is often tightly coupled to other package components, such as the machinery package. Sometimes the code is also orchestrated directly within the CLI command.
Why decoupling?
I tried to create a Terraform provider for Talos, but found it very difficult to get beyond generating the configuration. The main problem besides finding the right packages is that Talos relies on persisted files and late changes to them, such as configuring the
talosconfig
endpoint or nodes.Decoupling and creating an SDK-like package that can then be used within the Cobra-based
talosctl
would greatly simplify adoption for other automation tools such as Terraform or Controlplane.Why a provider for Terraform or Controlplane?
I tried to create a Terraform provider instead of using a
local_exec
provisioner or other shell adoptions inside Terraform to easily get the results of the build process inside a Terraform state and to get rid of the dependency to the locally installed talosctl version. That way it would also be easier to track changes and integrate the IaC part into Git and be reliable every time I need to rebuild a cluster.The same should be true for easy infrastructure creation via Controlplane.
Beta Was this translation helpful? Give feedback.
All reactions