Restore Points
RestorePoint
A RestorePoint API resource is used to represent a K10 App that is captured at a specific time as a result of a BackupAction or a RestoreAction.
A RestorePoint resides in the namespace of the K10 App and access to it can be controlled using Kubernetes RBAC role and binding for the RestorePoint API.
List RestorePoint Example
The following example illustrates listing all RestorePoints for a sample application.
# list restore point in namespace 'sample-app'
$ kubectl get restorepoints.apps.kio.kasten.io --namespace sample-app
NAME AGE
sample-app-backup-rp-raq923 1h
sample-app-backup-rp-rdq309 2h
Get RestorePoint Details Example
In addition to getting a RestorePoint, you can also query the details associated with the restore point. You would use the details sub-resource for that purpose.
# get the details for restorepoint 'sample-app-backup-rp-raq923' created in 'mysql' namespace
# yq only used for readability
$ kubectl get --raw /apis/apps.kio.kasten.io/v1alpha1/namespaces/mysql/restorepoints/sample-app-backup-rp-raq923/details | yq -y .status.restorePointDetails
artifacts:
...
originatingPolicies:
...
Delete RestorePoint Example
For RestorePoints created by policy, RestorePoints will automatically be deleted as part of the retention scheme that is specified.
A K10 administrator may chose to not enable RBAC that allows deleting RestorePoints directly in order to force such operations to happen through policy retirement only.
# delete restore point 'sample-app-backup-rp-raq923' in namespace 'sample-app'
$ kubectl delete restorepoints.apps.kio.kasten.io sample-app-backup-rp-raq923 --namespace sample-app
restorepoint.apps.kio.kasten.io/sample-app-backup-rp-raq923 deleted
Note
Currently, deleting a RestorePoint manually does not delete the underlying resources. For all associated resources (e.g. persistent volumes, application-level artifacts, etc.) to be reclaimed, see, Delete RestorePointContent Example
Creating RestorePoint from RestorePointContent Example
When an application which has previously been protected by K10 is deleted, the RestorePoints associated with the application are no longer available, but the corresponding RestorePointContent resources remain available. A K10 administrator has the opportunity re-create a RestorePoint that would be bound to the RestorePointContent.
The following example illustrates creating a RestorePoint in the mysql
namespace. The operation requires that the caller has read access to the
RestorePointContent resource.
$ cat > create-rp-from-rpc.yaml <<EOF
apiVersion: apps.kio.kasten.io/v1alpha1
kind: RestorePoint
metadata:
name: new-restore-point
namespace: mysql
spec:
restorePointContentRef:
name: rpc-mysql-backup
EOF
$ kubectl create -f create-rp-from-rpc.yaml
restorepoint.apps.kio.kasten.io/new-restore-point created
#validate that the new restore point is bound
$ kubectl get restorepoints.apps.kio.kasten.io new-restore-point --namespace mysql \
-ojsonpath="{.status.state}{'\n'}"
Bound
RestorePoint API Type
The following is a complete specification of the RestorePoint resource.
# Standard Kubernetes API Version declaration. Required.
apiVersion: apps.kio.kasten.io/v1alpha1
# Standard Kubernetes Kind declaration. Required.
kind: RestorePoint
# Standard Kubernetes metadata. Required.
metadata:
# Name of the RestorePoint. Required.
name: sample-restore-point
# Namespace of the RestorePoint. Required.
namespace: sample-app
# Kubernetes labels
labels:
# Labels that can be used for filtering.
# Automatically populated when creating the the resource
k10.kasten.io/appName: sample-app
k10.kasten.io/appNamespace: sample-app
# Restore point resource parameters
spec:
# Reference to the underlying RestorePointContent resource.
# When creating a RestorePoint the caller need to have
# read access to the RestorePointContent being referenced.
restorePointContentRef:
# Name of the underlying RestorePointContent resource
name: rpc-sample-app-backip-art245
# Status of the RestorePointContent. Users should not set any data here.
status:
# State of the resource.
# Possible values:
# Bound - corresponding RestorePoint resource exists
# Unbound - no RestorePoint references the resource
state: Bound
# Size of the volumes contained within this RestorePoint.
logicalSizeBytes: 17179869184
# Reported size of the snapshots contained within this RestorePoint.
physicalSizeBytes: 4852012
# Scheduled backup or import time associated with the resource.
# Could be 'null' for on-demand actions.
scheduledTime: '2019-02-11T03:03:47Z'
# Time of actual creation by the corresponding action
actionCreationTime: '2019-02-11T03:03:47Z'
RestorePointContent
A RestorePointContent API resource backs the content of a RestorePoint.
When a RestorePoint exists for a given RestorePointContent, that RestorePointContent resource is bound. If there is no corresponding RestorePoint (e.g. application was deleted), then the resource is unbound.
Deletion of a RestorePointContent resource frees up the artifacts associated with the restore point content and deletes any bound RestorePointContents.
Access to RestorePointContent is typically reserved for users with K10 administrative privileges through Kubernetes RBAC since the resources are cluster-scoped.
List RestorePointContent Example
RestorePointContent resources can be listed similarly to RestorePoint resources, but the operation is non-namespaced.
In addition, to get the RestorePointContent resources associated with a specific K10App, you can use a label selector to constrain your query.
# list RestorePointContent resources for 'sample-app'
# assume K10 is installed in 'kasten-io'
$ kubectl get restorepointcontents.apps.kio.kasten.io \
--selector=k10.kasten.io/appName=sample-app
NAME AGE
sample-app-backup-rp-raq923 1h
sample-app-backup-rp-rdq309 2h
Get RestorePointContent Details Example
In addition to getting a RestorePointContent, you can also query the details associated with the restore point content. You would use the details sub-resource for that purpose.
# get the details for restorepointcontent 'sample-app-backup-rp-raq923'
# yq only used for readability
$ kubectl get --raw /apis/apps.kio.kasten.io/v1alpha1/restorepointcontents/sample-app-backup-rp-raq923/details | yq -y .status.restorePointContentDetails
artifacts:
...
originatingPolicies:
...
Delete RestorePointContent Example
In addition to policy-based deletion of RestorePoints and RestorePointContents, you can explicitly delete a RestorePointContent. Deleting a RestorePointContent will cause its bound RestorePoints and all associated resources (e.g. persistent volumes, application-level artifacts, etc.) to be reclaimed.
Deleting a RestorePointContent resource creates a RetireAction that can be examined to monitor progress of the retirement.
Warning
Deletion of a RestorePointContent is permanent and overrides retention by a Policy.
Note
Some resources associated with the deleted restore point content may be cleaned immediately, while others, such as backup data exported to an object store, may take much longer to be completely removed. Data references shared between restore points, aggregated data awaiting garbage collection, version retention for immutable backups, and safety windows for re-referencing data are among the reasons why retiring a restore point might not immediately free up space in the underlying storage.
Additionally, due to data deduplication, some retirements may result in minimal or no resource usage reclamation. It is important to note that the increase in storage usage when creating a restore point does not reflect the expected space reclamation once the restore point is cleaned up.
The following example illustrates deleting a RestorePointContent. The operation requires that the caller has delete access to the RestorePointContent resource.
# delete restore point content 'sample-app-backup-rpc-raq923'
$ kubectl delete restorepointcontents.apps.kio.kasten.io sample-app-backup-rpc-raq923
restorepointcontent.apps.kio.kasten.io/sample-app-backup-rpc-raq923 deleted
RestorePointContent API Type
The following is a complete specification of the RestorePointContent resource.
Note
The RestorePointContent resource cannot be created directly.
# Standard Kubernetes API Version declaration. Required.
apiVersion: apps.kio.kasten.io/v1alpha1
# Standard Kubernetes Kind declaration. Required.
kind: RestorePointContent
# Standard Kubernetes metadata. Required.
metadata:
# Name of the RestorePointContent. Required.
name: sample-restore-point-content
# Kubernetes labels
labels:
# Labels that can be used fot filtering.
# Automatically populated when creating the the resource
k10.kasten.io/appName: sample-app
k10.kasten.io/appNamespace: sample-app
# Status of the RestorePointContent. Users should not set any data here.
status:
# State of the resource.
# Possible values:
# Bound - corresponding RestorePoint resource exists
# Unbound - no RestorePoint references the resource
state: Bound
# Scheduled backup or import time associated with the resource.
# Could be 'null' for on-demand actions.
scheduledTime: '2019-02-11T03:03:47Z'
# Time of actual creation by the corresponding action
actionCreationTime: '2019-02-11T03:03:47Z'
ClusterRestorePoint
A ClusterRestorePoint API resource is created by a BackupClusterAction that captures cluster-scoped resources. A RestoreClusterAction is used to restore cluster-scoped resources from a ClusterRestorePoint.
Deleting a ClusterRestorePoint resource frees up the artifacts associated with it.
Access to ClusterRestorePoint is typically reserved for users with K10 administrative privileges through Kubernetes RBAC since the resources are cluster-scoped.
List ClusterRestorePoint Example
ClusterRestorePoint resources can be listed similarly to RestorePoint resources, but the operation is non-namespaced.
# list ClusterRestorePoint resources
$ kubectl get clusterrestorepoints.apps.kio.kasten.io
NAME CREATED AT
scheduled-6b5s8 2020-12-29T23:57:20Z
scheduled-szmhn 2020-12-28T23:57:16Z
backup-cluster-action-fqbrndc5bz 2020-12-22T00:27:37Z
backup-cluster-action-fqbrn 2020-12-22T00:22:30Z
scheduled-w86gf 2020-12-21T22:08:30Z
backup-cluster-action-dnxl6 2020-12-19T01:20:53Z
Delete ClusterRestorePoint Example
In addition to policy-based deletion of ClusterRestorePoints, a ClusterRestorePoint can be directly deleted.
Deleting a ClusterRestorePoint resource creates a RetireAction that frees up the artifacts associated with the ClusterRestorePoint and that can be examined to monitor progress of the retirement.
Warning
Deletion of a ClusterRestorePoint is permanent and overrides retention by a Policy.
The following example illustrates deleting a ClusterRestorePoint. The operation requires that the caller has delete access to the ClusterRestorePoint resource.
# delete cluster restore point 'backup-cluster-action-raq923'
$ kubectl delete clusterrestorepoints.apps.kio.kasten.io backup-cluster-action-raq923
clusterrestorepoint.apps.kio.kasten.io "backup-cluster-action-raq923" deleted
ClusterRestorePoint API Type
The following is a complete specification of the ClusterRestorePoint resource.
Note
The RestorePointContent resource cannot be created directly.
# Standard Kubernetes API Version declaration. Required.
apiVersion: apps.kio.kasten.io/v1alpha1
# Standard Kubernetes Kind declaration. Required.
kind: ClusterRestorePoint
# Standard Kubernetes metadata. Required.
metadata:
# Name of the ClusterRestorePoint. Required.
name: sample-cluster-restore-point
# Kubernetes labels
labels:
# Labels that can be used fot filtering.
# Populated for policy initiated BackupClusterAction only.
k10.kasten.io/policyName: "sample-originating-policy"
k10.kasten.io/policyNamespace: "namespace-of-policy"
# Status of the ClusterRestorePoint. Users should not set any data here.
status:
# Scheduled backup or import time associated with the resource.
# Could be 'null' for on-demand actions.
scheduledTime: '2019-02-11T03:03:47Z'
# Time of actual creation by the corresponding action
actionTime: '2019-02-11T03:03:47Z'