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

feat(zfspv): adding backup and restore support #162

Merged
merged 4 commits into from
Sep 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions buildscripts/generate-manifests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,38 @@ echo '
cat deploy/yamls/zfs.openebs.io_zfssnapshots.yaml >> deploy/yamls/zfssnapshot-crd.yaml
rm deploy/yamls/zfs.openebs.io_zfssnapshots.yaml


echo '

##############################################
########### ############
########### ZFSBackup CRD ############
########### ############
##############################################

# ZFSBackups CRD is autogenerated via `make manifests` command.
# Do the modification in the code and run the `make manifests` command
# to generate the CRD definition' > deploy/yamls/zfsbackup-crd.yaml

cat deploy/yamls/zfs.openebs.io_zfsbackups.yaml >> deploy/yamls/zfsbackup-crd.yaml
rm deploy/yamls/zfs.openebs.io_zfsbackups.yaml


echo '

##############################################
########### ############
########### ZFSRestore CRD ############
########### ############
##############################################

# ZFSRestores CRD is autogenerated via `make manifests` command.
# Do the modification in the code and run the `make manifests` command
# to generate the CRD definition' > deploy/yamls/zfsrestore-crd.yaml

cat deploy/yamls/zfs.openebs.io_zfsrestores.yaml >> deploy/yamls/zfsrestore-crd.yaml
rm deploy/yamls/zfs.openebs.io_zfsrestores.yaml

## create the operator file using all the yamls

echo '# This manifest is autogenerated via `make manifests` command
Expand All @@ -81,6 +113,12 @@ cat deploy/yamls/zfsvolume-crd.yaml >> deploy/zfs-operator.yaml
# Add ZFSSnapshot v1alpha1 and v1 CRDs to the Operator yaml
cat deploy/yamls/zfssnapshot-crd.yaml >> deploy/zfs-operator.yaml

# Add ZFSBackup v1 CRDs to the Operator yaml
cat deploy/yamls/zfsbackup-crd.yaml >> deploy/zfs-operator.yaml

# Add ZFSRestore v1 CRDs to the Operator yaml
cat deploy/yamls/zfsrestore-crd.yaml >> deploy/zfs-operator.yaml

# Copy the base Operator yaml to CentOS 7 and 8 Operator yamls
cp deploy/zfs-operator.yaml deploy/operators/centos7/zfs-operator.yaml
cp deploy/zfs-operator.yaml deploy/operators/centos8/zfs-operator.yaml
Expand Down
2 changes: 1 addition & 1 deletion buildscripts/zfs-driver/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ FROM ubuntu:19.10
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
RUN apt-get update; exit 0
RUN apt-get -y install rsyslog libssl-dev xfsprogs ca-certificates
RUN apt-get -y install btrfs-progs
RUN apt-get -y install btrfs-progs netcat

ARG ARCH
ARG DBUILD_DATE
Expand Down
1 change: 1 addition & 0 deletions changelogs/unreleased/162-pawanpraka1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
adding velero backup and restore support
193 changes: 193 additions & 0 deletions deploy/operators/centos7/zfs-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,199 @@ status:
conditions: []
storedVersions: []


##############################################
########### ############
########### ZFSBackup CRD ############
########### ############
##############################################

# ZFSBackups CRD is autogenerated via `make manifests` command.
# Do the modification in the code and run the `make manifests` command
# to generate the CRD definition

---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.8
creationTimestamp: null
name: zfsbackups.zfs.openebs.io
spec:
additionalPrinterColumns:
- JSONPath: .spec.prevSnapName
description: Previous snapshot for backup
name: PrevSnap
type: string
- JSONPath: .status
description: Backup status
name: Status
type: string
- JSONPath: .metadata.creationTimestamp
description: Age of the volume
name: Age
type: date
group: zfs.openebs.io
names:
kind: ZFSBackup
listKind: ZFSBackupList
plural: zfsbackups
shortNames:
- zb
singular: zfsbackup
preserveUnknownFields: false
scope: Namespaced
subresources: {}
validation:
openAPIV3Schema:
description: ZFSBackup describes a zfs backup resource created as a custom resource
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: ZFSBackupSpec is the spec for a ZFSBackup resource
properties:
backupDest:
description: BackupDest is the remote address for backup transfer
minLength: 1
type: string
ownerNodeID:
description: OwnerNodeID is a name of the nodes where the source volume
is
minLength: 1
type: string
prevSnapName:
description: PrevSnapName is the last completed-backup's snapshot name
type: string
snapName:
description: SnapName is the snapshot name for backup
minLength: 1
type: string
volumeName:
description: VolumeName is a name of the volume for which this backup
is destined
minLength: 1
type: string
required:
- backupDest
- ownerNodeID
- volumeName
type: object
status:
description: ZFSBackupStatus is to hold status of backup
type: string
required:
- spec
- status
type: object
version: v1
versions:
- name: v1
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []


##############################################
########### ############
########### ZFSRestore CRD ############
########### ############
##############################################

# ZFSRestores CRD is autogenerated via `make manifests` command.
# Do the modification in the code and run the `make manifests` command
# to generate the CRD definition

---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.8
creationTimestamp: null
name: zfsrestores.zfs.openebs.io
spec:
group: zfs.openebs.io
names:
kind: ZFSRestore
listKind: ZFSRestoreList
plural: zfsrestores
singular: zfsrestore
preserveUnknownFields: false
scope: Namespaced
validation:
openAPIV3Schema:
description: ZFSRestore describes a cstor restore resource created as a custom
resource
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: ZFSRestoreSpec is the spec for a ZFSRestore resource
properties:
ownerNodeID:
description: owner node name where restore volume is present
minLength: 1
type: string
restoreSrc:
description: it can be ip:port in case of restore from remote or volumeName
in case of local restore
minLength: 1
type: string
volumeName:
description: volume name to where restore has to be performed
minLength: 1
type: string
required:
- ownerNodeID
- restoreSrc
- volumeName
type: object
status:
description: ZFSRestoreStatus is to hold result of action.
type: string
required:
- spec
- status
type: object
version: v1
versions:
- name: v1
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

---

# Create the CSI Driver object
Expand Down
Loading