Code Monkey home page Code Monkey logo

Comments (4)

smuda avatar smuda commented on August 11, 2024 1

Only as long as the cluster is healthy :-)

So the PVC we create have a nice, understandable name which, especially in the context of a namespace, makes sense:

NAME                         STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS
alert-pg                     Bound    pvc-cc3f3d08-f0ef-4769-a9c7-bf0901b108eb   5Gi        RWO            nfs-csi       
...

But the automatically created PVs does not get understandable names:

NAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                                             STORAGECLASS   REASON 
pvc-cc3f3d08-f0ef-4769-a9c7-bf0901b108eb   5Gi        RWO            Delete           Bound    bd/alert-pg                                       nfs-csi
...

So even though the PV name ("pvc-cc3f3d08-f0ef-4769-a9c7-bf0901b108eb") is included in the path, it doesn't really tell me anything (not even namespace) when trying to restore the PVs after the cluster has gone "boom".

In my context, I'd like to create the snapshots inside a directory for the namespace with a name taken from the PVC, and of course some kind of uid (or date/time?) to distinguish between the snapshots, for example:
subdir="snapshots/${vs.metadata.namespace}/${vs.spec.source.persistentVolumeClaimName}"

from csi-driver-nfs.

andyzhangx avatar andyzhangx commented on August 11, 2024

@smuda the *.tar.gz already contains the pv name, check below logs, is that enough?

[pod/csi-test-controller-9784fb589-nprbv/nfs] I1213 02:44:38.584541       1 utils.go:108] GRPC call: /csi.v1.Controller/CreateSnapshot
[pod/csi-test-controller-9784fb589-nprbv/nfs] I1213 02:44:38.584560       1 utils.go:109] GRPC request: {"name":"snapshot-a56cdc8b-a0e2-4f46-b3a0-916ffed068eb","source_volume_id":"nfs-server.default.svc.cluster.local##pvc-9e6bdd5a-c6c0-466a-b0b5-9b6cbf84a0ac##"}
[pod/csi-test-controller-9784fb589-nprbv/nfs] I1213 02:44:38.618522       1 nodeserver.go:144] volume(nfs-server.default.svc.cluster.local##pvc-9e6bdd5a-c6c0-466a-b0b5-9b6cbf84a0ac##) mount nfs-server.default.svc.cluster.local:/ on /tmp/pvc-9e6bdd5a-c6c0-466a-b0b5-9b6cbf84a0ac succeeded
[pod/csi-test-controller-9784fb589-nprbv/nfs] I1213 02:44:38.618649       1 controllerserver.go:357] archiving /tmp/pvc-9e6bdd5a-c6c0-466a-b0b5-9b6cbf84a0ac/pvc-9e6bdd5a-c6c0-466a-b0b5-9b6cbf84a0ac -> /tmp/snapshot-a56cdc8b-a0e2-4f46-b3a0-916ffed068eb/snapshot-a56cdc8b-a0e2-4f46-b3a0-916ffed068eb/pvc-9e6bdd5a-c6c0-466a-b0b5-9b6cbf84a0ac.tar.gz
[pod/csi-test-controller-9784fb589-nprbv/nfs] I1213 02:44:38.622663       1 controllerserver.go:362] archived /tmp/pvc-9e6bdd5a-c6c0-466a-b0b5-9b6cbf84a0ac/pvc-9e6bdd5a-c6c0-466a-b0b5-9b6cbf84a0ac -> /tmp/snapshot-a56cdc8b-a0e2-4f46-b3a0-916ffed068eb/snapshot-a56cdc8b-a0e2-4f46-b3a0-916ffed068eb/pvc-9e6bdd5a-c6c0-466a-b0b5-9b6cbf84a0ac.tar.gz

from csi-driver-nfs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.