Skip to content

Commit

Permalink
Merge pull request #3225 from zhuxiujuan28/docs
Browse files Browse the repository at this point in the history
add metrics-server guide
  • Loading branch information
ks-ci-bot authored Dec 19, 2024
2 parents 182ab6f + 32ba2a6 commit 0363d33
Show file tree
Hide file tree
Showing 11 changed files with 151 additions and 78 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ This section explains how to manage workloads.

In KubeSphere, applications run in pods. To ensure business continuity in case of pod failures, it is common to create multiple replicas of a pod for an application. Workloads are responsible for managing replicas of pods and provide the following key functionalities:

* Automatically scale the number of pod replicas based on user-defined conditions.
// * Automatically scale the number of pod replicas based on user-defined conditions.
* Automatically update pods based on user-specified update strategies.
* Roll back pods to previous versions.
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This section describes how to manage workloads.

In KubeSphere, applications run in pods. To ensure business continuity when a single pod fails, it is usually necessary to create multiple pod replicas for an application. Workloads are resources used to manage pod replicas, responsible for managing multiple pod replicas of an application, and mainly provide the following functions:

* Automatically scale the number of pod replicas based on user-defined conditions.
// * Automatically scale the number of pod replicas based on user-defined conditions.

* Automatically update pods based on the update strategy specified by the user.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
title: "Edit Autoscaling Settings"
keywords: "Kubernetes, {ks_product-en}, Application Workloads, Workloads, Edit Autoscaling"
description: "Learn how to edit autoscaling settings for workloads."
weight: 01
---

:ks_permission: **Application Workload Management**
:ks_navigation: **Application Workloads > Workloads**


include::../../../_custom-en/clusterManagement/workloads/workloads-desc-editAutoScaling.adoc[]


== Prerequisites


:relfileprefix: ../../../

include::../../../_custom-en/clusterManagement/clusterManagement-prer-requiredPermission_clusterandproject.adoc[]

:relfileprefix: ./


== Steps

. Log in to the {ks_product-en} web console with a user who has the pass:a,q[{ks_permission}] permission, and access your cluster or project.

+

include::../../../../_ks_components-en/oper-navigate.adoc[]

+

. On the **Workloads** page, click **Deployments** or **StatefulSets** to open the list of workloads.

+

include::../../../_custom-en/clusterManagement/workloads/workloads-oper-editAutoScalingSettings.adoc[]

+

After the settings are complete, you can see image:/images/ks-qkcp/zh/icons/clock-2.svg[scaling,18,18] in the Status column on the Deployment or StatefulSet list page, indicating that the pod horizontal autoscaling policy has been set.

. On the **Resource Status** tab of the workload details page, click image:/images/ks-qkcp/zh/icons/more.svg[more,18,18] > **Cancel** next to Autoscaling to delete the autoscaling settings.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: "Metrics Server"
keywords: "Kubernetes, {ks_product-en}, Metrics Server, Horizontal Autoscaling, Vertical Autoscaling"
description: "Introduce how to use the Metrics Server extension."
weight: 24
layout: "second"
---


Metrics Server is a scalable, efficient source of container resource metrics for Kubernetes built-in autoscaling pipelines.

Metrics Server collects resource metrics from Kubelets and exposes them in Kubernetes apiserver through link:https://github.com/kubernetes/metrics[Metrics API]
for use by link:https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/[Horizontal Pod Autoscaler] and link:https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler/[Vertical Pod Autoscaler].

You can use Metrics Server for:

- CPU/Memory based horizontal autoscaling (learn more about link:https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/[Horizontal Autoscaling])
- Automatically adjusting/suggesting resources needed by containers (learn more about link:https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler/[Vertical Autoscaling])

[.admon.note,cols="a"]
|===
|Note

|
For more information about the extension, see the details page of the "Metrics Server" extension in the Extensions Center.
|===
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{ks_product_both}平台,应用程序运行在容器组中。为确保单个容器组出现故障时业务不会中断,通常需要为一个应用程序创建多个容器组副本。工作负载是用于管理容器组副本的资源,负责对一个应用程序的多个容器组副本进行管理,主要提供以下功能:

* 根据用户设定的条件自动扩缩容器组副本数量。
// * 根据用户设定的条件自动扩缩容器组副本数量。

* 根据用户指定的更新策略自动更新容器组。
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ layout: "second"

在{ks_product_both}平台,应用程序运行在容器组中。为确保单个容器组出现故障时业务不会中断,通常需要为一个应用程序创建多个容器组副本。工作负载是用于管理容器组副本的资源,负责对一个应用程序的多个容器组副本进行管理,主要提供以下功能:

* 根据用户设定的条件自动扩缩容器组副本数量。
// * 根据用户设定的条件自动扩缩容器组副本数量。

* 根据用户指定的更新策略自动更新容器组。

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: "编辑自动扩缩设置"
keywords: "Kubernetes, {ks_product}, 应用负载, 工作负载, 编辑自动扩缩"
description: "介绍如何编辑工作负载的自动扩缩设置。"
weight: 01
---

:ks_permission: **应用负载管理**
:ks_navigation: **应用负载 > 工作负载**


include::../../../_custom/clusterManagement/workloads/workloads-desc-editAutoScaling.adoc[]


== 前提条件


:relfileprefix: ../../../

include::../../../_custom/clusterManagement/clusterManagement-prer-requiredPermission_clusterandproject.adoc[]

:relfileprefix: ./



== 操作步骤

. 以具有pass:a,q[{ks_permission}]权限的用户登录{ks_product_left} Web 控制台并进入您的集群或项目。

+

include::../../../../_ks_components/oper-navigate.adoc[]

+

. 在**工作负载**页面,点击**部署**或**有状态副本集**,然后在列表中点击一个工作负载的名称打开其详情页面。

+

include::../../../_custom/clusterManagement/workloads/workloads-oper-editAutoScalingSettings.adoc[]

+

设置完成后,在部署或有状态副本集列表页的状态栏中,会出现image:/images/ks-qkcp/zh/icons/clock-2.svg[scaling,18,18],表示已设置容器组水平自动扩缩策略。

. 在工作负载详情页的**资源状态**页签,点击自动扩缩右侧的image:/images/ks-qkcp/zh/icons/more.svg[more,18,18] > **取消**,可删除自动扩缩设置。
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: "Metrics Server"
keywords: "Kubernetes, {ks_product}, Metrics Server, 水平扩缩, 垂直扩缩"
description: "介绍如何使用 Metrics Server 扩展组件。"
weight: 24
layout: "second"
---


Metrics Server 是一个可扩展、高效的容器资源度量源,为 Kubernetes 内置的自动扩展管道提供服务。

Metrics Server 从 Kubelet 收集资源指标,并通过 link:https://github.com/kubernetes/metrics[Metrics API] 在 Kubernetes apiserver 中公开它们,供 link:https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/[Horizontal Pod Autoscaler] 和 link:https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler/[Vertical Pod Autoscaler] 使用。

Metrics Server 可实现如下功能:

- 基于 CPU/内存的水平自动缩放(了解更多关于 link:https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/[Horizontal Autoscaling])
- 自动调整/建议容器所需的资源(了解更多关于 link:https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler/[Vertical Autoscaling])


[.admon.note,cols="a"]
|===
|说明

|
有关组件的更多信息,请参阅扩展中心 Metrics Server 扩展组件的详情页说明。
|===
4 changes: 4 additions & 0 deletions static/images/ks-qkcp/zh/icons/clock-2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0363d33

Please sign in to comment.