Kubernetes Cluster Copy Backups
This chapter describes details about the resource “kubeoffload” which represents the copy backup definition of a Kubernetes cluster.
Defining a Scheduled Copy
POST /api/v1/kubeoffloads
{
"name": "testoffload",
"trigger_type": "SCHEDULED",
"policy": "6064326306d7357b1c1510a6",
"run_backup": true,
"backupdef": "6064313324111b4af430d936"
}
201 CREATED
{
"name": "testoffload",
"trigger_type": "SCHEDULED",
"policy": "6064326306d7357b1c1510a6",
"backupdef": "6064313324111b4af430d936",
"delete_snapshots": true,
"run_backup": false,
"_updated": "Wed, 31 Mar 2021 08:28:41 GMT",
"_created": "Wed, 31 Mar 2021 08:28:41 GMT",
"cluster": "6064311f6077f12398f67f6a",
"_etag": "98e44159f4b5173f02ddde3b4ec8c2edca278cbf",
"_id": "606432b9a1246a6388a5b771",
"_links": {
"self": {
"title": "Kubeoffload",
"href": "/v1/kubeoffloads/606432b9a1246a6388a5b771"
},
"related": {
"backupdef": {
"title": "Kubebackup",
"href": "/v1/kubebackups/6064313324111b4af430d936"
},
"policy": {
"title": "policy",
"href": "/v1/policies/6064326306d7357b1c1510a6"
},
"cluster": {
"title": "Kubecluster",
"href": "/v1/kubeclusters/6064311f6077f12398f67f6a"
}
}
},
"_status": "OK"
}
Schema
- trigger_type
Optional. String. Possible values are “ADHOC” and “SCHEDULED”. Default is “SCHEDULED”.
“SCHEDULED” offload are run as per “policy”.
“ADHOC” offload need to be run explicitly as described below.
- policy
ID of the policy. This field is required for “SCHEDULED” type of copies while “ADHOC” copies do not use it.
- backupdef
ID of the “kubebackups” resource for a given Snapshot backup.
- delete_snapshots
Boolean. Default “True”. If set to true, snapshot recovery point will be removed after successful copy.
- run_backup
Boolean. Default “False”. If set to true, a snapshot will be taken before running the offload. Works only for scheduled offloads. For running backup before an ADHOC type of offload, check the instructions described below.
- options
Object. Optional. Check “Options schema” for details
- offload_provider
Object. Optional. Check “Offload provider schema” for details.
Response will contain “status” field whose schema is described below. Note that “status” may not appear immediately so client will need to poll until it sees the field.
Options schema
- upload_speed_limit
Integer. Optional. File upload speed limit.
- download_speed_limit
Integer. Optional. File download speed limit.
- pvc_file_parallelism
Integer. Optional. Number of files to backup or restore in parallel per PVC
- pvc_parallelism
Integer. Optional. Number of PVCs (per namespace) to backup concurrently.
Setting preferred backup target
It is possible to configure a preferred backup target for a given copy job. For details, see Selection of Backup Target.
A sample request:
PUT /api/v1/kubeoffloads/5eb599e603f7a77d5223efee
{
"offload_provider": {
"region": "us-east-1",
"type": "aws"
},
...
}
Notes
To remove backup provider setting, do a PUT with a request body that does not include the field “offload_provider”.
Running a copy
Some times, users may want to run copy immediately instead of waiting for scheduled time. In case of “ADHOC” offloads, there is no schedule so they do need to be run explicitly.:
POST /api/v1/kubeoffloads/<ID>/action/run
{
"retention": {
"retainDays": 15
},
"runBackup": true
}
Schema
- retention
- retainDays
Integer. Required.
- runBackup
Boolean. Optional. Defaults to “False”. If set to true, a snapshot will be taken before running the offload.
Status
The kubeoffloads resource will have a “status” field updated as per the following schema:
- state
- State of the kubeoffload resource. Possible values:
- jobidstatemessage
- message
String
Cancelling a copy
Check “Cancelling a job” section for details.
Deleting a copy resource
DELETE /api/v1/kubeoffloads/<ID>
Note
Delete will fail if there is a running job corresponding to the offload resource.