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

Add reusable feature-state component #2342

Merged
merged 8 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion site/assets/scss/_styles_project.scss
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,34 @@ nav.foldable-nav .ul-1 .with-child>label:hover:before {

nav.foldable-nav .ul-1 .with-child>input:checked~label:hover:before {
transform: rotate(90deg) !important;
}
}

div.feature-state-notice {
background-color: #daeaf9;
border-radius: 0.75rem;
padding: 1rem;
margin-bottom: 1em;

font-size: 1.2em;

> .feature-state-name::before {
content: 'ⓘ ';
color: #326ce5; // Kubernetes blue
}
> .feature-state-name {
display: inline-block;
font-size: 0.95em;
font-weight: bold;
color: #000;
background-color: #daeaf9;
}

code {
color: #000;
font-size: 1em;
background-color: #daeaf9;
}

margin-right: 2em;
max-width: 80%;
}
2 changes: 1 addition & 1 deletion site/content/en/docs/concepts/cluster_queue.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" >}}
{{% alert title="Warning" color="warning" %}}
_Available in Kueue v0.6.0 and later_

`LendingLimit` is an Alpha feature disabled by default.

Expand Down
4 changes: 1 addition & 3 deletions site/content/en/docs/concepts/multikueue.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ description: >
Kueue multi cluster job dispatching.
---

{{% alert title="Note" color="primary" %}}
Available in Kueue v0.6.0 and newer
{{% /alert %}}
{{< feature-state state="alpha" for_version="v0.6" >}}

{{% alert title="Warning" color="warning" %}}
MultiKueue is currently an alpha feature and disabled by default. Check the [Installation](/docs/installation/#change-the-feature-gates-configuration) guide for details on feature gate configuration.
Expand Down
4 changes: 1 addition & 3 deletions site/content/en/docs/concepts/preemption.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,7 @@ admitted when accounting back the quota usage of the target Workload.

## Fair Sharing

{{% alert title="Note" color="primary" %}}
Available in Kueue v0.7.0 and newer
{{% /alert %}}
{{< feature-state state="stable" for_version="v0.7" >}}

To enable fair sharing, [use a Kueue Configuration](/docs/installation#install-a-custom-configured-release-version) similar to the following:

Expand Down
7 changes: 2 additions & 5 deletions site/content/en/docs/installation/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ 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_

To allow [prometheus-operator](https://github.com/prometheus-operator/prometheus-operator)
to scrape metrics from kueue components, run the following command:

Expand All @@ -76,7 +74,8 @@ kubectl apply --server-side -f https://github.com/kubernetes-sigs/kueue/releases

### Add visibility API to monitor pending workloads

> _Available in Kueue v0.6.0 and later_
{{< feature-state state="alpha" for_version="v0.6" >}}


To add the visibility API that enables monitoring pending workloads, change [the feature gates configuration](/docs/installation/#change-the-feature-gates-configuration) and set `VisibilityOnDemand=true`, and run the following command

Expand Down Expand Up @@ -195,8 +194,6 @@ IMAGE_REGISTRY=registry.example.com/my-user make image-local-push deploy

### Add metrics scraping for prometheus-operator

> _Available in Kueue v0.2.0 and later_

To allow [prometheus-operator](https://github.com/prometheus-operator/prometheus-operator)
to scrape metrics from kueue components, run the following command:

Expand Down
2 changes: 1 addition & 1 deletion site/content/en/docs/tasks/dev/enabling_pprof_endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Make sure the following conditions are met:

## Enabling pprof endpoints

> _Available in Kueue v0.5.0 and later_
{{< feature-state state="stable" for_version="v0.5" >}}

To enable pprof endpoints, you need to set a `pprofBindAddress` is set in the [manager's configuration](/docs/installation/#install-a-custom-configured-released-version).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ QueueVisibility is an `Alpha` feature disabled by default, check the [Change the

## Monitor pending workloads

> _Available in Kueue v0.5.0 and later_
{{< feature-state state="alpha" for_version="v0.5" >}}

To install a simple setup of cluster queue, run the following command:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ kubectl apply --server-side -f https://github.com/kubernetes-sigs/kueue/releases

## Monitor pending workloads on demand

> _Available in Kueue v0.6.0 and later_
{{< feature-state state="stable" for_version="v0.6" >}}

To install a simple setup of ClusterQueue

Expand Down Expand Up @@ -302,4 +302,4 @@ You should get results similar to
}
]
}
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,8 @@ situations as demonstrated in the example below.

### Requeuing Strategy

{{% alert title="Warning" color="warning" %}}
Available in Kueue v0.6.0 and later
{{% /alert %}}
{{< feature-state state="stable" for_version="v0.6" >}}

{{% alert title="Note" color="primary" %}}
The `backoffBaseSeconds` and `backoffMaxSeconds` are available in Kueue v0.7.0 and later
{{% /alert %}}
Expand Down
13 changes: 13 additions & 0 deletions site/layouts/shortcodes/feature-state.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{ $valid_states := "alpha, beta, deprecated, stable" }}
{{ $project := .Get "project" | default "Kueue" }}
{{ $state := .Get "state" }}
{{ $for_version := .Get "for_version" | default (.Page.Param "version")}}
{{ $is_valid := strings.Contains $valid_states $state }}

{{ if not $is_valid }}
{{ 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> {{ $state }} since {{ $project }} {{ $for_version }}
</div>
{{ end }}