{"id":28740991,"url":"https://github.com/aliyuncontainerservice/disk-snapshot","last_synced_at":"2025-07-04T06:07:33.833Z","repository":{"id":89003860,"uuid":"168078779","full_name":"AliyunContainerService/disk-snapshot","owner":"AliyunContainerService","description":"Support Aliyun Disk Snapshot in K8S without CSI Plugin","archived":false,"fork":false,"pushed_at":"2019-02-02T14:19:26.000Z","size":11791,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-16T07:09:49.321Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AliyunContainerService.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-01-29T02:58:33.000Z","updated_at":"2021-01-13T04:52:32.000Z","dependencies_parsed_at":"2023-06-13T13:00:29.625Z","dependency_job_id":null,"html_url":"https://github.com/AliyunContainerService/disk-snapshot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AliyunContainerService/disk-snapshot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliyunContainerService%2Fdisk-snapshot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliyunContainerService%2Fdisk-snapshot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliyunContainerService%2Fdisk-snapshot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliyunContainerService%2Fdisk-snapshot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AliyunContainerService","download_url":"https://codeload.github.com/AliyunContainerService/disk-snapshot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliyunContainerService%2Fdisk-snapshot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263457183,"owners_count":23469290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-16T07:09:48.288Z","updated_at":"2025-07-04T06:07:33.826Z","avatar_url":"https://github.com/AliyunContainerService.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Alibaba Cloud Disk Snapshot Plugin\n\n[![Build Status](https://travis-ci.org/AliyunContainerService/disk-snapshot.svg?branch=master)](https://travis-ci.org/AliyunContainerService/disk-snapshot) [![CircleCI](https://circleci.com/gh/AliyunContainerService/disk-snapshot.svg?style=svg)](https://circleci.com/gh/AliyunContainerService/disk-snapshot) [![Go Report Card](https://goreportcard.com/badge/github.com/AliyunContainerService/disk-snapshot)](https://goreportcard.com/report/github.com/AliyunContainerService/disk-snapshot)\n\n\n## Overview\n\nAn Disk snapshot plugin is available to help simplify storage management.\nOnce user creates VolumeSnapshot with the reference to a snapshot class, snapshot and\ncorresponding VolumeSnapshotContent object gets dynamically created and becomes ready to be used by\nworkloads. \n\nThis implementation does not depend on CSI feature, but use the csi-snapshot designs which will be used as Alpha feature in k8s 1.13.\n\nDisk Snapshot Plugin will create 3 crds as below.\n\n```\nvolumesnapshotclasses.snapshot.storage.k8s.io:  define details to create volumesnapshotcontents, like: storageclass;\nvolumesnapshotcontents.snapshot.storage.k8s.io: define one disk snapshot with the backend, like: pv;\nvolumesnapshots.snapshot.storage.k8s.io:        the claim of one snapshot, like: pvc;\n```\n\n## Requirements\n\n* Disk Snapshot plugin depends on external-snapshotter (registry.cn-hangzhou.aliyuncs.com/plugins/external-snapshotter:snapshot).\n* PVC Datasource feature depends on lastest Disk-Controller (registry-vpc.cn-shenzhen.aliyuncs.com/acs/alicloud-disk-controller:v1.11.2.8-ffc6b5b-aliyun).\n* Secret object with the authentication key for Disk\n* Service Accounts with required RBAC permissions\n\n### Feature Status\nAlpha\n\n## Compiling and Package\ndisk-snapshot can be compiled in a form of a container.\n\nTo build a container:\n```\n$ cd build \u0026\u0026 sh build.sh\n```\n\n## Deploy\n\n### Get Kubernetes cluster\n\nYou can create a Kubernetes Cluster on [Alibaba cloud Container Service](https://help.aliyun.com/product/25972.html?spm=a2c4g.750001.2.3.A7g9FZ)\n\nKubernetes should be 1.12 or after.\n\n### Config api-server、controller manager、scheduler compnents\n\nEdit files as below:\n\n```\n/etc/kubernetes/manifests/kube-apiserver.yaml\n/etc/kubernetes/manifests/kube-controller-manager.yaml\n/etc/kubernetes/manifests/kube-scheduler.yaml\nAdd:\n - --feature-gates=CSINodeInfo=true,CSIDriverRegistry=true,VolumeSnapshotDataSource=true\n```\n\n\u003e Notes：\n\u003e \n\u003e cp /etc/kubernetes/manifests/kube-apiserver.yaml /tmp/kube-apiserver.yaml\n\u003e \n\u003e edit /tmp/kube-apiserver.yaml\n\u003e \n\u003e cp /tmp/kube-apiserver.yaml /etc/kubernetes/manifests/kube-apiserver.yaml\n\n#### Config Kubelet\n\n```\n# vi /etc/systemd/system/kubelet.service.d/10-kubeadm.conf\nAdd:\nEnvironment=\"KUBELET_FEATURE_GATES_ARGS=--feature-gates=CSINodeInfo=true,CSIDriverRegistry=true,VolumeSnapshotDataSource=true\"\n```\nrestart kubelet: \n\n\tsystemctl daemon-reload \u0026\u0026 service kubelet restart\n\n\n### Deploy Snapshot Controller\nIf the cluster not in STS mode, you need to config AK info to plugin; Set ACCESS_KEY_ID, ACCESS_KEY_SECRET to environment;\n\n```\n# kubectl create -f ./deploy/snapshot-controller.yaml\n\n# kubectl get pod -n kube-system | grep alicloud-disk-snapshot\nalicloud-disk-snapshot-89c88c7f7-6z95j                       2/2     Running   0          42s\n```\n\n### Deploy SnapshotClass\n```\n# kubectl create -f ./deploy/snapshotclass.yaml\n\n# kubectl get volumesnapshotclasses.snapshot.storage.k8s.io\nNAME                AGE\ndefault-snapclass   15s\n```\n\n3 CRDs be created：\n\n```\n# kubectl get crd | grep snap\nvolumesnapshotclasses.snapshot.storage.k8s.io    2019-01-16T12:00:46Z\nvolumesnapshotcontents.snapshot.storage.k8s.io   2019-01-16T12:00:46Z\nvolumesnapshots.snapshot.storage.k8s.io          2019-01-16T12:00:46Z\n```\n\n## Usage\n\n### Create Pod with Disk\nCreate a deployment and pvc, using disk volume.\n\n```\n# kubectl create -f ./deploy/deploy-origin.yaml\n\n# kubectl get pod\nNAME                              READY   STATUS    RESTARTS   AGE\ndynamic-create-7fbf55b58f-qnrgm   1/1     Running   0          21s\n\n# kubectl get pvc\nNAME       STATUS   VOLUME                   CAPACITY   ACCESS MODES   STORAGECLASS        AGE\npvc-disk   Bound    d-wz9hhnhxu66zs6r6yyyq   20Gi       RWO            alicloud-disk-ssd   25s\n\n# kubectl exec -ti dynamic-create-7fbf55b58f-qnrgm touch /data/snapshot123\n```\n\n\n### Step 4: Create Snapshot with Pvc\n```\n# kubectl create -f snapshot.yaml\nvolumesnapshot.snapshot.storage.k8s.io/snapshot-test created\n\n# kubectl get volumesnapshots.snapshot.storage.k8s.io\nNAME            AGE\nsnapshot-test   2m\n\n# kubectl get volumesnapshotcontents.snapshot.storage.k8s.io\nNAME                                               AGE\nsnapcontent-77a75b63-1987-11e9-a520-00163e024341   2m\n```\n\n\u003e snapshot.yaml define the data source pvc name, and snapshotClass name.\n\n\n### Create Pvc with Snapshot\n\n```\n# kubectl create -f deploy-datasource.yaml\n# kubectl get pod\nNAME                               READY   STATUS    RESTARTS   AGE\ndynamic-create-7fbf55b58f-qnrgm    1/1     Running   0          10m\ndynamic-snapshot-fdc86b6d8-bl6h5   1/1     Running   0          13s\n\n# kubectl get pvc\nNAME            STATUS   VOLUME                   CAPACITY   ACCESS MODES   STORAGECLASS        AGE\ndisk-snapshot   Bound    d-wz98cj3vphycosrm6joa   20Gi       RWO            alicloud-disk-ssd   4s\npvc-disk        Bound    d-wz9hhnhxu66zs6r6yyyq   20Gi       RWO            alicloud-disk-ssd   10m\n\n# kubectl exec -ti dynamic-snapshot-fdc86b6d8-bl6h5 ls /data\nlost+found  snapshot123\n```\n\nNew pvc create a new disk, which using the snapshot. And the new disk contains old disk file(snapshot123).\n\n\n## Troubleshooting\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliyuncontainerservice%2Fdisk-snapshot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faliyuncontainerservice%2Fdisk-snapshot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliyuncontainerservice%2Fdisk-snapshot/lists"}