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

update policy to upgrade statefulset #6115

Merged
merged 2 commits into from
Jan 10, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Advanced setting includes four parts: load network settings, upgrade policy, sch
- Max Unavailable Pods: Specify the maximum value or ratio of unavailable pods during the workload update process, the default is 25%. If it is equal to the number of instances, there is a risk of service interruption.
- Revision History Limit: Set the number of old versions retained when the version is rolled back. The default is 10.
- Upgrade Max Duration: If the deployment is not successful after the set time, the workload will be marked as failed. Default is 600 seconds.
- Graceful Period: The execution period (0-9,999 seconds) of the command before the workload stops, the default is 30 seconds.
- Graceful Time Window: The execution period (0-9,999 seconds) of the command before the workload stops, the default is 30 seconds.

=== "Scheduling Policies"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ Advanced setting includes four parts: Network Settings, Upgrade Policy, Scheduli
- Revision History Limit: Set the number of old versions retained when the version is rolled back. The default is 10.
- Minimum Ready: The minimum time for a Pod to be ready. Only after this time is the Pod considered available. The default is 0 seconds.
- Upgrade Max Duration: If the deployment is not successful after the set time, the workload will be marked as failed. Default is 600 seconds.
- Graceful Period: The execution period (0-9,999 seconds) of the command before the workload stops, the default is 30 seconds.
- Graceful Time Window: The execution period (0-9,999 seconds) of the command before the workload stops, the default is 30 seconds.

![Upgrade Policy](../images/deploy14.png)

Expand Down
28 changes: 15 additions & 13 deletions docs/en/docs/kpanda/user-guide/workloads/create-statefulset.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ Container setting is divided into six parts: basic information, life cycle, heal

=== "Basic information (required)"

![Basic Info](../images/state11.png)

When configuring container-related parameters, you must correctly fill in the container name and image parameters, otherwise you will not be able to proceed to the next step. After filling in the settings with reference to the following requirements, click __OK__ .

- Container Name: Up to 63 characters, lowercase letters, numbers and separators ("-") are supported. Must start and end with a lowercase letter or number, eg nginx-01.
Expand All @@ -71,8 +73,6 @@ Container setting is divided into six parts: basic information, life cycle, heal

> Before setting exclusive GPU, the administrator needs to install the GPU card and driver plug-in on the cluster nodes in advance, and enable the GPU feature in [Cluster Settings](../clusterops/cluster-settings.md).

![Basic Info](../images/state11.png)

=== "Lifecycle (optional)"

Set the commands that need to be executed when the container starts, after starting, and before stopping. For details, refer to [Container Lifecycle Configuration](pod-config/lifecycle.md).
Expand Down Expand Up @@ -115,14 +115,16 @@ Configure [Service (Service)](../network/create-services.md) for the statefulset

![Config Parameters](../images/deploy13.png)

3. Click __OK__ and click __Next__ .
3. Click __OK__ and click __Next__

### Advanced settings

Advanced setting includes four parts: load network settings, upgrade policy, scheduling policy, label and annotation. You can click the tabs below to view the requirements of each part.

=== "Network Configuration"

![DNS](../images/state17.png)

1. For container NIC settings, refer to [Workload Usage IP Pool](../../../network/config/use-ippool/usage.md)
2. DNS settings

Expand All @@ -140,28 +142,30 @@ Advanced setting includes four parts: load network settings, upgrade policy, sch
- Options: Configuration options for DNS, where each object can have a name attribute (required) and a value attribute (optional). The content in this field will be merged into the options field of the domain name resolution file generated based on dnsPolicy. If some options of dnsConfig options conflict with the options of the domain name resolution file generated based on dnsPolicy, they will be overwritten by dnsConfig.
- Host Alias: the alias set for the host.

![DNS](../images/state17.png)

=== "Upgrade Policy"

- Upgrade Mode: __Rolling upgrade__ refers to gradually replacing instances of the old version with instances of the new version. During the upgrade process, business traffic will be load-balanced to the old and new instances at the same time, so the business will not be interrupted. __Rebuild and upgrade__ refers to deleting the workload instance of the old version first, and then installing the specified new version. During the upgrade process, the business will be interrupted.
- Revision History Limit: Set the number of old versions retained when the version is rolled back. The default is 10.
- Graceful Period: The execution period (0-9,999 seconds) of the command before the workload stops, the default is 30 seconds.

![Upgrade Policy](../images/state14.png)

- Upgrade Mode:
- __RollingUpdate__ refers to gradually replacing instances of the old version with instances of the new version. During the upgrade process, business traffic will be load-balanced to the old and new instances at the same time, so the business will not be interrupted.
- __OnDelete__ refers to deleting the workload instance of the old version first, and then installing the specified new version. During the upgrade process, the business will be interrupted.
- Revision History Limit: Set the number of old versions retained when the version is rolled back. The default is 10.
- Graceful Time Window: The execution period (0-9,999 seconds) of the command before the workload stops, the default is 30 seconds.

=== "Container Management Policies"

![Container Management Policies](../images/state05.png)

Kubernetes v1.7 and later versions can set Pod management policies through __.spec.podManagementPolicy__ , which supports the following two methods:

- __OrderedReady__ : The default Pod management policy, which means that Pods are deployed in order. Only after the deployment of the previous Pod is successfully completed, the statefulset will start to deploy the next Pod. Pods are deleted in reverse order, with the last created being deleted first.

- __Parallel__ : Create or delete containers in parallel, just like Pods of the Deployment type. The StatefulSet controller starts or terminates all containers in parallel. There is no need to wait for a Pod to enter the Running and ready state or to stop completely before starting or terminating other Pods. This option only affects the behavior of scaling operations, not the order of updates.

![Container Management Policies](../images/state05.png)

=== "Scheduling Policies"

![Scheduling Policies](../images/state15.png)

- Tolerance time: When the node where the workload instance is located is unavailable, the time for rescheduling the workload instance to other available nodes, the default is 300 seconds.
- Node affinity: According to the label on the node, constrain which nodes the Pod can be scheduled on.
- Workload Affinity: Constrains which nodes a Pod can be scheduled to based on the labels of the Pods already running on the node.
Expand All @@ -170,8 +174,6 @@ Advanced setting includes four parts: load network settings, upgrade policy, sch

> For details, refer to [Scheduling Policy](pod-config/scheduling-policy.md).

![Scheduling Policies](../images/state15.png)

=== "Labels and Annotations"

You can click the __Add__ button to add tags and annotations to workloads and pods.
Expand Down
Binary file added docs/zh/docs/kpanda/images/state-deploy14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 11 additions & 9 deletions docs/zh/docs/kpanda/user-guide/workloads/create-statefulset.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@

=== "网络配置"

![DNS 配置](https://docs.daocloud.io/daocloud-docs-images/docs/kpanda/images/deploy17.png)

- 如在集群中部署了 [SpiderPool](../../../network/modules/spiderpool/index.md) 和 [Multus](../../../network/modules/multus-underlay/index.md) 组件,则可以在网络配置中配置容器网卡。详情参考[工作负载使用 IP 池](../../../network/config/use-ippool/usage.md)。

- DNS 配置:应用在某些场景下会出现冗余的 DNS 查询。Kubernetes 为应用提供了与 DNS 相关的配置选项,能够在某些场景下有效地减少冗余的 DNS 查询,提升业务并发量。
Expand All @@ -153,28 +155,30 @@
- Options:DNS 的配置选项,其中每个对象可以具有 name 属性(必需)和 value 属性(可选)。该字段中的内容将合并到基于 dnsPolicy 生成的域名解析文件的 options 字段中,dnsConfig 的 options 的某些选项如果与基于 dnsPolicy 生成的域名解析文件的选项冲突,则会被 dnsConfig 所覆盖。
- 主机别名:为主机设置的别名。

![DNS 配置](https://docs.daocloud.io/daocloud-docs-images/docs/kpanda/images/deploy17.png)

=== "升级策略"

- 升级方式: __滚动升级__ 指逐步用新版本的实例替换旧版本的实例,升级的过程中,业务流量会同时负载均衡分布到新老的实例上,因此业务不会中断。 __重建升级__ 指先删除老版本的负载实例,再安装指定的新版本,升级过程中业务会中断。
![升级策略](../../images/state-deploy14.png)

- 升级方式:
- __滚动升级(RollingUpdate)__ 指逐步用新版本的实例替换旧版本的实例,升级的过程中,业务流量会同时负载均衡分布到新老的实例上,因此业务不会中断。
- __重建升级(OnDelete)__ 指先删除老版本的负载实例,再安装指定的新版本,升级过程中业务会中断。
- 最大保留版本数:设置版本回滚时保留的旧版本数量。默认 10。
- 缩容时间窗:负载停止前命令的执行时间窗(0-9,999秒),默认 30 秒。

![升级策略](https://docs.daocloud.io/daocloud-docs-images/docs/kpanda/images/deploy14.png)

=== "容器管理策略"

![容器管理策略](https://docs.daocloud.io/daocloud-docs-images/docs/kpanda/images/state05.png)

Kubernetes v1.7 及其之后的版本可以通过 __.spec.podManagementPolicy__ 设置 Pod 的管理策略,支持以下两种方式:

- __按序策略(OrderedReady)__ :默认的 Pod 管理策略,表示按顺序部署 Pod,只有前一个 Pod 部署 成功完成后,有状态负载才会开始部署下一个 Pod。删除 Pod 时则采用逆序,最后创建的最先被删除。

- __并行策略(Parallel)__ :并行创建或删除容器,和 Deployment 类型的 Pod 一样。StatefulSet 控制器并行地启动或终止所有的容器。启动或者终止其他 Pod 前,无需等待 Pod 进入 Running 和 ready 或者完全停止状态。 这个选项只会影响扩缩操作的行为,不影响更新时的顺序。

![容器管理策略](https://docs.daocloud.io/daocloud-docs-images/docs/kpanda/images/state05.png)

=== "调度策略"

![调度策略](https://docs.daocloud.io/daocloud-docs-images/docs/kpanda/images/deploy15.png)

- 容忍时间:负载实例所在的节点不可用时,将负载实例重新调度到其它可用节点的时间,默认为 300 秒。
- 节点亲和性:根据节点上的标签来约束 Pod 可以调度到哪些节点上。
- 工作负载亲和性:基于已经在节点上运行的 Pod 的标签来约束 Pod 可以调度到哪些节点。
Expand All @@ -183,8 +187,6 @@

> 具体详情请参考[调度策略](pod-config/scheduling-policy.md)。

![调度策略](https://docs.daocloud.io/daocloud-docs-images/docs/kpanda/images/deploy15.png)

=== "标签与注解"

可以点击 __添加__ 按钮为工作负载和容器组添加标签和注解。
Expand Down
Loading