Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add volume snapshot and clone support #3355

Merged
merged 7 commits into from
Oct 18, 2018

Conversation

qiell
Copy link
Contributor

@qiell qiell commented Sep 26, 2018

This PR will add volume snapshot and clone support. This PR contains all the requirements stated in #3316 please refer same for the k8s level details related to this change.

screenshot from 2018-09-26 15-40-26

fixes: #3316

@bboreham
Copy link
Collaborator

bboreham commented Oct 3, 2018

Thanks for this. Sorry I haven't been able to do a review yet; please bear with us.

@qiell
Copy link
Contributor Author

qiell commented Oct 3, 2018

It's Ok @bboreham 😃

@qiell qiell force-pushed the volume-snapshot branch 3 times, most recently from cea235c to fe287a1 Compare October 10, 2018 12:22
Copy link
Collaborator

@bboreham bboreham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. Good job on the unit tests.
Overall this PR looks solid, but I dislike the amount of repetition in the kubernetes part of the probe.
I'm going to suggest that is reworked as a separate exercise.

// GetTag returns the current topology tag, or the default if there isn't one.
func (t Topology) GetTag() string {
if t.Tag == "" {
return None

This comment was marked as abuse.

This comment was marked as abuse.

Akash Srivastava added 5 commits October 16, 2018 01:04
Tag can be used to specify the sub-shape for the given node.

Signed-off-by: Akash Srivastava <akash.srivastava@openebs.io>
- Snapshot is a CRD residing in kubernetes-incubator/external-storage

It doesn't have a proper clientset.

- A PR for proper clientset is already raised.
Until the PR is merged, we are using openebs/k8s-snapshot-client
as a snapshot client.

Signed-off-by: Akash Srivastava <akash.srivastava@openebs.io>
- Add a new client in probe/kubernetes/client.go
  which will be used to fetch details of Snapshot CRD
- Visualize VolumeSnapshot and VolumeSnapshotData
- Add adjacency between PV and VolumeSnapshot
- Add adjacency between VolumeSnapshot and VolumeSnapshotData
- Add snapshot filter to hide and show snapshots

Signed-off-by: Akash Srivastava <akash.srivastava@openebs.io>
Signed-off-by: Akash Srivastava <akash.srivastava@openebs.io>
- Add control on volume snapshot to take clone
- Add control on volume snapshot to delete it

Signed-off-by: Akash Srivastava <akash.srivastava@openebs.io>
@bboreham
Copy link
Collaborator

Some more questions:

  • What happens if someone doesn't have the CRD installed in their cluster, do they get error messages?
  • Is there a need to add volume snapshots to the RBAC settings?

@qiell
Copy link
Contributor Author

qiell commented Oct 17, 2018

Hi @bboreham

What happens if someone doesn't have the CRD installed in their cluster, do they get error messages?

In the probe logs, we'll see

2018-10-17T05:40:43.284962201Z <probe> INFO: 2018/10/17 05:40:43.284795 volumesnapshotdatas are not supported by this Kubernetes version
2018-10-17T05:40:43.291742557Z <probe> INFO: 2018/10/17 05:40:43.291506 volumesnapshots are not supported by this Kubernetes version

Is there a need to add volume snapshots to the RBAC settings?

Yes, we need to add this is RBAC settings.

- apiGroups: ["volumesnapshot.external-storage.k8s.io"]
  resources: ["volumesnapshots", "volumesnapshotdatas"]
  verbs: ["get", "list", "watch", "create", "delete"]

committing changes for RBAC in scope deploy yaml in examples.

Akash Srivastava and others added 2 commits October 17, 2018 17:53
This will add rules to cluster role for k8s snapshot components.
These RBAC permissions are required for scope to fetch details about
volumesnapshots and volumesnapshotdata resources.

Signed-off-by: Akash Srivastava <akash.srivastava@openebs.io>
@bboreham bboreham merged commit 1b71a10 into weaveworks:master Oct 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal: Add snapshot & clone support for k8s volumes to Weave Scope
2 participants