@@ -10,58 +10,66 @@ Storage capacity is limited and may vary depending on the node on
10
10
which a pod runs: network-attached storage might not be accessible by
11
11
all nodes, or storage is local to a node to begin with.
12
12
13
- {{< feature-state for_k8s_version="v1.21 " state="beta " >}}
13
+ {{< feature-state for_k8s_version="v1.24 " state="stable " >}}
14
14
15
15
This page describes how Kubernetes keeps track of storage capacity and
16
- how the scheduler uses that information to schedule Pods onto nodes
16
+ how the scheduler uses that information to [ schedule Pods](/docs/concepts/scheduling-eviction/) onto nodes
17
17
that have access to enough storage capacity for the remaining missing
18
18
volumes. Without storage capacity tracking, the scheduler may choose a
19
19
node that doesn't have enough capacity to provision a volume and
20
20
multiple scheduling retries will be needed.
21
-
22
- Tracking storage capacity is supported for {{< glossary_tooltip
23
- text="Container Storage Interface" term_id="csi" >}} (CSI) drivers and
24
- [needs to be enabled](#enabling-storage-capacity-tracking) when installing a CSI driver.
25
21
-->
26
22
存储容量是有限的,并且会因为运行 Pod 的节点不同而变化:
27
23
网络存储可能并非所有节点都能够访问,或者对于某个节点存储是本地的。
28
24
29
- {{< feature-state for_k8s_version="v1.21 " state="beta " >}}
25
+ {{< feature-state for_k8s_version="v1.24 " state="stable " >}}
30
26
31
27
本页面描述了 Kubernetes 如何跟踪存储容量以及调度程序如何为了余下的尚未挂载的卷使用该信息将
32
- Pod 调度到能够访问到足够存储容量的节点上 。
28
+ [ Pod 调度 ] ( /zh/docs/concepts/scheduling-eviction/ ) 到能够访问到足够存储容量的节点上 。
33
29
如果没有跟踪存储容量,调度程序可能会选择一个没有足够容量来提供卷的节点,并且需要多次调度重试。
34
30
35
- {{< glossary_tooltip text="容器存储接口" term_id="csi" >}}(CSI)驱动程序支持跟踪存储容量,
36
- 并且在安装 CSI 驱动程序时[ 需要启用] ( #enabling-storage-capacity-tracking ) 该功能。
31
+ ## {{% heading "prerequisites" %}}
32
+
33
+ <!--
34
+ Kubernetes v{{< skew currentVersion >}} includes cluster-level API support for
35
+ storage capacity tracking. To use this you must also be using a CSI driver that
36
+ supports capacity tracking. Consult the documentation for the CSI drivers that
37
+ you use to find out whether this support is available and, if so, how to use
38
+ it. If you are not running Kubernetes v{{< skew currentVersion >}}, check the
39
+ documentation for that version of Kubernetes.
40
+ -->
41
+ Kubernetes v{{< skew currentVersion >}} 包含了对存储容量跟踪的集群级 API 支持。
42
+ 要使用它,你还必须使用支持容量跟踪的 CSI 驱动程序。请查阅你使用的 CSI 驱动程序的文档,
43
+ 以了解此支持是否可用,如果可用,该如何使用它。如果你运行的不是
44
+ Kubernetes v{{< skew currentVersion >}},请查看对应版本的 Kubernetes 文档。
37
45
38
46
<!-- body -->
39
47
<!--
40
48
## API
41
49
42
50
There are two API extensions for this feature:
43
- - CSIStorageCapacity objects:
51
+ - [ CSIStorageCapacity](/docs/reference/kubernetes-api/config-and-storage-resources/csi-storage-capacity-v1/) objects:
44
52
these get produced by a CSI driver in the namespace
45
53
where the driver is installed. Each object contains capacity
46
54
information for one storage class and defines which nodes have
47
55
access to that storage.
48
- - [The `CSIDriverSpec.StorageCapacity` field](/docs/reference/generated/ kubernetes-api/{{< param "version" >}}/#csidriverspec-v1 -storage-k8s-io ):
56
+ - [The `CSIDriverSpec.StorageCapacity` field](/docs/reference/kubernetes-api/config-and -storage-resources/csi-driver-v1/#CSIDriverSpec ):
49
57
when set to `true`, the Kubernetes scheduler will consider storage
50
58
capacity for volumes that use the CSI driver.
51
59
-->
52
60
## API
53
61
54
62
这个特性有两个 API 扩展接口:
55
- - CSIStorageCapacity 对象:这些对象由 CSI 驱动程序在安装驱动程序的命名空间中产生。
63
+ - [ CSIStorageCapacity] ( /docs/reference/kubernetes-api/config-and-storage-resources/csi-storage-capacity-v1/ ) 对象:这些对象由
64
+ CSI 驱动程序在安装驱动程序的命名空间中产生。
56
65
每个对象都包含一个存储类的容量信息,并定义哪些节点可以访问该存储。
57
- - [ ` CSIDriverSpec.StorageCapacity ` 字段] (/docs/reference/generated/ kubernetes-api/{{< param "version" >}}/#csidriverspec-v1 -storage-k8s-io ):
66
+ - [ ` CSIDriverSpec.StorageCapacity ` 字段] ( /docs/reference/kubernetes-api/config-and -storage-resources/csi-driver-v1/#CSIDriverSpec ) :
58
67
设置为 true 时,Kubernetes 调度程序将考虑使用 CSI 驱动程序的卷的存储容量。
59
68
60
69
<!--
61
70
## Scheduling
62
71
63
72
Storage capacity information is used by the Kubernetes scheduler if:
64
- - the `CSIStorageCapacity` feature gate is true,
65
73
- a Pod uses a volume that has not been created yet,
66
74
- that volume uses a {{< glossary_tooltip text="StorageClass" term_id="storage-class" >}} which references a CSI driver and
67
75
uses `WaitForFirstConsumer` [volume binding
@@ -90,7 +98,6 @@ significant resources there.
90
98
## 调度
91
99
92
100
如果有以下情况,存储容量信息将会被 Kubernetes 调度程序使用:
93
- - ` CSIStorageCapacity ` 特性门控被设置为 true,
94
101
- Pod 使用的卷还没有被创建,
95
102
- 卷使用引用了 CSI 驱动的 {{< glossary_tooltip text="StorageClass" term_id="storage-class" >}},
96
103
并且使用了 ` WaitForFirstConsumer ` [ 卷绑定模式] ( /zh/docs/concepts/storage/storage-classes/#volume-binding-mode ) ,
@@ -140,9 +147,7 @@ multiple volumes: one volume might have been created already in a
140
147
topology segment which then does not have enough capacity left for
141
148
another volume. Manual intervention is necessary to recover from this,
142
149
for example by increasing capacity or deleting the volume that was
143
- already created. [Further
144
- work](https://github.com/kubernetes/enhancements/pull/1703) is needed
145
- to handle this automatically.
150
+ already created.
146
151
-->
147
152
## 限制
148
153
@@ -151,32 +156,12 @@ to handle this automatically.
151
156
152
157
当 Pod 使用多个卷时,调度可能会永久失败:一个卷可能已经在拓扑段中创建,而该卷又没有足够的容量来创建另一个卷,
153
158
要想从中恢复,必须要进行手动干预,比如通过增加存储容量或者删除已经创建的卷。
154
- 需要[ 进一步工作] ( https://github.com/kubernetes/enhancements/pull/1703 ) 来自动处理此问题。
155
-
156
- <!--
157
- ## Enabling storage capacity tracking
158
-
159
- Storage capacity tracking is a beta feature and enabled by default in
160
- a Kubernetes cluster since Kubernetes 1.21. In addition to having the
161
- feature enabled in the cluster, a CSI driver also has to support
162
- it. Please refer to the driver's documentation for details.
163
- -->
164
- ## 开启存储容量跟踪
165
-
166
- 存储容量跟踪是一个 Beta 特性,从 Kubernetes 1.21 版本起在 Kubernetes 集群
167
- 中默认被启用。除了在集群中启用此功能特性之外,还要求 CSI 驱动支持此特性。
168
- 请参阅驱动的文档了解详细信息。
169
159
170
160
## {{% heading "whatsnext" %}}
171
161
172
162
<!--
173
- - For more information on the design, see the
163
+ - For more information on the design, see the
174
164
[Storage Capacity Constraints for Pod Scheduling KEP](https://github.com/kubernetes/enhancements/blob/master/keps/sig-storage/1472-storage-capacity-tracking/README.md).
175
- - For more information on further development of this feature, see the [enhancement tracking issue #1472](https://github.com/kubernetes/enhancements/issues/1472).
176
- - Learn about [Kubernetes Scheduler](/docs/concepts/scheduling-eviction/kube-scheduler/)
177
165
-->
178
166
- 想要获得更多该设计的信息,查看
179
167
[ Storage Capacity Constraints for Pod Scheduling KEP] ( https://github.com/kubernetes/enhancements/blob/master/keps/sig-storage/1472-storage-capacity-tracking/README.md ) 。
180
- - 有关此功能的下一步开发信息,查看
181
- [ enhancement tracking issue #1472 ] ( https://github.com/kubernetes/enhancements/issues/1472 ) 。
182
- - 学习 [ Kubernetes 调度器] ( /zh/docs/concepts/scheduling-eviction/kube-scheduler/ ) 。
0 commit comments