Skip to content

Commit f513c7f

Browse files
authored
Merge pull request #40343 from Zhuzhenghao/2023-01-05-retroactive-default-storage-class.md
[zh] resync blogs 2022-8-15, 2023-01-05, 2023-03-17
2 parents 03c353e + fdf97b0 commit f513c7f

File tree

3 files changed

+71
-29
lines changed

3 files changed

+71
-29
lines changed

content/zh-cn/blog/_posts/2022-08-15-meet-our-contributors-APAC-China-region-03.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Andy 是 Kubernetes 中国社区的活跃成员。
6969
## [Shiming Zhang](https://github.com/wzshiming)
7070

7171
<!--
72-
Shiming Zhang is a Software Engineer working on Kubernetes for DaoCloud in Shanghai, China.
72+
Shiming Zhang is a Software Engineer working on Kubernetes for DaoCloud in Shanghai, China.
7373
7474
He has mostly been involved with SIG Node as a reviewer. His major contributions have mainly been bug fixes and feature improvements in an ongoing [KEP](https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/2712-pod-priority-based-graceful-node-shutdown), all revolving around SIG Node.
7575
@@ -128,11 +128,11 @@ Jintao Zhang 目前受聘于 API7,他专注于 Ingress 和服务网格。
128128
在为 Kubernetes 做贡献之前,Jintao 是 Docker 相关开源项目的长期贡献者。
129129

130130
<!--
131-
Currently Jintao is a reviewer for the [ingress-nginx](https://kubernetes.github.io/ingress-nginx/) project.
131+
Currently Jintao is a maintainer for the [ingress-nginx](https://kubernetes.github.io/ingress-nginx/) project.
132132
133133
He suggests keeping track of job opportunities at open source companies so that you can find one that allows you to contribute full time. For new contributors Jintao says that if anyone wants to make a significant contribution to an open source project, then they should choose the project based on their interests and should generously invest time.
134134
-->
135-
目前 Jintao 是 [ingress-nginx](https://kubernetes.github.io/ingress-nginx/) 项目的 Reviewer
135+
目前 Jintao 是 [ingress-nginx](https://kubernetes.github.io/ingress-nginx/) 项目的 Maintainer
136136

137137
他建议关注开源公司的工作机会,这样你就可以找到一个可以让你全职贡献的机会。
138138
对于新的贡献者们,Jintao 表示如果有人想为一个开源项目做重大贡献,

content/zh-cn/blog/_posts/2023-01-05-retroactive-default-storage-class.md

Lines changed: 54 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,19 @@ slug: retroactive-default-storage-class
1919
**译者:** Michael Yao (DaoCloud)
2020

2121
<!--
22-
The v1.25 release of Kubernetes introduced an alpha feature to change how a default StorageClass was assigned to a PersistentVolumeClaim (PVC).
23-
With the feature enabled, you no longer need to create a default StorageClass first and PVC second to assign the class. Additionally, any PVCs without a StorageClass assigned can be updated later.
22+
The v1.25 release of Kubernetes introduced an alpha feature to change how a default
23+
StorageClass was assigned to a PersistentVolumeClaim (PVC). With the feature enabled,
24+
you no longer need to create a default StorageClass first and PVC second to assign the
25+
class. Additionally, any PVCs without a StorageClass assigned can be updated later.
2426
This feature was graduated to beta in Kubernetes 1.26.
2527
-->
2628
Kubernetes v1.25 引入了一个 Alpha 特性来更改默认 StorageClass 被分配到 PersistentVolumeClaim (PVC) 的方式。
2729
启用此特性后,你不再需要先创建默认 StorageClass,再创建 PVC 来分配类。
2830
此外,任何未分配 StorageClass 的 PVC 都可以在后续被更新。此特性在 Kubernetes 1.26 中已进阶至 Beta。
2931

3032
<!--
31-
You can read [retroactive default StorageClass assignment](/docs/concepts/storage/persistent-volumes/#retroactive-default-storageclass-assignment) in the Kubernetes documentation for more details about how to use that,
33+
You can read [retroactive default StorageClass assignment](/docs/concepts/storage/persistent-volumes/#retroactive-default-storageclass-assignment)
34+
in the Kubernetes documentation for more details about how to use that,
3235
or you can read on to learn about why the Kubernetes project is making this change.
3336
-->
3437
有关如何使用的更多细节,请参阅 Kubernetes
@@ -38,18 +41,20 @@ or you can read on to learn about why the Kubernetes project is making this chan
3841
<!--
3942
## Why did StorageClass assignment need improvements
4043
41-
Users might already be familiar with a similar feature that assigns default StorageClasses to **new** PVCs at the time of creation. This is currently handled by the [admission controller](/docs/reference/access-authn-authz/admission-controllers/#defaultstorageclass).
44+
Users might already be familiar with a similar feature that assigns default StorageClasses
45+
to **new** PVCs at the time of creation. This is currently handled by the
46+
[admission controller](/docs/reference/access-authn-authz/admission-controllers/#defaultstorageclass).
4247
-->
4348
## 为什么 StorageClass 赋值需要改进 {#why-did-sc-assignment-need-improvements}
4449

4550
用户可能已经熟悉在创建时将默认 StorageClasses 分配给**** PVC 的这一类似特性。
4651
这个目前由[准入控制器](/zh-cn/docs/reference/access-authn-authz/admission-controllers/#defaultstorageclass)处理。
4752

4853
<!--
49-
But what if there wasn't a default StorageClass defined at the time of PVC creation?
50-
Users would end up with a PVC that would never be assigned a class.
51-
As a result, no storage would be provisioned, and the PVC would be somewhat "stuck" at this point.
52-
Generally, two main scenarios could result in "stuck" PVCs and cause problems later down the road.
54+
But what if there wasn't a default StorageClass defined at the time of PVC creation?
55+
Users would end up with a PVC that would never be assigned a class.
56+
As a result, no storage would be provisioned, and the PVC would be somewhat "stuck" at this point.
57+
Generally, two main scenarios could result in "stuck" PVCs and cause problems later down the road.
5358
Let's take a closer look at each of them.
5459
-->
5560
但是,如果在创建 PVC 时没有定义默认 StorageClass 会怎样?
@@ -66,9 +71,11 @@ With the alpha feature enabled, there were two options admins had when they want
6671
启用这个 Alpha 特性后,管理员想要更改默认 StorageClass 时会有两个选项:
6772

6873
<!--
69-
1. Creating a new StorageClass as default before removing the old one associated with the PVC.
70-
This would result in having two defaults for a short period.
71-
At this point, if a user were to create a PersistentVolumeClaim with storageClassName set to <code>null</code> (implying default StorageClass), the newest default StorageClass would be chosen and assigned to this PVC.
74+
1. Creating a new StorageClass as default before removing the old one associated with the PVC.
75+
This would result in having two defaults for a short period.
76+
At this point, if a user were to create a PersistentVolumeClaim with storageClassName set to
77+
<code>null</code> (implying default StorageClass), the newest default StorageClass would be
78+
chosen and assigned to this PVC.
7279
-->
7380
1. 在移除与 PVC 关联的旧 StorageClass 之前,创建一个新的 StorageClass 作为默认值。
7481
这将导致在短时间内出现两个默认值。此时,如果用户要创建一个 PersistentVolumeClaim,
@@ -77,9 +84,11 @@ At this point, if a user were to create a PersistentVolumeClaim with storageClas
7784

7885
<!--
7986
2. Removing the old default first and creating a new default StorageClass.
80-
This would result in having no default for a short time.
81-
Subsequently, if a user were to create a PersistentVolumeClaim with storageClassName set to <code>null</code> (implying default StorageClass), the PVC would be in <code>Pending</code> state forever.
82-
The user would have to fix this by deleting the PVC and recreating it once the default StorageClass was available.
87+
This would result in having no default for a short time.
88+
Subsequently, if a user were to create a PersistentVolumeClaim with storageClassName
89+
set to <code>null</code> (implying default StorageClass), the PVC would be in
90+
<code>Pending</code> state forever. The user would have to fix this by deleting
91+
the PVC and recreating it once the default StorageClass was available.
8392
-->
8493
2. 先移除旧的默认值再创建一个新的默认 StorageClass。这将导致短时间内没有默认值。
8594
接下来如果用户创建一个 PersistentVolumeClaim,并将 storageClassName 设置为 <code>null</code>
@@ -89,8 +98,10 @@ The user would have to fix this by deleting the PVC and recreating it once the d
8998
<!--
9099
### Resource ordering during cluster installation
91100
92-
If a cluster installation tool needed to create resources that required storage, for example, an image registry, it was difficult to get the ordering right.
93-
This is because any Pods that required storage would rely on the presence of a default StorageClass and would fail to be created if it wasn't defined.
101+
If a cluster installation tool needed to create resources that required storage,
102+
for example, an image registry, it was difficult to get the ordering right.
103+
This is because any Pods that required storage would rely on the presence of
104+
a default StorageClass and would fail to be created if it wasn't defined.
94105
-->
95106
### 集群安装期间的资源顺序 {#resource-ordering-during-cluster-installation}
96107

@@ -101,8 +112,10 @@ This is because any Pods that required storage would rely on the presence of a d
101112
<!--
102113
## What changed
103114
104-
We've changed the PersistentVolume (PV) controller to assign a default StorageClass to any unbound PersistentVolumeClaim that has the storageClassName set to <code>null</code>.
105-
We've also modified the PersistentVolumeClaim admission within the API server to allow the change of values from an unset value to an actual StorageClass name.
115+
We've changed the PersistentVolume (PV) controller to assign a default StorageClass
116+
to any unbound PersistentVolumeClaim that has the storageClassName set to <code>null</code>.
117+
We've also modified the PersistentVolumeClaim admission within the API server to allow
118+
the change of values from an unset value to an actual StorageClass name.
106119
-->
107120
## 发生了什么变化 {#what-changed}
108121

@@ -113,7 +126,10 @@ storageClassName 设置为 `null` 且未被绑定的所有 PersistentVolumeClaim
113126
<!--
114127
### Null `storageClassName` versus `storageClassName: ""` - does it matter? { #null-vs-empty-string }
115128
116-
Before this feature was introduced, those values were equal in terms of behavior. Any PersistentVolumeClaim with the storageClassName set to <code>null</code> or <code>""</code> would bind to an existing PersistentVolume resource with storageClassName also set to <code>null</code> or <code>""</code>.
129+
Before this feature was introduced, those values were equal in terms of behavior.
130+
Any PersistentVolumeClaim with the storageClassName set to <code>null</code> or <code>""</code>
131+
would bind to an existing PersistentVolume resource with storageClassName also set to
132+
<code>null</code> or <code>""</code>.
117133
-->
118134
### Null `storageClassName``storageClassName: ""` - 有什么影响? {#null-vs-empty-string}
119135

@@ -123,7 +139,10 @@ Before this feature was introduced, those values were equal in terms of behavior
123139

124140
<!--
125141
With this new feature enabled we wanted to maintain this behavior but also be able to update the StorageClass name.
126-
With these constraints in mind, the feature changes the semantics of <code>null</code>. If a default StorageClass is present, <code>null</code> would translate to "Give me a default" and <code>""</code> would mean "Give me PersistentVolume that also has <code>""</code> StorageClass name." In the absence of a StorageClass, the behavior would remain unchanged.
142+
With these constraints in mind, the feature changes the semantics of <code>null</code>.
143+
If a default StorageClass is present, <code>null</code> would translate to "Give me a default" and
144+
<code>""</code> would mean "Give me PersistentVolume that also has <code>""</code> StorageClass name."
145+
In the absence of a StorageClass, the behavior would remain unchanged.
127146
-->
128147
启用此新特性时,我们希望保持此行为,但也希望能够更新 StorageClass 名称。
129148
考虑到这些限制,此特性更改了 `null` 的语义。
@@ -132,7 +151,8 @@ With these constraints in mind, the feature changes the semantics of <code>null<
132151
所以行为将保持不变。
133152

134153
<!--
135-
Summarizing the above, we've changed the semantics of <code>null</code> so that its behavior depends on the presence or absence of a definition of default StorageClass.
154+
Summarizing the above, we've changed the semantics of <code>null</code> so that
155+
its behavior depends on the presence or absence of a definition of default StorageClass.
136156
137157
The tables below show all these cases to better describe when PVC binds and when its StorageClass gets updated.
138158
-->
@@ -179,7 +199,9 @@ The tables below show all these cases to better describe when PVC binds and when
179199
<!--
180200
## How to use it
181201
182-
If you want to test the feature whilst it's alpha, you need to enable the relevant feature gate in the kube-controller-manager and the kube-apiserver. Use the `--feature-gates` command line argument:
202+
If you want to test the feature whilst it's alpha, you need to enable the relevant
203+
feature gate in the kube-controller-manager and the kube-apiserver.
204+
Use the `--feature-gates` command line argument:
183205
-->
184206
## 如何使用 {#how-to-use-it}
185207

@@ -218,15 +240,17 @@ If you would like to see the feature in action and verify it works fine in your
218240
```
219241
220242
<!--
221-
2. Create the PersistentVolumeClaim when there is no default StorageClass. The PVC won't provision or bind (unless there is an existing, suitable PV already present) and will remain in <code>Pending</code> state.
243+
2. Create the PersistentVolumeClaim when there is no default StorageClass.
244+
The PVC won't provision or bind (unless there is an existing, suitable PV already present)
245+
and will remain in <code>Pending</code> state.
222246
-->
223247
2. 在没有默认 StorageClass 时创建 PersistentVolumeClaim。
224248
PVC 不会制备或绑定(除非当前已存在一个合适的 PV),PVC 将保持在 `Pending` 状态。
225249

226250
```
227251
$ kc get pvc
228252
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
229-
pvc-1 Pending
253+
pvc-1 Pending
230254
```
231255
232256
<!--
@@ -253,7 +277,10 @@ If you would like to see the feature in action and verify it works fine in your
253277
<!--
254278
### New metrics
255279
256-
To help you see that the feature is working as expected we also introduced a new <code>retroactive_storageclass_total</code> metric to show how many times that the PV controller attempted to update PersistentVolumeClaim, and <code>retroactive_storageclass_errors_total</code> to show how many of those attempts failed.
280+
To help you see that the feature is working as expected we also introduced a new
281+
<code>retroactive_storageclass_total</code> metric to show how many times that the
282+
PV controller attempted to update PersistentVolumeClaim, and
283+
<code>retroactive_storageclass_errors_total</code> to show how many of those attempts failed.
257284
-->
258285
### 新指标 {#new-metrics}
259286
@@ -264,7 +291,8 @@ To help you see that the feature is working as expected we also introduced a new
264291
<!--
265292
## Getting involved
266293
267-
We always welcome new contributors so if you would like to get involved you can join our [Kubernetes Storage Special-Interest-Group](https://github.com/kubernetes/community/tree/master/sig-storage) (SIG).
294+
We always welcome new contributors so if you would like to get involved you can
295+
join our [Kubernetes Storage Special-Interest-Group](https://github.com/kubernetes/community/tree/master/sig-storage) (SIG).
268296
269297
If you would like to share feedback, you can do so on our [public Slack channel](https://app.slack.com/client/T09NY5SBT/C09QZFCE5).
270298

content/zh-cn/blog/_posts/2023-03-17-kubernetes-1.27-deprecations-and-removals.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,20 @@ Kubernetes v1.25 版本还稳定了对 DaemonSet Pod 的浪涌支持,
402402
其实现是为了最大限度地减少部署期间 DaemonSet 的停机时间。
403403
`DaemonSetUpdateSurge` 特性门控将在 Kubernetes v1.27 中被移除。
404404

405+
<!--
406+
### Removal of `--container-runtime` command line argument
407+
-->
408+
### 移除 `--container-runtime` 命令行参数
409+
410+
<!--
411+
The kubelet accepts a deprecated command line argument, `--container-runtime`, and the only
412+
valid value would be `remote` after dockershim code is removed. Kubernetes v1.27 will remove
413+
that argument, which has been deprecated since the v1.24 release.
414+
-->
415+
kubelet 接受一个已弃用的命令行参数 `--container-runtime`
416+
并且在移除 dockershim 代码后,唯一有效的值将是 `remote`
417+
Kubernetes v1.27 将移除该参数,该参数自 v1.24 版本以来已被弃用。
418+
405419
<!--
406420
## Looking ahead
407421

0 commit comments

Comments
 (0)