Kasten K10 provides an option to use an override setting in the policy to specify a storageClass that are created and used during exports.
ExporterStorageClassName parameter can be used for namespaces that have PVCs using a single storageClass and also in the case of multiple PVCs using different storageClasses in the same namespace.
This is particularly helpful when the application PVC is provisioned using a storageClass set to `Retain` in the deletion policy. This setting will make sure that there wouldn't be any PV left in released state when the temporary PVCs created for exports are cleaned up.
The examples below show how to add these parameters by editing the Policy manually.
Single storageClass:
apiVersion: config.kio.kasten.io/v1alpha1
kind: Policy
metadata:
name: postgresql-backup-1
namespace: kasten-io
spec:
actions:
- action: backup
- action: export
exportParameters:
exportData:
enabled: true
# Storage class to use for any temporary PVCs created
# during the snapshot conversion process. If not specified, the
# storage class of the source volume is used.
exporterStorageClassName: gp2-delete
frequency: '@hourly'
migrationToken:
name: postgresql-backup-1-migration-token-7vrgc
namespace: kasten-io
profile:
name: test-jai
namespace: kasten-io
receiveString: xxxxxxx
retention: {}
createdBy: kasten-io:k10-k10
frequency: '@hourly'
retention:
daily: 7
hourly: 24
monthly: 12
weekly: 4
yearly: 7
selector:
matchExpressions:
- key: k10.kasten.io/appNamespace
operator: In
values:
- postgresql
- kasten-io-cluster
Multiple storageClass:
apiVersion: config.kio.kasten.io/v1alpha1
kind: Policy
metadata:
name: postgresql-backup-1
namespace: kasten-io
spec:
actions:
- action: backup
- action: export
exportParameters:
exportData:
enabled: true
overrides:
# Override setting of a specific storage class
- storageClassName: gp2-retain
enabled: true
exporterStorageClassName: gp2-delete
- storageClassName: gp3-retain
enabled: true
exporterStorageClassName: gp3-delete
# Setting to disable the export for a specific storageClass
- storageClassName: nfs-client
enabled: false
frequency: '@hourly'
migrationToken:
name: postgresql-backup-1-migration-token-7vrgc
namespace: kasten-io
profile:
name: test-jai
namespace: kasten-io
receiveString: xxxxxxx
retention: {}
createdBy: kasten-io:k10-k10
frequency: '@hourly'
retention:
daily: 7
hourly: 24
monthly: 12
weekly: 4
yearly: 7
selector:
matchExpressions:
- key: k10.kasten.io/appNamespace
operator: In
values:
- postgresql
- kasten-io-cluster
Note: It is possible also to disable the export of a specific storageClass as the example below for NFS:
# Setting to disable the export for a specific storageClass
- storageClassName: nfs-client
enabled: false
Regarding all fields that can be configured with the policy API, please refer to https://docs.kasten.io/latest/api/policies.html for more information.