Skip to content

Commit

Permalink
Added information about storageType of snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
the-redback committed Feb 11, 2019
1 parent 4c89eae commit f20ceea
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 13 deletions.
11 changes: 10 additions & 1 deletion docs/concepts/snapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ spec:
endpoint: 's3.amazonaws.com'
bucket: kubedb-qa
prefix: demo
storageType: "Durable"
podVolumeClaimSpec:
storageClassName: "standard"
accessModes:
Expand Down Expand Up @@ -499,9 +500,17 @@ spec:
cpu: "500m"
```

### spec.storageType

`spec.storageType` is an optional field that specifies the type of storage to use for backup and restore. It can be either `Durable` or `Ephemeral`. If `StorageType` is not given, then databases's `storageType` will be taken.

If `Ephemeral` is used then KubeDB will create Job using [emptyDir](https://kubernetes.io/docs/concepts/storage/volumes/#emptydir) volume. If `Durable` is used then a PVC will be created either using `Snapshot.spec.podVolumeClaimSpec` or `db.spec.storage`.

### spec.podVolumeClaimSpec

Backup and recovery job needs a temporary storage to hold `dump` files before it can be uploaded to backend or inserted into database. By default, KubeDB reads storage specification from `spec.storage` section of database crd and creates PVC with similar specification for backup or recovery job. However, if you want to specify custom PVC template, you can do it through `spec.podVolumeClaimSpec` field. This is particularly helpful when you want to use different `storageclass` for backup or recovery job than the database.
Backup and recovery job needs a temporary storage to hold `dump` files before it can be uploaded to backend or inserted into database. By default, KubeDB reads storage specification from `spec.storage` section of database crd and creates PVC(depending on `storageType`) with similar specification for backup or recovery job. However, if you want to specify custom PVC template, you can do it through `spec.podVolumeClaimSpec` field. This is particularly helpful when you want to use different `storageclass` for backup or recovery job than the database.

If `storageType` is durable, then a PVC be will created using this podVolumeClaimSpec.If `storageType` is ephemeral, then an empty directory will be created of size `podVolumeClaimSpec.Resources.Requests[core.ResourceStorage]`.

### spec.podTemplate

Expand Down
1 change: 1 addition & 0 deletions docs/examples/concepts/snapshot-overview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ spec:
endpoint: 's3.amazonaws.com'
bucket: kubedb-qa
prefix: demo
storageType: "Durable"
podVolumeClaimSpec:
storageClassName: "standard"
accessModes:
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/postgres/snapshot/custom-backup-1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: scheduled-pg
namespace: demo
spec:
version: "9.6-v1"
version: "9.6-v2"
replicas: 3
storage:
storageClassName: "standard"
Expand All @@ -17,7 +17,7 @@ spec:
cronExpression: "@every 6h"
storageSecretName: gcs-secret
gcs:
bucket: kubedb-dev
bucket: kubedb-qa
podVolumeClaimSpec:
storageClassName: "standard"
accessModes:
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/postgres/snapshot/custom-backup-2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: scheduled-pg
namespace: demo
spec:
version: "9.6-v1"
version: "9.6-v2"
replicas: 3
storage:
storageClassName: "standard"
Expand All @@ -17,7 +17,7 @@ spec:
cronExpression: "@every 6h"
storageSecretName: gcs-secret
gcs:
bucket: kubedb-dev
bucket: kubedb-qa
podTemplate:
spec:
resources:
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/postgres/snapshot/custom-backup-3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: scheduled-pg
namespace: demo
spec:
version: "9.6-v1"
version: "9.6-v2"
replicas: 3
storage:
storageClassName: "standard"
Expand All @@ -17,7 +17,7 @@ spec:
cronExpression: "@every 6h"
storageSecretName: gcs-secret
gcs:
bucket: kubedb-dev
bucket: kubedb-qa
podTemplate:
annotations:
passMe: ToBackupJobPod
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/postgres/snapshot/custom-backup-4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: scheduled-pg
namespace: demo
spec:
version: "9.6-v1"
version: "9.6-v2"
replicas: 3
storage:
storageClassName: "standard"
Expand All @@ -17,7 +17,7 @@ spec:
cronExpression: "@every 6h"
storageSecretName: gcs-secret
gcs:
bucket: kubedb-dev
bucket: kubedb-qa
podTemplate:
spec:
args:
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/postgres/snapshot/custom-snap-1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
databaseName: script-postgres
storageSecretName: gcs-secret
gcs:
bucket: kubedb-dev
bucket: kubedb-qa
podVolumeClaimSpec:
storageClassName: "standard"
accessModes:
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/postgres/snapshot/custom-snap-2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
databaseName: script-postgres
storageSecretName: gcs-secret
gcs:
bucket: kubedb-dev
bucket: kubedb-qa
podTemplate:
spec:
resources:
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/postgres/snapshot/custom-snap-3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
databaseName: script-postgres
storageSecretName: gcs-secret
gcs:
bucket: kubedb-dev
bucket: kubedb-qa
podTemplate:
annotations:
passMe: ToBackupJobPod
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/postgres/snapshot/custom-snap-4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
databaseName: script-postgres
storageSecretName: gcs-secret
gcs:
bucket: kubedb-dev
bucket: kubedb-qa
podTemplate:
spec:
args:
Expand Down

0 comments on commit f20ceea

Please sign in to comment.