Proposal: Add snapshot & clone support for k8s volumes to Weave Scope
Now that weave scope supports Kubernetes Volumes, it would be great to have snapshot and clone support built in Weave Scope.
- Allow user to take a snapshot for the Kubernetes Volume using Weave Scope.
- Allow user to restore a snapshot i.e. create a clone from the snapshot using Weave Scope.
- Allow user to visualize and manage the snapshot & clone resources through Weave Scope.
Snapshot is the current state of the Kubernetes persistent volume. Kubernetes snapshotting proposal can be found here. Snapshot creates two types of objects,
- VolumeSnapshot
- VolumeSnapshotData
Snapshot Clone
+--------+ +---------+ +---------+
| | | | | |
| PV +------------> |Volume +-------> | PVC |
| | |Sanpshot | | |
+----+---+ +----+----+ +----+----+
| | |
| | |
+----+---+ +----+----+ +----+----+
| | |Volume | | |
| PVC | |Snapshot | | PV |
| | |Data | | |
+--------+ +---------+ +---------+
-
Snapshot is a Kubernetes CRD known as
volumesnapshots.volumesnapshot.external-storage.k8s.io
and implemented in the kubernetes-incubator/external-storage. -
Add control on the PVC Node in Weave Scope for snapshot.
-
Name for
VolumeSnapshot
Node:Name for the snapshot object should be unique and should contain timestamp. Hence,
snapshot-timestamp-uuid
-
Shape for snapshot object:
(Need suggestion)
-
Shape for control icon:
(Need suggestion)
-
Adjacency for the snapshot:
VolumeSnapshot
k8s resource contain name of theVolumeSnapshotData
. Hence, link can be shown among these two objects.VolumeSnapshot
can be connected to the PVC object.
Snapshot can be restored to PVC & PV, these restored PVC & PV objects are known as clones. Data restoration should be done using Weave Scope. Add control to VolumeSnapshot
node to restore the data in the form of PVC & PV.
- Add control on the VolumeSnapshot Node in Weave Scope for snapshot.
- Name for
VolumeSnapshot
Node:snapshotdata-timestamp-uuid
- Shape for snapshot object:
Shape will be similar to the existing PVC & PV objects.
- Shape for control icon:
(Need suggestion)
- Adjacency for the snapshot:
Adjacency should be drawn as per current adjacency of PVC & PV objects.
-
Upgrade client-go to 8.0.0
Snapshot support is recently added to the Kubernetes as a external plugin/out-tree here which uses client-go version
8.0.0
.To implement snapshot support in Weave Scope, we need
clientset
for the Kubernetes API Object, that's Snapshot CRD in this case. As of today, snapshot CRD lacks implementation of versioned kubernetes client i.eclientset
. There's ongoing PR for the same. It seems PR is in the pending state. Hence, We've created external repo which contains generated clientset. -
Add support to show
VolumeSnapshot
&VolumeSnapshotData
on Weave Scope -
Add control to PVC to create a
VolumeSnapshot
-
Add control to
VolumeSnapshot
to create a clone