Skip to main content
Version: 3.1

Stateful application CRD reference in OCP GCP

BackupLocation

The BackupLocation CRD parameters differ based on the object store you use.

Google Cloud Storage

apiVersion: stork.libopenstorage.org/v1alpha1
kind: BackupLocation
metadata:
name: gcs
namespace: mysql
annotations:
stork.libopenstorage.org/skipresource: "true"
location:
type: google
path: "bucket-name"
googleConfig:
projectID: "portworx-eng"
accountKey: >-
{
"type": "service_account",
"project_id": "portworx-eng",
"private_key_id": "XXXX",
"private_key": "-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----\n",
"client_email": "username@company.com",
"client_id": "XXXX",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/user%40email.com"
}

googleConfig Parameters

ParameterDescriptionValueRequired?
projectIDYour Google Cloud Platform (GCP) project IDDefault: NoneYes
accountKeyYour GCP JSON service account keyDefault: NoneYes

ApplicationBackup

apiVersion: stork.libopenstorage.org/v1alpha1
kind: ApplicationBackup
metadata:
name: backup
namespace: mysql-app
spec:
backupLocation: mysql
namespaces:
- mysql-app
reclaimPolicy: Delete
selectors:
preExecRule:
postExecRule:

Spec Parameters

ParameterDescriptionValueRequired?
backupLocationWhat backupLocation object to use to determine where to send the backupDefault: NoneYes
namespacesThe namespaces to backupDefault: NoneYes
reclaimPolicyWhat happens to objects in the object store when the ApplicationBackup object is deletedDefault: DeleteNo
selectorsDefine specific labels to determine which objects and volumes are backed-upDefault: NoneNo
preExecRuleRule to run before performing backupDefault: NoneNo
PostExecRuleRule to run after performing backupDefault: NoneNo

ApplicationRestore

apiVersion: stork.libopenstorage.org/v1alpha1
kind: ApplicationRestore
metadata:
name: restore
namespace: mysql-app
spec:
backupName: backup
backupLocation: mysql
namespaceMapping:
<backup_namespace>: <restore_namespace>
replacePolicy: Delete

Spec Parameters

ParameterDescriptionValueRequired?
backupNameThe name of the ApplicationBackup you want to restore fromDefault: NoneYes
backupLocationWhich backup location object to get application backups fromDefault: NoneYes
namespaceMappingA map of source and destination namespaces, allowing you to restore a backup to a different namespace. You must provide the map in key value pairs, with the source namespace as the key and the destination namespace as the value. NOTE: You must run this spec from an admin namespace (kube-system by default).Default: NoneNo
replacePolicyWhat happens if matching resources already existDefault: Retain

Enumerated string: Delete, Retain
No

ApplicationClone

apiVersion: stork.libopenstorage.org/v1alpha1
kind: ApplicationClone
metadata:
name: clone-mysql
namespace: kube-system
spec:
sourceNamespace: mysql-app
destinationNamespace: clone-mysql
selectors:
app: mysql-app-db

Spec Parameters

ParameterDescriptionValueRequired?
sourceNamespaceThe namespace you want to clone applications fromDefault: NoneYes
destinationNamespaceThe namespace you want to clone applications toDefault: NoneYes
selectorsDefine specific labels to determine which resources are clonedDefault: NoneNo

ApplicationBackupSchedule

apiVersion: stork.libopenstorage.org/v1alpha1
kind: ApplicationBackupSchedule
metadata:
name: backup
namespace: mysql
spec:
backupType: ""
reclaimPolicy: Retain
schedulePolicyName: testpolicy
suspend: false
template:
spec:
backupLocation: aws-la
backupType: ""
includeResources: nil
namespaces:
- mysql
postExecRule: ""
preExecRule: ""
reclaimPolicy: Retain
resourceTypes: nil
selectors: nil
skipServiceUpdate: false

Spec Parameters

ParameterDescriptionValueRequired?
schedulePolicyNameThe name of the schedule policy that defines when backup actions happenDefault: NoneYes
backupLocationThe name of the backup location specDefault: NoneYes
namespaceslist of Namespaces which will be backed upDefault: nilYes
reclaimPolicyWhat happens to objects in the object store when the ApplicationBackup object is deletedRetain, Delete

Default: Delete
No
suspendSuspends the schedule. If this is set to 'true', backups will no longer schedule until this parameter is set to false again.Default: falseYes
includeResourcesUse this to specify a particular set up resources to back up in namespaces.Default: nilNo
postExecRuleName of the post exec rule CRDefault: NoneNo
preExecRuleName of the pre exec rule CRDefault: NoneNo
resourceTypeThe resource type names that need to backed up in the given namespace.ConfigMap, Secret

Default: nil
No
selectorsResource selector label. All resources with this label will be backed up.Default: nilNo
NamespaceSelectorsNamespace selector label. All namespaces with this label will be backed up.Default: nilNo
note

Some spec parameters are nested under template: and spec:. Refer to the example spec above to see which parameters are nested.