Skip to content

Commit

Permalink
Upgrade Velero to 1.2.0 (#6675)
Browse files Browse the repository at this point in the history
  • Loading branch information
Suleyman Akbas authored Jan 3, 2020
1 parent a54b0e3 commit 0337b1f
Show file tree
Hide file tree
Showing 31 changed files with 217 additions and 149 deletions.
4 changes: 2 additions & 2 deletions docs/backup/01-01-backup.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ title: Overview

Kyma integrates with [Velero](https://github.com/heptio/velero/) to provide backup and restore capabilities.

Velero backs up Kubernetes resources and stores them in buckets of [supported cloud providers](https://velero.io/docs/v1.0.0/support-matrix/). It triggers physical volume snapshots and includes the snapshot references in the backup. Velero can create scheduled or on-demand backups, filter objects to include in the backup, and set time to live (TTL) for stored backups.
Velero backs up Kubernetes resources and stores them in buckets of [supported cloud providers](https://velero.io/docs/v1.2.0/supported-providers/). It triggers physical volume snapshots and includes the snapshot references in the backup. Velero can create scheduled or on-demand backups, filter objects to include in the backup, and set time to live (TTL) for stored backups.

If you configured Velero when installing Kyma as explained [here](/components/backup/#installation-installation), backup is enabled with the default schedule and runs once a day every day from Monday to Friday. To change the settings of the backup change the **schedules** configuration in the Velero chart [configuration](/components/backup/#configuration-velero-chart).

For more details, see the official [Velero documentation](https://velero.io/docs/v1.0.0).
For more details, see the official [Velero documentation](https://velero.io/docs/v1.2.0).
17 changes: 9 additions & 8 deletions docs/backup/04-01-install-velero.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Install and configure [Velero](https://github.com/heptio/velero/) to back up and

>**NOTE**: To successfully set up Velero, define a supported storage location and credentials to access it. Currently, you can install Velero on GCP and Azure. AWS is not supported.
Follow the instructions to set up Velero:
Follow the instructions to set up Velero:

1. Override the default backup configuration provided by the `backup` and `backup-init` components by creating a Secret containing the [required parameters](/components/backup/#configuration-configuration) for a chosen provider.
1. Override the default backup configuration provided by the `backup` and `backup-init` components by creating a Secret containing the [required parameters](/components/backup/#configuration-configuration) for a chosen provider.

See examples of such Secrets:

Expand Down Expand Up @@ -53,7 +53,7 @@ Follow the instructions to set up Velero:
}
```
>**NOTE:** For details on configuring and installing Velero on GCP, see [this](https://velero.io/docs/v1.0.0/gcp-config/) document.
>**NOTE:** For details on configuring and installing Velero on GCP, see [this](https://github.com/vmware-tanzu/velero-plugin-for-gcp) repo.
</details>
<details>
<summary label="azure">
Expand All @@ -72,6 +72,7 @@ Follow the instructions to set up Velero:
component: backup
type: Opaque
stringData:
initContainers.pluginContainer.image: "velero/velero-plugin-for-microsoft-azure:v1.0.0"
configuration.provider: "azure"
configuration.volumeSnapshotLocation.name: "azure"
configuration.volumeSnapshotLocation.bucket: "my-storage-container"
Expand All @@ -88,7 +89,7 @@ Follow the instructions to set up Velero:
AZURE_RESOURCE_GROUP=my-resource-group
```
>**NOTE:** For details on configuring and installing Velero in Azure, see [this](https://velero.io/docs/v1.0.0/azure-config/) document.
>**NOTE:** For details on configuring and installing Velero in Azure, see [this](https://github.com/vmware-tanzu/velero-plugin-for-microsoft-azure) repo.
</details>
</div>
Expand All @@ -101,7 +102,7 @@ Follow the instructions to set up Velero:
Local installation
</summary>
To apply overrides to your local installation, run:
1. Apply the overrides to your local installation:
```bash
kyma install -o {overrides_file_path}
Expand All @@ -115,9 +116,9 @@ Follow the instructions to set up Velero:

1. Apply the overrides to your cluster:

```bash
kubectl apply -f {overrides_file_path}
```
```bash
kubectl apply -f {overrides_file_path}
```

2. [Install](/root/kyma/#installation-installation) Kyma or [update](/root/kyma/#installation-update-kyma) it if it is already installed on your cluster.

Expand Down
3 changes: 2 additions & 1 deletion docs/backup/05-01-velero.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ This table lists the parameters required for Velero to work, their descriptions,
**credentials.useSecret** | Specifies if a secret is required for IAM credentials. Set this to `false` when using `kube2iam`. | `true` | Yes
**credentials.existingSecret** | If specified and **useSecret** is `true`, uses an existing secret with this name instead of creating one. | None | Yes, if **useSecret** is `true` and **secretContents** is empty
**credentials.secretContents** | If specified and **useSecret** is `true`, provides the content for the credentials secret. | None | Yes, if **useSecret** is `true` and **existingSecret** is empty
**initContainers.pluginContainer.image** | Provides the image for the respective cloud provider plugin. | `velero/velero-plugin-for-gcp:v1.0.0` | yes, set `velero/velero-plugin-for-microsoft-azure:v1.0.0` for Azure and `velero/velero-plugin-for-aws:v1.0.0` for AWS. See [supported providers](https://velero.io/docs/v1.2.0/supported-providers) for more details

## Configurable parameters

Expand All @@ -43,4 +44,4 @@ This table lists the non-required configurable parameters, their descriptions, a
| **configuration.backupStorageLocation.config.kmsKeyId** | Specifies the AWS KMS key ID or alias to enable encryption of the backups stored in S3. It only works with AWS S3 and may require explicitly granting key usage rights. | None |
| **configuration.backupStorageLocation.config.publicUrl** | Specifies the parameter used instead of **3Url** when generating download URLs, for example for logs. Use this field for local storage services like MinIO. | None |

See the official Velero documentation for examples and the full list of [parameters](../../resources/velero/README.md), as well as for [VolumeSnapshotLocation](https://velero.io/docs/v1.0.0/api-types/volumesnapshotlocation/) and [BackupStorageLocation](https://velero.io/docs/v1.0.0/api-types/backupstoragelocation/).
See the official Velero documentation for examples and the full list of [parameters](../../resources/velero/README.md), as well as for [VolumeSnapshotLocation](https://velero.io/docs/v1.2.0/api-types/volumesnapshotlocation/) and [BackupStorageLocation](https://velero.io/docs/v1.2.0/api-types/backupstoragelocation/).
8 changes: 4 additions & 4 deletions docs/backup/08-01-create-backup.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Back up a Kyma cluster
type: Tutorial
---
Follow this tutorial to learn how to use the [backup.yaml](./assets/backup.yaml) specification file to create a manual or scheduled Kyma backup. For details about the file format, see [this](https://velero.io/docs/v1.0.0/api-types/backup/) document.
Follow this tutorial to learn how to use the [backup.yaml](./assets/backup.yaml) specification file to create a manual or scheduled Kyma backup. For details about the file format, see [this](https://velero.io/docs/v1.2.0/api-types/backup/) document.

## Prerequisites

Expand All @@ -18,7 +18,7 @@ Follow the steps to back up Kyma.
Manual backup
</summary>

To create a manual backup, use the Backup custom resource based on Velero's [Backup](https://velero.io/docs/v1.0.0/api-types/backup/) API type. Deploy the following CR to the `kyma-system` Namespace to instruct the Velero server to create a backup. Make sure the indentation is correct.
To create a manual backup, use the Backup custom resource based on Velero's [Backup](https://velero.io/docs/v1.2.0/api-types/backup/) API type. Deploy the following CR to the `kyma-system` Namespace to instruct the Velero server to create a backup. Make sure the indentation is correct.

A sample backup configuration looks like this:

Expand Down Expand Up @@ -51,7 +51,7 @@ kubectl apply -f {filename}
Scheduled backup
</summary>

By default, the backup runs once a day every day from Monday to Friday. To set up a different backup schedule, create a Schedule custom resource based on the Velero's [Backup](https://velero.io/docs/v1.0.0/api-types/backup/) API type. Deploy it in the `kyma-system` Namespace to instruct the Velero Server to schedule a cluster backup. Make sure the indentation is correct.
By default, the backup runs once a day every day from Monday to Friday. To set up a different backup schedule, create a Schedule custom resource based on the Velero's [Backup](https://velero.io/docs/v1.2.0/api-types/backup/) API type. Deploy it in the `kyma-system` Namespace to instruct the Velero Server to schedule a cluster backup. Make sure the indentation is correct.

A sample scheduled backup configuration looks like this:

Expand Down Expand Up @@ -86,7 +86,7 @@ kubectl apply -f {filename}

## Backup retention period

To set the retention period of a backup, define the **ttl** parameter in the Backup specification [definition](https://velero.io/docs/v1.0.0/api-types/backup/):
To set the retention period of a backup, define the **ttl** parameter in the Backup specification [definition](https://velero.io/docs/v1.2.0/api-types/backup/):

```yaml
# The amount of time before this backup is eligible for garbage collection.
Expand Down
32 changes: 16 additions & 16 deletions docs/backup/08-02-restore-backup.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Follow this tutorial to restore a backed up Kyma cluster. Start with restoring C

## Prerequisites

To use the restore functionality, download and install the [Velero CLI](https://github.com/heptio/velero/releases/tag/v1.0.0).
To use the restore functionality, download and install the [Velero CLI](https://github.com/heptio/velero/releases/tag/v1.2.0).

## Steps

Expand All @@ -16,33 +16,33 @@ Follow these steps to restore resources:
1. Install the Velero server. Use the same bucket as for backups:

```bash
velero install --bucket <BUCKET> --provider <CLOUD_PROVIDER> --secret-file <CREDENTIALS_FILE> --restore-only --wait
velero install \
--bucket {BUCKET} \
--provider {CLOUD_PROVIDER} \
--secret-file {CREDENTIALS_FILE} \
--plugins velero/velero-plugin-for-gcp:v1.0.0,eu.gcr.io/kyma-project/backup-plugins:c08e6274 \
--restore-only \
--wait
```

>**NOTE**: Check out this [guide](https://velero.io/docs/v1.0.0/install-overview/) to correctly fill the parameters of this command corresponding to the cloud provider in use.
>**NOTE**: Check out this [guide](https://velero.io/docs/v1.2.0/customize-installation/) to correctly fill the parameters of this command corresponding to the cloud provider in use.

2. Install Kyma backup plugins:

```bash
velero plugin add eu.gcr.io/kyma-project/backup-plugins:e7df9098
```

3. List available backups:
2. List available backups:

```bash
velero get backups
```

4. Restore Kyma CRDs, services, and endpoints:
3. Restore Kyma CRDs, services, and endpoints:

```bash
velero restore create --from-backup <BACKUP_NAME> --include-resources customresourcedefinitions.apiextensions.k8s.io,services,endpoints --include-cluster-resources --wait
velero restore create --from-backup <BACKUP_NAME> --include-resources customresourcedefinitions.apiextensions.k8s.io,services,endpoints --wait
```

5. Restore the rest of Kyma resources:
4. Restore the rest of Kyma resources:

```bash
velero restore create --from-backup <BACKUP_NAME> --exclude-resources customresourcedefinitions.apiextensions.k8s.io,services,endpoints --include-cluster-resources --restore-volumes --wait
velero restore create --from-backup <BACKUP_NAME> --exclude-resources customresourcedefinitions.apiextensions.k8s.io,services,endpoints --restore-volumes --wait
```

Once the status of the restore is `COMPLETED`, perform a Kyma health check by verifying the Pods:
Expand All @@ -53,12 +53,12 @@ Follow these steps to restore resources:

Even if the restore process is complete, it may take some time for the resources to become available again.

> **NOTE:** Because of [this issue](https://github.com/heptio/velero/issues/1633) in Velero, custom resources may not be properly restored. In this case, run the second restore command again and check if the custom resources are restored. For example, run the following command to print several VirtualService custom resources:
> **NOTE:** Because of [this issue](https://github.com/vmware-tanzu/velero/issues/964) in Velero, custom resources may not be properly restored. In this case, run the second restore command again and check if the custom resources are restored. For example, run the following command to print several VirtualService custom resources:
>```bash
> kubectl get virtualservices --all-namespaces
> ```

6. Once the restore succeeds, remove the `velero` namespace:
5. Once the restore succeeds, remove the `velero` namespace:

```bash
kubectl delete ns velero
Expand Down
10 changes: 7 additions & 3 deletions resources/backup-init/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
appVersion: 1.0.0
name: backup-init
version: 1.0.0
apiVersion: v1
appVersion: 1.2.0
name: backup-init
version: 2.7.3
description: Backup CRDs for Kyma
sources:
- https://github.com/vmware-tanzu/velero
tillerVersion: ">=2.10.0"
keywords:
- Backup
- Velero
32 changes: 0 additions & 32 deletions resources/backup-init/templates/_helpers.tpl

This file was deleted.

5 changes: 1 addition & 4 deletions resources/backup-init/templates/crd-backups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ kind: CustomResourceDefinition
metadata:
name: backups.velero.io
labels:
chart: {{ template "backup-init.chart" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
app: {{ template "backup-init.name" . }}
app.kubernetes.io/name: "backup"
spec:
group: velero.io
version: v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ kind: CustomResourceDefinition
metadata:
name: backupstoragelocations.velero.io
labels:
app.kubernetes.io/name: {{ include "backup-init.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ include "backup-init.chart" . }}
app.kubernetes.io/name: "backup"
spec:
group: velero.io
version: v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ kind: CustomResourceDefinition
metadata:
name: deletebackuprequests.velero.io
labels:
app.kubernetes.io/name: {{ include "backup-init.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ include "backup-init.chart" . }}
app.kubernetes.io/name: "backup"
spec:
group: velero.io
version: v1
Expand Down
5 changes: 1 addition & 4 deletions resources/backup-init/templates/crd-downloadrequests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ kind: CustomResourceDefinition
metadata:
name: downloadrequests.velero.io
labels:
app.kubernetes.io/name: {{ include "backup-init.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ include "backup-init.chart" . }}
app.kubernetes.io/name: "backup"
spec:
group: velero.io
version: v1
Expand Down
5 changes: 1 addition & 4 deletions resources/backup-init/templates/crd-podvolumebackups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ kind: CustomResourceDefinition
metadata:
name: podvolumebackups.velero.io
labels:
app.kubernetes.io/name: {{ include "backup-init.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ include "backup-init.chart" . }}
app.kubernetes.io/name: "backup"
spec:
group: velero.io
version: v1
Expand Down
5 changes: 1 addition & 4 deletions resources/backup-init/templates/crd-podvolumerestores.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ kind: CustomResourceDefinition
metadata:
name: podvolumerestores.velero.io
labels:
app.kubernetes.io/name: {{ include "backup-init.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ include "backup-init.chart" . }}
app.kubernetes.io/name: "backup"
spec:
group: velero.io
version: v1
Expand Down
5 changes: 1 addition & 4 deletions resources/backup-init/templates/crd-resticrepositories.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ kind: CustomResourceDefinition
metadata:
name: resticrepositories.velero.io
labels:
app.kubernetes.io/name: {{ include "backup-init.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ include "backup-init.chart" . }}
app.kubernetes.io/name: "backup"
spec:
group: velero.io
version: v1
Expand Down
5 changes: 1 addition & 4 deletions resources/backup-init/templates/crd-restores.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ kind: CustomResourceDefinition
metadata:
name: restores.velero.io
labels:
app.kubernetes.io/name: {{ include "backup-init.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ include "backup-init.chart" . }}
app.kubernetes.io/name: "backup"
spec:
group: velero.io
version: v1
Expand Down
5 changes: 1 addition & 4 deletions resources/backup-init/templates/crd-schedules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ kind: CustomResourceDefinition
metadata:
name: schedules.velero.io
labels:
app.kubernetes.io/name: {{ include "backup-init.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ include "backup-init.chart" . }}
app.kubernetes.io/name: "backup"
spec:
group: velero.io
version: v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ kind: CustomResourceDefinition
metadata:
name: serverstatusrequests.velero.io
labels:
app.kubernetes.io/name: {{ include "backup-init.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ include "backup-init.chart" . }}
app.kubernetes.io/name: "backup"
spec:
group: velero.io
version: v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ kind: CustomResourceDefinition
metadata:
name: volumesnapshotlocations.velero.io
labels:
app.kubernetes.io/name: {{ include "backup-init.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ include "backup-init.chart" . }}
app.kubernetes.io/name: "backup"
spec:
group: velero.io
version: v1
Expand Down
8 changes: 6 additions & 2 deletions resources/backup/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
appVersion: 1.0.0
apiVersion: v1
appVersion: 1.2.0
name: backup
version: 1.0.0
version: 2.7.3
description: Backup for Kyma
sources:
- https://github.com/vmware-tanzu/velero
tillerVersion: ">=2.10.0"
keywords:
- Backup
- Velero
Loading

0 comments on commit 0337b1f

Please sign in to comment.