-
Notifications
You must be signed in to change notification settings - Fork 223
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
Add reusable feature-state component #2342
Conversation
Welcome @ivange94! |
Hi @ivange94. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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-sigs/prow repository. |
✅ Deploy Preview for kubernetes-sigs-kueue ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might have some features that require a specific k8s version, so maybe this can be a parameter.
something like:
{{ $project := .Get "project" | default "Kueue"}}
|
||
{{ $valid_states := "alpha, beta, deprecated, stable" }} | ||
{{ $state := .Get "state" }} | ||
{{ $for_k8s_version := .Get "for_k8s_version" | default (.Page.Param "version")}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{{ $for_k8s_version := .Get "for_k8s_version" | default (.Page.Param "version")}} | |
{{ $for_k8s_version := .Get "for_kueue_version" | default (.Page.Param "version")}} |
{{ errorf "%q is not a valid feature-state, use one of %q" $state $valid_states }} | ||
{{ else }} | ||
<div class="feature-state-notice feature-{{ $state }}"> | ||
<span class="feature-state-name">FEATURE STATE</span> <code>Kubernetes {{ $for_k8s_version }} [{{ $state }}]</code> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<span class="feature-state-name">FEATURE STATE</span> <code>Kubernetes {{ $for_k8s_version }} [{{ $state }}]</code> | |
<span class="feature-state-name">FEATURE STATE</span> <code>Kueue {{ $for_kueue_version }} [{{ $state }}]</code> |
Thank you for the review @alculquicondor. I'm not clear about this comment
Do we want a parameter for a specific version for k8s and another for kueue? |
I want to add blocks for features that require a specific Kueue version, and blocks for features that require specific Kubernetes versions. We can use the same template for both, just parameterize the name of the project. |
/ok-to-test |
Hi @ivange94, are you still working on this? |
@alculquicondor I think I misunderstood your comments on this. I thought my changes satisfied this comment
Plus when I saw that you added the |
Oh I didn't realize that you added code, even though you said you didn't understand the suggestion. Can you make use of the template in a few places? For example, in https://kueue.sigs.k8s.io/docs/concepts/preemption/#fair-sharing |
{{ $valid_states := "alpha, beta, deprecated, stable" }} | ||
{{ $project := .Get "project" | default "Kueue" }} | ||
{{ $state := .Get "state" }} | ||
{{ $for_kueue_version := .Get "for_kueue_version" | default (.Page.Param "version")}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{{ $for_kueue_version := .Get "for_kueue_version" | default (.Page.Param "version")}} | |
{{ $for_version := .Get "for_version" | default (.Page.Param "version")}} |
/retest |
@alculquicondor I've incorporated your suggestions and also added some usages for the new template. |
@@ -349,8 +349,8 @@ To limit the amount of resources that a ClusterQueue can lend in the cohort, | |||
you can set the `.spec.resourcesGroup[*].flavors[*].resource[*].lendingLimit` | |||
[quantity](https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/quantity/) field. | |||
|
|||
{{< feature-state state="stable" for_version="v0.6.0+" >}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{{< feature-state state="stable" for_version="v0.6.0+" >}} | |
{{< feature-state state="alpha" for_version="v0.6" >}} |
This matches how Kubernetes documents features https://kubernetes.io/docs/reference/access-authn-authz/validating-admission-policy/
For the current state of features, you can check https://kueue.sigs.k8s.io/docs/installation/#change-the-feature-gates-configuration or
kueue/pkg/features/kube_features.go
Line 105 in aeb13cf
var defaultFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{ |
{{% alert title="Note" color="primary" %}} | ||
Available in Kueue v0.6.0 and newer | ||
{{% /alert %}} | ||
{{< feature-state state="stable" for_version="v0.6.0+" >}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{{< feature-state state="stable" for_version="v0.6.0+" >}} | |
{{< feature-state state="stable" for_version="v0.6" >}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly for the rest of the files.
{{ errorf "%q is not a valid feature-state, use one of %q" $state $valid_states }} | ||
{{ else }} | ||
<div class="feature-state-notice feature-{{ $state }}"> | ||
<span class="feature-state-name">FEATURE STATE</span> <code>{{ $project }} {{ $for_version }} [{{ $state }}]</code> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try this:
<span class="feature-state-name">FEATURE STATE</span> <code>{{ $project }} {{ $for_version }} [{{ $state }}]</code> | |
<span class="feature-state-name">Feature state</span>: {{ $state }} since {{ $project }} {{ $for_version }} |
It's not exactly what's on the K8s main website, but I think it's close enough. We can use text-transform
in the CSS if we want “FEATURE STATE” in all caps (I don't think it helps, TBH).
@@ -349,8 +349,8 @@ To limit the amount of resources that a ClusterQueue can lend in the cohort, | |||
you can set the `.spec.resourcesGroup[*].flavors[*].resource[*].lendingLimit` | |||
[quantity](https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/quantity/) field. | |||
|
|||
{{< feature-state state="alpha" for_version="v0.6.0" >}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{{< feature-state state="alpha" for_version="v0.6.0" >}} | |
{{< feature-state state="alpha" for_version="v0.6" >}} |
Let's only use minor versions
@@ -59,7 +59,8 @@ kubectl apply --server-side -f https://github.com/kubernetes-sigs/kueue/releases | |||
|
|||
### Add metrics scraping for prometheus-operator | |||
|
|||
> _Available in Kueue v0.2.1 and later_ | |||
{{< feature-state state="stable" for_version="v0.2.1" >}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove this note, since v0.2 is very old now. I wouldn't expect anyone to be running a version of Kueue older than v0.4
@alculquicondor I addressed all comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
Thanks!
LGTM label has been added. Git tree hash: 687168ada5da01af43c9d63c1a982cbf9f2762ea
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alculquicondor, ivange94 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/cherry-pick website |
@alculquicondor: once the present PR merges, I will cherry-pick it on top of website in a new PR and assign it to you. In response to this:
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-sigs/prow repository. |
@alculquicondor: new pull request created: #2564 In response to this:
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-sigs/prow repository. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Adds a feature-state component similar to what we have on the kubernetes website for marking the minimum version of kubernetes supported.
Which issue(s) this PR fixes:
Fixes #2325
Special notes for your reviewer:
Does this PR introduce a user-facing change?