Skip to content

Commit 06fcd50

Browse files
authored
Merge pull request #33760 from RaunakShah/blog_followup
Updates to blog article for unauthorised volume mode conversion
2 parents 534732f + 348377d commit 06fcd50

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

content/en/blog/_posts/2022-05-18-prevent-unauthorised-volume-mode-conversion.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,31 +53,31 @@ To convert the volume mode, an authorised user must do the following:
5353
created PVC in the given namespace.
5454
2. Identify the `VolumeSnapshotContent` bound to the above `VolumeSnapshot`.
5555

56-
```
57-
kubectl get volumesnapshot -n <namespace>
58-
```
56+
```shell
57+
kubectl get volumesnapshot -n <namespace>
58+
```
5959

6060
3. Add the annotation [`snapshot.storage.kubernetes.io/allowVolumeModeChange`](/docs/reference/labels-annotations-taints/#snapshot-storage-kubernetes-io-allowvolumemodechange)
6161
to the `VolumeSnapshotContent`.
6262

6363
4. This annotation can be added either via software or manually by the authorised
6464
user. The `VolumeSnapshotContent` annotation must look like following manifest fragment:
6565

66-
```yaml
67-
kind: VolumeSnapshotContent
68-
metadata:
69-
annotations:
70-
- snapshot.storage.kubernetes.io/allowVolumeModeChange: "true"
71-
...
72-
```
66+
```yaml
67+
kind: VolumeSnapshotContent
68+
metadata:
69+
annotations:
70+
- snapshot.storage.kubernetes.io/allowVolumeModeChange: "true"
71+
...
72+
```
7373

7474
**Note**: For pre-provisioned `VolumeSnapshotContents`, you must take an extra
7575
step of setting `spec.sourceVolumeMode` field to either `Filesystem` or `Block`,
7676
depending on the mode of the volume from which this snapshot was taken.
7777

7878
An example is shown below:
7979

80-
```yaml
80+
```yaml
8181
apiVersion: snapshot.storage.k8s.io/v1
8282
kind: VolumeSnapshotContent
8383
metadata:
@@ -93,7 +93,7 @@ An example is shown below:
9393
volumeSnapshotRef:
9494
name: new-snapshot-test
9595
namespace: default
96-
```
96+
```
9797
9898
Repeat steps 1 to 3 for all `VolumeSnapshotContents` whose volume mode needs to be
9999
converted during a backup or restore operation.
@@ -112,5 +112,6 @@ what you think!
112112
We hope this feature causes no disruption to existing workflows while preventing
113113
malicious users from exploiting security vulnerabilities in their clusters.
114114

115-
For any issues, create a thread in the #sig-storage slack channel or an issue
116-
in the CSI external-snapshotter [repository](https://github.com/kubernetes-csi/external-snapshotter).
115+
For any queries or issues, join [Kubernetes on Slack](https://slack.k8s.io/) and
116+
create a thread in the #sig-storage channel. Alternately, create an issue in the
117+
CSI external-snapshotter [repository](https://github.com/kubernetes-csi/external-snapshotter).

0 commit comments

Comments
 (0)