Merge pull request #630 from skriss/release-0.8

Backport PRs 625 & 626 to release-0.8
This commit is contained in:
Andy Goldstein
2018-06-29 14:36:58 -04:00
committed by GitHub
3 changed files with 48 additions and 1 deletions
+13
View File
@@ -23,3 +23,16 @@ Examples of cases where Ark is useful:
Yes, with some exceptions. For example, when Ark restores pods it deletes the `nodeName` from the
pod so that it can be scheduled onto a new node. You can see some more examples of the differences
in [pod_action.go](https://github.com/heptio/ark/blob/master/pkg/restore/pod_action.go)
## I'm using Ark in multiple clusters. Should I use the same bucket to store all of my backups?
We **strongly** recommend that you use a separate bucket per cluster to store backups. Sharing a bucket
across multiple Ark instances can lead to numerous problems - failed backups, overwritten backups,
inadvertently deleted backups, etc., all of which can be avoided by using a separate bucket per Ark
instance.
Related to this, if you need to restore a backup from cluster A into cluster B, please use [restore-only][1]
mode in cluster B's Ark instance while it's configured to use cluster A's bucket. This will ensure no
new backups are created, and no existing backups are deleted or overwritten.
[1]: config-definition.md#main-config-parameters
+13 -1
View File
@@ -51,7 +51,19 @@ import (
// nonRestorableResources is a blacklist for the restoration process. Any resources
// included here are explicitly excluded from the restoration process.
var nonRestorableResources = []string{"nodes", "events", "events.events.k8s.io"}
var nonRestorableResources = []string{
"nodes",
"events",
"events.events.k8s.io",
// Don't ever restore backups - if appropriate, they'll be synced in from object storage.
// https://github.com/heptio/ark/issues/622
"backups.ark.heptio.com",
// Restores are cluster-specific, and don't have value moving across clusters.
// https://github.com/heptio/ark/issues/622
"restores.ark.heptio.com",
}
type restoreController struct {
namespace string
+22
View File
@@ -255,6 +255,28 @@ func TestProcessRestore(t *testing.T) {
"Invalid included/excluded resource lists: excludes list cannot contain an item in the includes list: events.events.k8s.io",
},
},
{
name: "restoration of backups.ark.heptio.com is not supported",
restore: NewRestore("foo", "bar", "backup-1", "ns-1", "backups.ark.heptio.com", api.RestorePhaseNew).Restore,
backup: arktest.NewTestBackup().WithName("backup-1").Backup,
expectedErr: false,
expectedPhase: string(api.RestorePhaseFailedValidation),
expectedValidationErrors: []string{
"backups.ark.heptio.com are non-restorable resources",
"Invalid included/excluded resource lists: excludes list cannot contain an item in the includes list: backups.ark.heptio.com",
},
},
{
name: "restoration of restores.ark.heptio.com is not supported",
restore: NewRestore("foo", "bar", "backup-1", "ns-1", "restores.ark.heptio.com", api.RestorePhaseNew).Restore,
backup: arktest.NewTestBackup().WithName("backup-1").Backup,
expectedErr: false,
expectedPhase: string(api.RestorePhaseFailedValidation),
expectedValidationErrors: []string{
"restores.ark.heptio.com are non-restorable resources",
"Invalid included/excluded resource lists: excludes list cannot contain an item in the includes list: restores.ark.heptio.com",
},
},
}
for _, test := range tests {