Skip to content

Commit 295e9cd

Browse files
committed
Refer snapshot metadata client pod manifest from repo
Signed-off-by: Prasad Ghangal <[email protected]>
1 parent 0c52080 commit 295e9cd

File tree

2 files changed

+6
-32
lines changed

2 files changed

+6
-32
lines changed

deploy/kubernetes-1.27/hostpath/csi-snapshot-metadata-sidecar.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
- name: csi-snapshot-metadata
22
# TODO: Replace main tag with actual released tag once external-snapshot-metadata is released
3-
image: gcr.io/k8s-staging-sig-storage/csi-snapshot-metadata:main
3+
image: gcr.io/k8s-staging-sig-storage/csi-snapshot-metadata:canary
44
imagePullPolicy: "Always"
55
command:
66
args:

docs/example-snapshot-metadata.md

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Follow the steps below to deploy CSI Hostpath driver with SnapshotMetadata servi
2222
$ SNAPSHOT_METADATA_TESTS=true ./deploy/kubernetes-1.27/deploy.sh
2323
```
2424

25-
### Sample SnapshotMetadata client
25+
### Setup SnapshotMetadata client
2626

2727
The `SnapshotMetadata` service implements gRPC APIs. A gRPC client can query these APIs to retrieve metadata about the allocated blocks of a CSI VolumeSnapshot or the changed blocks between any two CSI VolumeSnapshot objects.
2828

@@ -56,37 +56,11 @@ Follow the following steps to setup client with all the required permissions:
5656
$ kubectl create clusterrolebinding csi-client-cluster-role-binding --clusterrole=external-snapshot-metadata-client-runner --serviceaccount=csi-client:csi-client-sa
5757
```
5858

59-
2. Deploy sample client pod
59+
2. Deploy sample client pod which contains [snapshot-metadata-lister](https://github.com/kubernetes-csi/external-snapshot-metadata) tool which can be used as a client to call SnapshotMetadata APIs
6060

61-
Create a pod in which we'll be installing and running the client
62-
63-
```
64-
$ kubectl apply -f - <<EOF
65-
apiVersion: v1
66-
kind: Pod
67-
metadata:
68-
name: csi-client
69-
namespace: csi-client
70-
spec:
71-
containers:
72-
- name: golang
73-
image: golang:1.23.4
74-
command: ["tail", "-f", "/dev/null"]
75-
serviceAccountName: csi-client-sa
76-
EOF
7761
```
78-
79-
3. Install SnapshotMetadata client in the pod
80-
81-
Exec into the pod, clone the client repo and build the client from source
82-
62+
$ kubectl create -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshot-metadata/main/examples/snapshot-metadata-lister/deploy/snapshot-medata-lister-pod.yaml -n csi-client
8363
```
84-
$ kubectl exec -ti -n csi-client csi-client -- bash
85-
86-
## Install snapshot-metadata-lister
87-
root@csi-client:/go# go install github.com/kubernetes-csi/external-snapshot-metadata/examples/snapshot-metadata-lister@latest
88-
```
89-
9064
9165
This client performs following actions:
9266
1. Find Driver name for the snapshot.
@@ -176,7 +150,7 @@ This client performs following actions:
176150
5. Now, inside `csi-client` pod which is created in previous steps, use `snapshot-metadata-lister` tool query allocated blocks metadata
177151
178152
```
179-
$ kubectl exec -n csi-client csi-client -- snapshot-metadata-lister -n default -s raw-pvc-snap-1
153+
$ kubectl exec -n csi-client csi-client -c run-client -- /tools/snapshot-metadata-lister -n default -s raw-pvc-snap-1
180154
181155
Record# VolCapBytes BlockMetadataType ByteOffset SizeBytes
182156
------- -------------- ----------------- -------------- --------------
@@ -256,7 +230,7 @@ This client performs following actions:
256230
3. Using `external-snapshot-metadata-client` which uses `GetMetadataDelta` gRPC to allocated blocks metadata
257231
258232
```
259-
$ kubectl exec -n csi-client csi-client -- snapshot-metadata-lister -n default -s raw-pvc-snap-1 -p raw-pvc-snap-2
233+
$ kubectl exec -n csi-client csi-client -c run-client -- /tools/snapshot-metadata-lister -n default -s raw-pvc-snap-1 -p raw-pvc-snap-2
260234
261235
262236
Record# VolCapBytes BlockMetadataType ByteOffset SizeBytes

0 commit comments

Comments
 (0)