@@ -149,6 +149,8 @@ elsewhere in GCP.
149
149
1. Create a `VolumeSnapshot` resource which will be bound to a pre-provisioned
150
150
`VolumeSnapshotContents`. Note this is called `restored-snapshot`; this
151
151
name can be changed, but do it consistently across the other resources.
152
+ `VolumeSnapshotContentName` field must reference to the
153
+ VolumeSnapshotContent's name for the bidirectional binding to be valid.
152
154
```console
153
155
kubectl apply -f - <<EOF
154
156
apiVersion: snapshot.storage.k8s.io/v1beta1
@@ -158,22 +160,24 @@ elsewhere in GCP.
158
160
spec:
159
161
volumeSnapshotClassName: csi-gce-pd-snapshot-class
160
162
source:
161
- volumeSnapshotContentName: snapcontent-migrated
163
+ volumeSnapshotContentName: restored-snapshot-content
162
164
EOF
163
165
```
164
166
1. Create a `VolumeSnapshotContents` pointing to your existing PD
165
- snapshot from the first step.
167
+ snapshot from the first step. Both `volumeSnapshotRef.name` and
168
+ `volumeSnapshotRef.namespace` must point to the previously created
169
+ VolumeSnapshot for the bidirectional binding to be valid.
166
170
```console
167
171
kubectl apply -f - <<EOF
168
172
apiVersion: snapshot.storage.k8s.io/v1beta1
169
- kind: VolumeSnapshotContents
173
+ kind: VolumeSnapshotContent
170
174
metadata:
171
175
name: restored-snapshot-content
172
176
spec:
173
177
deletionPolicy: Retain
174
178
driver: pd.csi.storage.gke.io
175
179
source:
176
- snapshotHandle: projects/$PROJECT_ID/global/snapshots/$SNAPSHOT_ID
180
+ snapshotHandle: projects/$PROJECT_ID/global/snapshots/$SNAPSHOT_NAME
177
181
volumeSnapshotRef:
178
182
kind: VolumeSnapshot
179
183
name: restored-snapshot
0 commit comments