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

Provide explicit definition of variables scope in ClusterClass #6706

Open
fabriziopandini opened this issue Jun 23, 2022 · 9 comments
Open
Labels
area/clusterclass Issues or PRs related to clusterclass help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@fabriziopandini
Copy link
Member

User Story

As a user, I would like to understand what variables are meant to be used as overrides at CP/MD levels

Detailed Description

As of today, ClusterClass allows to define variables and all those variables can be used in a Cluster's topology.variables as well as for providing override at CP and MD level.

However, in practice, it really makes sense to use variables as override only a subset of variables, the ones that are used by patches impacting CP/MD of a given class.

This is currently hard to detect, especially for users which are not the ClusterClass authors, so it will be great if we can extend the current API by providing explicit information about the scope where a variable can be used.

Anything else you would like to add:

Might be it is possible to Inferr variables scope from patches, but it doesn't seem the right way to go because it will be complex and brittle.

/kind feature

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Jun 23, 2022
@fabriziopandini
Copy link
Member Author

/area topology

@fabriziopandini
Copy link
Member Author

/kind api-change

@k8s-ci-robot k8s-ci-robot added the kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API label Jun 23, 2022
@fabriziopandini fabriziopandini added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed triage/accepted Indicates an issue or PR is ready to be actively worked on. labels Jul 29, 2022
@fabriziopandini
Copy link
Member Author

/triage accepted

The biggest challenge here is to make sure that a variable that is meant to be used in scope is not used somewhere else, and this is complex given that variables can be used in go templates or in external patches.

@k8s-ci-robot k8s-ci-robot added the triage/accepted Indicates an issue or PR is ready to be actively worked on. label Jul 29, 2022
@sbueringer
Copy link
Member

sbueringer commented Aug 16, 2022

 and this is complex given that variables can be used in go templates or in external patches.

With our current implementation of external patches it's impossible to decide if a variable is used in an external patch.

We could do the following:

  • introduce scope
  • validate inline patches against scope
  • send variables based on scope to external patching (i.e. send variables which are not cluster-scoped only as template-specific variables according to their scope)

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/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 Nov 14, 2022
@fabriziopandini
Copy link
Member Author

/lifecycle frozen
/help

still something worth to discuss and address

@k8s-ci-robot
Copy link
Contributor

@fabriziopandini:
This request has been marked as needing help from a contributor.

Guidelines

Please ensure that the issue body includes answers to the following questions:

  • Why are we solving this issue?
  • To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
  • Does this issue have zero to low barrier of entry?
  • How can the assignee reach out to you for help?

For more details on the requirements of such an issue, please see here and ensure that they are met.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.

In response to this:

/lifecycle frozen
/help

still something worth to discuss and address

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.

@k8s-ci-robot k8s-ci-robot added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Nov 14, 2022
@killianmuldoon killianmuldoon added the area/clusterclass Issues or PRs related to clusterclass label May 4, 2023
@fabriziopandini
Copy link
Member Author

/priority important-longterm

@k8s-ci-robot k8s-ci-robot added the priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. label Apr 12, 2024
@fabriziopandini fabriziopandini removed the lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. label Apr 16, 2024
@fabriziopandini
Copy link
Member Author

fabriziopandini commented May 23, 2024

Note about the current situation:
As of today users are to set a variable only at MD level, but not if the variable is required (in this case it is required to set the variable at top level too, and what happens is that CC authors make those variables optional).

This idea of scope could help to address this use case too.
At some point, we should also consider if the idea of overrides still holds (or to simply to have "local" variables)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/clusterclass Issues or PRs related to clusterclass help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

5 participants