rootfs / snapshot

Kubernetes Volume Snapshot Controller using Custom Resource Definition
Apache License 2.0
12 stars 7 forks source link

Snapshot controller flow rework #17

Closed xing-yang closed 6 years ago

xing-yang commented 6 years ago

This patch modified the snapshot controller flow. It works as follows:

  1. Check the status of VolumeSnapshot object and determine the next step.
    1. Retrieve metadata from VolumeSnapshot object if existing; otherwise create metadata and update VolumeSnapshot object. If metadata pre-existing, find snapshot through volume plugin; If metadata newly created, take snapshot through volume plugin.
    2. Create VolumeSnapshotData object with a reference to the snapshot by the plugin. Update VolumeSnapshot object status and also bind VolumeSnapshotData to VolumeSnapshot.
    3. Query the volume plugin for the status of the snapshot with snapshot id from VolumeSnapshotData object until snapshot is ready. Update VolumeSnapshot and VolumeSnapshotData.

Also added FindSnapshot (find snapshot by metadata) in the cloudprovider. Implemented for OpenStack, not for AWS and GCE yet.

rootfs commented 6 years ago

Thanks! @xing-yang

I cherry picked to controller-rework branch. Let's merge back when we have ebs and gce work.

xing-yang commented 6 years ago

Thanks @rootfs !

tsmetana commented 6 years ago

Nice job @xing-yang. Thank you.