Skip to content

Commit

Permalink
Better wording for Velero chapter (#873)
Browse files Browse the repository at this point in the history
* Decrease sub-chapter usage

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>

* Add full stop

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>

* Consolidate velero deployment into one doc

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>

* Enhance velero usercase doc

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>

* Decrease sub-chapter usage

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>

* Language and formatting edits.

* Fix one more typo.

Co-authored-by: nkoranova <nkoranova@suse.com>
  • Loading branch information
JenTing Hsiao and nkoranova committed Jun 22, 2020
1 parent aea0bd8 commit d9d5dc3
Show file tree
Hide file tree
Showing 6 changed files with 325 additions and 280 deletions.
96 changes: 51 additions & 45 deletions adoc/admin-velero-backup.adoc
Original file line number Diff line number Diff line change
@@ -1,35 +1,36 @@
=== Backup
==== Annotate Persistent Volume (optional)
== Backup

* Annotate Persistent Volume (_optional_)
+
If the persistent volume in the supported volume `snapshotter` provider, skip this procedure.

+
However, if we deploy the `restic` DaemonSet and want to backup the persistent volume by `restic`, we have to add annotation `backup.velero.io/backup-volumes=<VOLUME_NAME_1>,<VOLUME_NAME_2>,...` to the pods which have mounted the volume manually.

+
For example, we deploy an Elasticsearch cluster and want to backup the Elasticsearch cluster's data. Add the annotation to the Elasticsearch cluster pods:

+
[source,bash]
----
kubectl annotate pod/elasticsearch-master-0 backup.velero.io/backup-volumes=elasticsearch-master
kubectl annotate pod/elasticsearch-master-1 backup.velero.io/backup-volumes=elasticsearch-master
kubectl annotate pod/elasticsearch-master-2 backup.velero.io/backup-volumes=elasticsearch-master
----

+
[NOTE]
Velero currently does not provide a mechanism to detect persistent volume claims that are missing the `restic` backup annotation.
To solve this, there is a community provided controller link:https://github.com/bitsbeats/velero-pvc-watcher[velero-pvc-watcher] which integrates Prometheus to generate alerts for volumes that are not in the backup or backup-exclusion annotation.
==== Manual Backup

* Manual Backup
+
[source,bash]
----
velero backup create <BACKUP_NAME>
----
==== Setting Backup Schedule

* Scheduled Backup
+
The schedule template in cron notation, using UTC time. The schedule can also be expressed using `@every <duration>` syntax.
The duration can be specified using a combination of seconds (s), minutes (m), and hours (h), for example: `@every 2h30m`.

+
[source,bash]
----
# Create schedule template
Expand All @@ -45,7 +46,7 @@ velero schedule create <SCHEDULE_NAME> --schedule="@every 24h" --include-namespa
# Create a weekly backup, each living for 90 days (2160 hours)
velero schedule create <SCHEDULE_NAME> --schedule="@every 168h" --ttl 2160h0m0s
----

+
[options="header"]
|===
| Character Position | Character Period | Acceptable Values
Expand All @@ -55,22 +56,22 @@ velero schedule create <SCHEDULE_NAME> --schedule="@every 168h" --ttl 2160h0m0s
|4 |Month |`1-12,*`
|5 |Day of Week |`0-7,*`
|===

+
[NOTE]
When creating multiple backups to different backup locations closely, you might hit the object storage server API rate limit issues. Now, the velero does not have a mechanism on retry backups when the rate limit occurred. Consider shifting the time to create multiple backups.
==== Optional Flags

===== Granularity

====== Cluster

Without pass extra flags to `velero backup create`, Velero will backup whole {kube} cluster.
* Optional Flags
====== Namespace

Pass flag `--include-namespaces` or `--exclude-namespaces` to specifies which namespaces to include/exclude when backing up. For example:
** Granularity
+
Without passing extra flags to `velero backup create`, Velero will backup the whole {kube} cluster.

*** Namespace
+
Pass flag `--include-namespaces` or `--exclude-namespaces` to specify which namespaces to include/exclude when backing up.
+
For example:
+
[source,bash]
----
# Create a backup including the nginx and default namespaces
Expand All @@ -80,33 +81,35 @@ velero backup create backup-1 --include-namespaces nginx,default
velero backup create backup-1 --exclude-namespaces kube-system,default
----
====== Resources

Pass flag `--include-resources` or `--exclude-resources` to specifies which resources to include/exclude when backing up. For example:

*** Resources
+
Pass flag `--include-resources` or `--exclude-resources` to specifies which resources to include/exclude when backing up.
+
For example:
+
[source,bash]
----
# Create a backup including storageclass resource only
velero backup create backup-1 --include-resources storageclasses
----

+
[TIP]
Use `kubectl api-resources` to lists all API resources on the server.

====== Label Selector

*** Label Selector
+
Pass `--selector` to only back up resources matching the label selector.

+
[source,bash]
----
# Create a backup for the elasticsearch cluster only
velero backup create backup-1 --selector app=elasticsearch-master
----
===== Location

** Location
+
Pass `--storage-location` to specify where the backup stores to. For example, if we have HA object storage server called master and slave respectively.

+
[source,bash]
----
# Create a backup to the master storage server
Expand All @@ -116,34 +119,37 @@ velero backup create backup2master --storage-location master
velero backup create backup2slave --storage-location slave
----
==== Garbage collection

Pass `--ttl` to determine how long keeps the backup, after that, the backup will be garbage collected. The default backup existed time is 720 hours (30 days).

==== Exclude Specific Items from Backup

To exclude individual items from being backed up, even if they match the resource/namespace/label selectors defined in the backup spec. To do this, label the item as follows:
** Garbage Collection
+
Pass `--ttl` to specify how long the backup should be kept, after that, the backup will be dumped into garbage (deleted). The default time for a backup to exist before it is deleted is 720 hours (30 days).
** Exclude Specific Items from Backup
+
You can exclude individual items from being backed up, even if they match the resource/namespace/label selectors defined in the backup spec. To do this, label the item as follows:
+
[source,bash]
----
kubectl label -n <ITEM_NAMESPACE> <RESOURCE>/<NAME> velero.io/exclude-from-backup=true
----
==== Troubleshooting
===== List backups
=== Backup Troubleshooting
* List Backups
+
[source,bash]
----
velero backup get
----
===== Describe backups
* Describe Backups
+
[source,bash]
----
velero backup describe <BACKUP_NAME_1> <BACKUP_NAME_2> <BACKUP_NAME_3>
----
===== Retrieve backup logs
* Retrieve Backup Logs
+
[source,bash]
----
velero backup logs <BACKUP_NAME>
Expand Down
Loading

0 comments on commit d9d5dc3

Please sign in to comment.