From 952301289948ffb1c1095958e9628835252000ae Mon Sep 17 00:00:00 2001 From: Larry Date: Tue, 9 Jul 2024 09:59:04 -0500 Subject: [PATCH] Add reusable feature-state component (#2342) * Add reusable feature-state component * Replace for_k8s_version with for_kueue_version * Use new feature-state component * Use feature-state states * Reword feature state component to more closely match kubernetes style * Remove unnecessary feature-state note * Only use minor versions * Fix rebase error --- site/assets/scss/_styles_project.scss | 32 ++++++++++++++++++- .../content/en/docs/concepts/cluster_queue.md | 2 +- site/content/en/docs/concepts/multikueue.md | 4 +-- site/content/en/docs/concepts/preemption.md | 4 +-- site/content/en/docs/installation/_index.md | 7 ++-- .../tasks/dev/enabling_pprof_endpoints.md | 2 +- .../pending_workloads_in_status.md | 2 +- .../pending_workloads_on_demand.md | 4 +-- .../tasks/manage/setup_wait_for_pods_ready.md | 5 ++- site/layouts/shortcodes/feature-state.html | 13 ++++++++ 10 files changed, 55 insertions(+), 20 deletions(-) create mode 100644 site/layouts/shortcodes/feature-state.html diff --git a/site/assets/scss/_styles_project.scss b/site/assets/scss/_styles_project.scss index 20441ef48c..4aa982d647 100644 --- a/site/assets/scss/_styles_project.scss +++ b/site/assets/scss/_styles_project.scss @@ -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; -} \ No newline at end of file +} + +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%; + } diff --git a/site/content/en/docs/concepts/cluster_queue.md b/site/content/en/docs/concepts/cluster_queue.md index 8fe4728251..c86cbebce0 100644 --- a/site/content/en/docs/concepts/cluster_queue.md +++ b/site/content/en/docs/concepts/cluster_queue.md @@ -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. diff --git a/site/content/en/docs/concepts/multikueue.md b/site/content/en/docs/concepts/multikueue.md index 482d4768db..7d811c1740 100644 --- a/site/content/en/docs/concepts/multikueue.md +++ b/site/content/en/docs/concepts/multikueue.md @@ -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. diff --git a/site/content/en/docs/concepts/preemption.md b/site/content/en/docs/concepts/preemption.md index 609c77282e..11f5619ed8 100644 --- a/site/content/en/docs/concepts/preemption.md +++ b/site/content/en/docs/concepts/preemption.md @@ -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: diff --git a/site/content/en/docs/installation/_index.md b/site/content/en/docs/installation/_index.md index c68e257ce1..7bf7de97bd 100644 --- a/site/content/en/docs/installation/_index.md +++ b/site/content/en/docs/installation/_index.md @@ -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: @@ -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 @@ -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: diff --git a/site/content/en/docs/tasks/dev/enabling_pprof_endpoints.md b/site/content/en/docs/tasks/dev/enabling_pprof_endpoints.md index da71622c75..7343171fb8 100644 --- a/site/content/en/docs/tasks/dev/enabling_pprof_endpoints.md +++ b/site/content/en/docs/tasks/dev/enabling_pprof_endpoints.md @@ -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). diff --git a/site/content/en/docs/tasks/manage/monitor_pending_workloads/pending_workloads_in_status.md b/site/content/en/docs/tasks/manage/monitor_pending_workloads/pending_workloads_in_status.md index bffe7695e0..41606895a6 100644 --- a/site/content/en/docs/tasks/manage/monitor_pending_workloads/pending_workloads_in_status.md +++ b/site/content/en/docs/tasks/manage/monitor_pending_workloads/pending_workloads_in_status.md @@ -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: diff --git a/site/content/en/docs/tasks/manage/monitor_pending_workloads/pending_workloads_on_demand.md b/site/content/en/docs/tasks/manage/monitor_pending_workloads/pending_workloads_on_demand.md index 9559a3e30a..d3954bd1d4 100644 --- a/site/content/en/docs/tasks/manage/monitor_pending_workloads/pending_workloads_on_demand.md +++ b/site/content/en/docs/tasks/manage/monitor_pending_workloads/pending_workloads_on_demand.md @@ -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 @@ -302,4 +302,4 @@ You should get results similar to } ] } -``` \ No newline at end of file +``` diff --git a/site/content/en/docs/tasks/manage/setup_wait_for_pods_ready.md b/site/content/en/docs/tasks/manage/setup_wait_for_pods_ready.md index 78d3cb9c67..3d20527ca6 100644 --- a/site/content/en/docs/tasks/manage/setup_wait_for_pods_ready.md +++ b/site/content/en/docs/tasks/manage/setup_wait_for_pods_ready.md @@ -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 %}} diff --git a/site/layouts/shortcodes/feature-state.html b/site/layouts/shortcodes/feature-state.html new file mode 100644 index 0000000000..32281deb10 --- /dev/null +++ b/site/layouts/shortcodes/feature-state.html @@ -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 }} +
+ Feature state {{ $state }} since {{ $project }} {{ $for_version }} +
+{{ end }}