|
| 1 | +--- |
| 2 | +layout: blog |
| 3 | +title: "Kubernetes 1.27: Single Pod Access Mode for PersistentVolumes Graduates to Beta" |
| 4 | +date: 2023-04-20 |
| 5 | +slug: read-write-once-pod-access-mode-beta |
| 6 | +--- |
| 7 | +<!-- |
| 8 | +layout: blog |
| 9 | +title: "Kubernetes 1.27:持久卷的单个Pod访问模式升级为Beta版" |
| 10 | +date: 2023-04-20 |
| 11 | +slug: read-write-once-pod-access-mode-beta |
| 12 | +--> |
| 13 | + |
| 14 | +<!-- |
| 15 | +**Author:** Chris Henzie (Google) |
| 16 | +--> |
| 17 | +**作者**:Chris Henzie (Google) |
| 18 | + |
| 19 | +**译者**:顾欣 (ICBC) |
| 20 | + |
| 21 | +<!-- |
| 22 | +With the release of Kubernetes v1.27 the ReadWriteOncePod feature has graduated |
| 23 | +to beta. In this blog post, we'll take a closer look at this feature, what it |
| 24 | +does, and how it has evolved in the beta release. |
| 25 | +--> |
| 26 | +随着 Kubernetes v1.27 的发布,ReadWriteOncePod 功能已经升级为 Beta 版。 |
| 27 | +在这篇博客文章中,我们将更详细地介绍这个功能,作用以及在 Beta 版本中的发展。 |
| 28 | + |
| 29 | +<!-- |
| 30 | +## What is ReadWriteOncePod? |
| 31 | +--> |
| 32 | +## 什么是 ReadWriteOncePod {#what-is-readwriteoncepod} |
| 33 | + |
| 34 | +<!-- |
| 35 | +ReadWriteOncePod is a new access mode for |
| 36 | +[PersistentVolumes](/docs/concepts/storage/persistent-volumes/#persistent-volumes) (PVs) |
| 37 | +and [PersistentVolumeClaims](/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims) (PVCs) |
| 38 | +introduced in Kubernetes v1.22. This access mode enables you to restrict volume |
| 39 | +access to a single pod in the cluster, ensuring that only one pod can write to |
| 40 | +the volume at a time. This can be particularly useful for stateful workloads |
| 41 | +that require single-writer access to storage. |
| 42 | +--> |
| 43 | +ReadWriteOncePod 是 Kubernetes 在 v1.22 中引入的一种新的访问模式, |
| 44 | +适用于 [PersistentVolume](/zh-cn/docs/concepts/storage/persistent-volumes/#persistent-volumes)(PVs) |
| 45 | +和 [PersistentVolumeClaim](/zh-cn/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims)(PVCs)。 |
| 46 | +此访问模式使你能够将存储卷访问限制在集群中的单个 Pod 上,确保一次只有一个 Pod 可以写入存储卷。 |
| 47 | +这可能对需要单一写入者访问存储的有状态工作负载特别有用。 |
| 48 | + |
| 49 | +<!-- |
| 50 | +For more context on access modes and how ReadWriteOncePod works read |
| 51 | +[What are access modes and why are they important?](/blog/2021/09/13/read-write-once-pod-access-mode-alpha/#what-are-access-modes-and-why-are-they-important) |
| 52 | +in the _Introducing Single Pod Access Mode for PersistentVolumes_ article from 2021. |
| 53 | +--> |
| 54 | +要了解有关访问模式和 ReadWriteOncePod 如何工作的更多背景信息, |
| 55 | +请阅读 2021 年介绍 PersistentVolume 的单个 Pod 访问模式的文章中的[什么是访问模式和为什么它们如此重要?](/blog/2021/09/13/read-write-once-pod-access-mode-alpha/#what-are-access-modes-and-why-are-they-important)。 |
| 56 | + |
| 57 | +<!-- |
| 58 | +## Changes in the ReadWriteOncePod beta |
| 59 | +--> |
| 60 | +## ReadWriteOncePod 的 Beta 版中变化 {#changes-in-the-readwriteoncepod-beta} |
| 61 | + |
| 62 | +<!-- |
| 63 | +The ReadWriteOncePod beta adds support for |
| 64 | +[scheduler preemption](/docs/concepts/scheduling-eviction/pod-priority-preemption/) |
| 65 | +of pods using ReadWriteOncePod PVCs. |
| 66 | +--> |
| 67 | +ReadWriteOncePod Beta 版为使用 ReadWriteOncePod PVC 的 Pod 添加[调度器抢占](/zh-cn/docs/concepts/scheduling-eviction/pod-priority-preemption/)。 |
| 68 | + |
| 69 | +<!-- |
| 70 | +Scheduler preemption allows higher-priority pods to preempt lower-priority pods, |
| 71 | +so that they can start running on the same node. With this release, pods using |
| 72 | +ReadWriteOncePod PVCs can also be preempted if a higher-priority pod requires |
| 73 | +the same PVC. |
| 74 | +--> |
| 75 | +调度器抢占允许更高优先级的 Pod 抢占较低优先级的 Pod,以便它们可以在同一节点上运行。 |
| 76 | +在此版本中,如果更高优先级的 Pod 需要相同的 PVC,使用 ReadWriteOncePod PVCs 的 Pod 也可以被抢占。 |
| 77 | + |
| 78 | +<!-- |
| 79 | +## How can I start using ReadWriteOncePod? |
| 80 | +--> |
| 81 | +## 如何开始使用 ReadWriteOncePod? {#how-can-i-start-using-readwriteoncepod} |
| 82 | + |
| 83 | +<!-- |
| 84 | +With ReadWriteOncePod now in beta, it will be enabled by default in cluster |
| 85 | +versions v1.27 and beyond. |
| 86 | +--> |
| 87 | +随着 ReadWriteOncePod 现已升级为 Beta 版,在 v1.27 及更高版本的集群中将默认启用该功能。 |
| 88 | + |
| 89 | +<!-- |
| 90 | +Note that ReadWriteOncePod is |
| 91 | +[only supported for CSI volumes](/docs/concepts/storage/persistent-volumes/#access-modes). |
| 92 | +Before using this feature you will need to update the following |
| 93 | +[CSI sidecars](https://kubernetes-csi.github.io/docs/sidecar-containers.html) |
| 94 | +to these versions or greater: |
| 95 | +--> |
| 96 | +请注意,ReadWriteOncePod [仅支持 CSI 卷](/zh-cn/docs/concepts/storage/persistent-volumes/#access-modes)。 |
| 97 | +在使用此功能之前,你需要将以下 [CSI Sidecars](https://kubernetes-csi.github.io/docs/sidecar-containers.html)更新至以下版本或更高版本: |
| 98 | + |
| 99 | +<!-- |
| 100 | +- [csi-provisioner:v3.0.0+](https://github.com/kubernetes-csi/external-provisioner/releases/tag/v3.0.0) |
| 101 | +- [csi-attacher:v3.3.0+](https://github.com/kubernetes-csi/external-attacher/releases/tag/v3.3.0) |
| 102 | +- [csi-resizer:v1.3.0+](https://github.com/kubernetes-csi/external-resizer/releases/tag/v1.3.0) |
| 103 | +--> |
| 104 | +- [csi-provisioner:v3.0.0+](https://github.com/kubernetes-csi/external-provisioner/releases/tag/v3.0.0) |
| 105 | +- [csi-attacher:v3.3.0+](https://github.com/kubernetes-csi/external-attacher/releases/tag/v3.3.0) |
| 106 | +- [csi-resizer:v1.3.0+](https://github.com/kubernetes-csi/external-resizer/releases/tag/v1.3.0) |
| 107 | + |
| 108 | +<!-- |
| 109 | +To start using ReadWriteOncePod, create a PVC with the ReadWriteOncePod access mode: |
| 110 | +--> |
| 111 | +要开始使用 ReadWriteOncePod,请创建具有 ReadWriteOncePod 访问模式的 PVC: |
| 112 | + |
| 113 | +```yaml |
| 114 | +kind: PersistentVolumeClaim |
| 115 | +apiVersion: v1 |
| 116 | +metadata: |
| 117 | + name: single-writer-only |
| 118 | +spec: |
| 119 | + accessModes: |
| 120 | + - ReadWriteOncePod #仅允许一个容器访问且独占写入权限。 |
| 121 | + resources: |
| 122 | + requests: |
| 123 | + storage: 1Gi |
| 124 | +``` |
| 125 | +
|
| 126 | +<!-- |
| 127 | +If your storage plugin supports |
| 128 | +[dynamic provisioning](/docs/concepts/storage/dynamic-provisioning/), |
| 129 | +new PersistentVolumes will be created with the ReadWriteOncePod access mode applied. |
| 130 | +
|
| 131 | +Read [Migrating existing PersistentVolumes](/blog/2021/09/13/read-write-once-pod-access-mode-alpha/#migrating-existing-persistentvolumes) |
| 132 | +for details on migrating existing volumes to use ReadWriteOncePod. |
| 133 | +--> |
| 134 | +如果你的存储插件支持[动态制备](/zh-cn/docs/concepts/storage/dynamic-provisioning/), |
| 135 | +新创建的持久卷将应用 ReadWriteOncePod 访问模式。 |
| 136 | +
|
| 137 | +阅读[迁移现有持久卷](/blog/2021/09/13/read-write-once-pod-access-mode-alpha/#migrating-existing-persistentvolumes) |
| 138 | +以了解如何迁移现有卷以使用 ReadWriteOncePod。 |
| 139 | +
|
| 140 | +<!-- |
| 141 | +## How can I learn more? |
| 142 | +--> |
| 143 | +## 如何了解更多信息? {#how-can-i-learn-more} |
| 144 | +
|
| 145 | +<!-- |
| 146 | +Please see the [alpha blog post](/blog/2021/09/13/read-write-once-pod-access-mode-alpha) |
| 147 | +and [KEP-2485](https://github.com/kubernetes/enhancements/blob/master/keps/sig-storage/2485-read-write-once-pod-pv-access-mode/README.md) |
| 148 | +for more details on the ReadWriteOncePod access mode and motivations for CSI spec changes. |
| 149 | +--> |
| 150 | +请查看 [Alpha 版博客](/blog/2021/09/13/read-write-once-pod-access-mode-alpha)和 |
| 151 | +[KEP-2485](https://github.com/kubernetes/enhancements/blob/master/keps/sig-storage/2485-read-write-once-pod-pv-access-mode/README.md) |
| 152 | +以了解关于 ReadWriteOncePod 访问模式的更多详细信息以及对 CSI 规约作更改的动机。 |
| 153 | +
|
| 154 | +<!-- |
| 155 | +## How do I get involved? |
| 156 | +--> |
| 157 | +## 如何参与? {#how-do-i-get-involved} |
| 158 | +
|
| 159 | +<!-- |
| 160 | +The [Kubernetes #csi Slack channel](https://kubernetes.slack.com/messages/csi) |
| 161 | +and any of the standard |
| 162 | +[SIG Storage communication channels](https://github.com/kubernetes/community/blob/master/sig-storage/README.md#contact) |
| 163 | +are great mediums to reach out to the SIG Storage and the CSI teams. |
| 164 | +--> |
| 165 | +[Kubernetes #csi Slack](https://kubernetes.slack.com/messages/csi)频道以及任何常规的 |
| 166 | +[SIG 存储沟通渠道](https://github.com/kubernetes/community/blob/master/sig-storage/README.md#contact) |
| 167 | +都是联系 SIG 存储和 CSI 团队的最佳途径。 |
| 168 | +
|
| 169 | +<!-- |
| 170 | +Special thanks to the following people whose thoughtful reviews and feedback helped shape this feature: |
| 171 | +--> |
| 172 | +特别感谢以下人士的仔细的审查和反馈,帮助完成了这个功能: |
| 173 | +
|
| 174 | +<!-- |
| 175 | +* Abdullah Gharaibeh (ahg-g) |
| 176 | +* Aldo Culquicondor (alculquicondor) |
| 177 | +* Antonio Ojea (aojea) |
| 178 | +* David Eads (deads2k) |
| 179 | +* Jan Šafránek (jsafrane) |
| 180 | +* Joe Betz (jpbetz) |
| 181 | +* Kante Yin (kerthcet) |
| 182 | +* Michelle Au (msau42) |
| 183 | +* Tim Bannister (sftim) |
| 184 | +* Xing Yang (xing-yang) |
| 185 | +--> |
| 186 | +* Abdullah Gharaibeh (ahg-g) |
| 187 | +* Aldo Culquicondor (alculquicondor) |
| 188 | +* Antonio Ojea (aojea) |
| 189 | +* David Eads (deads2k) |
| 190 | +* Jan Šafránek (jsafrane) |
| 191 | +* Joe Betz (jpbetz) |
| 192 | +* Kante Yin (kerthcet) |
| 193 | +* Michelle Au (msau42) |
| 194 | +* Tim Bannister (sftim) |
| 195 | +* Xing Yang (xing-yang) |
| 196 | +
|
| 197 | +<!-- |
| 198 | +If you’re interested in getting involved with the design and development of CSI |
| 199 | +or any part of the Kubernetes storage system, join the |
| 200 | +[Kubernetes Storage Special Interest Group](https://github.com/kubernetes/community/tree/master/sig-storage) (SIG). |
| 201 | +We’re rapidly growing and always welcome new contributors. |
| 202 | +--> |
| 203 | +如果您有兴趣参与 CSI 或 Kubernetes 存储系统的任何部分的设计和开发, |
| 204 | +请加入 [Kubernetes 存储特别兴趣小组](https://github.com/kubernetes/community/tree/master/sig-storage)(SIG)。 |
| 205 | +我们正在迅速发展,始终欢迎新的贡献者。 |
0 commit comments