|
| 1 | +--- |
| 2 | +layout: blog |
| 3 | +title: "Kubernetes 1.29: Single Pod Access Mode for PersistentVolumes Graduates to Stable" |
| 4 | +date: 2023-12-18 |
| 5 | +slug: read-write-once-pod-access-mode-ga |
| 6 | +--- |
| 7 | + |
| 8 | +**Author:** Chris Henzie (Google) |
| 9 | + |
| 10 | +With the release of Kubernetes v1.29, the `ReadWriteOncePod` volume access mode |
| 11 | +has graduated to general availability: it's part of Kubernetes' stable API. In |
| 12 | +this blog post, I'll take a closer look at this access mode and what it does. |
| 13 | + |
| 14 | +## What is `ReadWriteOncePod`? |
| 15 | + |
| 16 | +`ReadWriteOncePod` is an access mode for |
| 17 | +[PersistentVolumes](/docs/concepts/storage/persistent-volumes/#persistent-volumes) (PVs) |
| 18 | +and [PersistentVolumeClaims](/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims) (PVCs) |
| 19 | +introduced in Kubernetes v1.22. This access mode enables you to restrict volume |
| 20 | +access to a single pod in the cluster, ensuring that only one pod can write to |
| 21 | +the volume at a time. This can be particularly useful for stateful workloads |
| 22 | +that require single-writer access to storage. |
| 23 | + |
| 24 | +For more context on access modes and how `ReadWriteOncePod` works read |
| 25 | +[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) |
| 26 | +in the _Introducing Single Pod Access Mode for PersistentVolumes_ article from 2021. |
| 27 | + |
| 28 | +## How can I start using `ReadWriteOncePod`? |
| 29 | + |
| 30 | +The `ReadWriteOncePod` volume access mode is available by default in Kubernetes |
| 31 | +versions v1.27 and beyond. In Kubernetes v1.29 and later, the Kubernetes API |
| 32 | +always recognizes this access mode. |
| 33 | + |
| 34 | +Note that `ReadWriteOncePod` is |
| 35 | +[only supported for CSI volumes](/docs/concepts/storage/persistent-volumes/#access-modes), |
| 36 | +and before using this feature, you will need to update the following |
| 37 | +[CSI sidecars](https://kubernetes-csi.github.io/docs/sidecar-containers.html) |
| 38 | +to these versions or greater: |
| 39 | + |
| 40 | +- [csi-provisioner:v3.0.0+](https://github.com/kubernetes-csi/external-provisioner/releases/tag/v3.0.0) |
| 41 | +- [csi-attacher:v3.3.0+](https://github.com/kubernetes-csi/external-attacher/releases/tag/v3.3.0) |
| 42 | +- [csi-resizer:v1.3.0+](https://github.com/kubernetes-csi/external-resizer/releases/tag/v1.3.0) |
| 43 | + |
| 44 | +To start using `ReadWriteOncePod`, you need to create a PVC with the |
| 45 | +`ReadWriteOncePod` access mode: |
| 46 | + |
| 47 | +```yaml |
| 48 | +kind: PersistentVolumeClaim |
| 49 | +apiVersion: v1 |
| 50 | +metadata: |
| 51 | + name: single-writer-only |
| 52 | +spec: |
| 53 | + accessModes: |
| 54 | + - ReadWriteOncePod # Allows only a single pod to access single-writer-only. |
| 55 | + resources: |
| 56 | + requests: |
| 57 | + storage: 1Gi |
| 58 | +``` |
| 59 | +
|
| 60 | +If your storage plugin supports |
| 61 | +[Dynamic provisioning](/docs/concepts/storage/dynamic-provisioning/), then |
| 62 | +new PersistentVolumes will be created with the `ReadWriteOncePod` access mode |
| 63 | +applied. |
| 64 | + |
| 65 | +Read [Migrating existing PersistentVolumes](/blog/2021/09/13/read-write-once-pod-access-mode-alpha/#migrating-existing-persistentvolumes) |
| 66 | +for details on migrating existing volumes to use `ReadWriteOncePod`. |
| 67 | + |
| 68 | +## How can I learn more? |
| 69 | + |
| 70 | +Please see the blog posts [alpha](/blog/2021/09/13/read-write-once-pod-access-mode-alpha), |
| 71 | +[beta](/blog/2023/04/20/read-write-once-pod-access-mode-beta), and |
| 72 | +[KEP-2485](https://github.com/kubernetes/enhancements/blob/master/keps/sig-storage/2485-read-write-once-pod-pv-access-mode/README.md) |
| 73 | +for more details on the `ReadWriteOncePod` access mode and motivations for CSI |
| 74 | +spec changes. |
| 75 | + |
| 76 | +## How do I get involved? |
| 77 | + |
| 78 | +The [Kubernetes #csi Slack channel](https://kubernetes.slack.com/messages/csi) |
| 79 | +and any of the standard |
| 80 | +[SIG Storage communication channels](https://github.com/kubernetes/community/blob/master/sig-storage/README.md#contact) |
| 81 | +are great methods to reach out to the SIG Storage and the CSI teams. |
| 82 | + |
| 83 | +Special thanks to the following people whose thoughtful reviews and feedback helped shape this feature: |
| 84 | + |
| 85 | +* Abdullah Gharaibeh (ahg-g) |
| 86 | +* Aldo Culquicondor (alculquicondor) |
| 87 | +* Antonio Ojea (aojea) |
| 88 | +* David Eads (deads2k) |
| 89 | +* Jan Šafránek (jsafrane) |
| 90 | +* Joe Betz (jpbetz) |
| 91 | +* Kante Yin (kerthcet) |
| 92 | +* Michelle Au (msau42) |
| 93 | +* Tim Bannister (sftim) |
| 94 | +* Xing Yang (xing-yang) |
| 95 | + |
| 96 | +If you’re interested in getting involved with the design and development of CSI |
| 97 | +or any part of the Kubernetes storage system, join the |
| 98 | +[Kubernetes Storage Special Interest Group](https://github.com/kubernetes/community/tree/master/sig-storage) (SIG). |
| 99 | +We’re rapidly growing and always welcome new contributors. |
0 commit comments