Skip to content
This repository has been archived by the owner on Oct 21, 2020. It is now read-only.

Latest commit

 

History

History
59 lines (45 loc) · 1.74 KB

File metadata and controls

59 lines (45 loc) · 1.74 KB

AWS EBS

asciicast

Start Snapshot Controller

(assuming running Kubernetes local cluster):

_output/bin/snapshot-controller  -kubeconfig=${HOME}/.kube/config -cloudprovider=aws

Create a snapshot

  • Create an PVC
kubectl create namespace myns
# if no default storage class, create one
kubectl create -f https://raw.githubusercontent.com/kubernetes/kubernetes/master/examples/persistent-volume-provisioning/aws-ebs.yaml
kubectl create -f examples/aws/pvc.yaml
  • Create a Snapshot Third Party Resource
kubectl create -f examples/aws/snapshot.yaml

Check VolumeSnapshot and VolumeSnapshotData are created

kubectl get volumesnapshot,volumesnapshotdata -o yaml --namespace=myns

Snapshot based PV Provisioner

Unlike exiting PV provisioners that provision blank volume, Snapshot based PV provisioners create volumes based on existing snapshots. Thus new provisioners are needed.

There is a special annotation give to PVCs that request snapshot based PVs. As illustrated in the example, snapshot.alpha.kubernetes.io must point to an existing VolumeSnapshot Object

metadata:
  name: 
  namespace: 
  annotations:
    snapshot.alpha.kubernetes.io/snapshot: snapshot-demo

Starting Snapshot based PV Provisioner

_output/bin/snapshot-provisioner  -kubeconfig=${HOME}/.kube/config -cloudprovider=aws

Create Storage Class to enable provisioner PVs based on volume snapshots

kubectl create -f examples/aws/class.yaml

Claims a PV that restores from an existing volume snapshot

kubectl create -f examples/aws/claim.yaml