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

[clusterctl] proposal: support a more expressive templating engine beyond simple variable substitution #3252

Closed
CecileRobertMichon opened this issue Jun 24, 2020 · 8 comments
Labels
area/clusterctl Issues or PRs related to clusterctl kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.

Comments

@CecileRobertMichon
Copy link
Contributor

Problem statement:

As infrastructure providers add more cluster configuration options and features, it is becoming harder to define templates for each feature. In CAPZ, we have taken the approach of using kustomize to generate template "flavors". The main downside of this approach is that 1 feature -> 1 flavor (ie. there is one flavor for managed identity, one flavor for machine pool, one flavor for out of tree provider, etc.). A user will likely want to use a combination of these features. It is not feasible to define a flavor for each possible permutation of features we support. Most of these features require more complex templating than just variable substitution (conditionals, loops, etc.).

In addition, the "quickstart" experience can be intimidating to new users which is a barrier to adoption. Quite often, the infrastructure templates require the user to specify a large number of variables, some of which might not be relevant to them because they'd just like to use the default, and doesn't provide a lot of flexibility for enabling/disabling specific features. #3189 is a first step towards improving that, but it's the bare minimum. This proposal is to propose that we go beyond that, as was originally proposed in #2339.

User Stories:

  • As a provider, I would like to be able to template the cluster templates available for clusterctl consumption.

  • As a user, I would like to be able to configure my cluster with a combination of features by passing in flags or environment variables (or a config file) to clusterctl without having to write my own my template from scratch.

One alternative is for each provider to use clusterctl as a library and write their own CLI wrapper around it to handle templating. The main motivations for proposing to include templating in clusterctl itself are:

  1. the need for templating is generic enough for every infrastructure provider to benefit from it, and
  2. having a separate CLI for each infra provider would degrade the consistency of the cluster configuration user experience

Proposed implementation:

One templating engine that would fit the needs described above is ytt (was originally brought up in the original clusterctl extensible template processing proposal).

NOTE: #3115 adds a templating interface for clusterctl such that the default "simple yaml processor" can be overridden. However, it does not support a templating engine within clusterctl itself.

Related to #3247

/kind feature
/area clusterctl

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. area/clusterctl Issues or PRs related to clusterctl labels Jun 24, 2020
@CecileRobertMichon
Copy link
Contributor Author

@vincepri
Copy link
Member

@CecileRobertMichon Thoughts about milestone?

@CecileRobertMichon
Copy link
Contributor Author

@vincepri for now just wanted to get the discussion started since I know we considered doing this in the past (#2339) and didn't end up implementing it.

@vincepri
Copy link
Member

vincepri commented Jul 1, 2020

/milestone Next

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 29, 2020
@fabriziopandini
Copy link
Member

/lifecycle frozen

@k8s-ci-robot k8s-ci-robot added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Sep 30, 2020
@vincepri
Copy link
Member

/close

ClusterClass covers this use case with the support of inline patches

@k8s-ci-robot
Copy link
Contributor

@vincepri: Closing this issue.

In response to this:

/close

ClusterClass covers this use case with the support of inline patches

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/clusterctl Issues or PRs related to clusterctl kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.
Projects
None yet
Development

No branches or pull requests

5 participants