Commit Graph

42 Commits (4fcd222777c99963aca5a3b5bb463b2b1e0e0296)

Author SHA1 Message Date
Nolan Brubaker 923870390b Skip completed jobs and pods when restoring
Completed jobs and pods may be useful in the backup for auditing
purposes, but don't recreate them when restoring.

Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-05-02 12:16:54 -04:00
Nolan Brubaker 33cc85cd0c Compare backup and cluster objects before logging
When restoring resources that raise an already exists error, check their
equality before logging a message on the restore. If they're the same
except for some metadata, don't generate a message.

The restore process was modified so that if an object had an empty
namespace string, no namespace key is created on the object. This was to
avoid manipulating the copy of the current cluster's object by adding
the target namespace.

There are some cases right now that are known to not be equal via this
method:

- The `default` ServiceAccount in a namespace will not match, primarily
because of differing default tokens. These will be handled in their own
patch
- IP addresses for Services are recorded in the backup object, but are
either not present on the cluster object, or different. An issue for
this already exists at https://github.com/heptio/ark/issues/354
- Endpoints have differing values for `renewTime`. This may be
insubstantial, but isn't currently handled by the resetMetadataAndStatus
function.
- PersistentVolume objects do not match on spec fields, such as
claimRef and cloud provider persistent disk info

Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-04-10 14:55:48 -04:00
Andy Goldstein 56ca4bab2f
Merge pull request #268 from skriss/2018
update copyright header to 2018 and make language/casing consistent
2018-01-02 14:16:26 -05:00
Steve Kriss 1503796419 make language and casing consistent across copyrights
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-01-02 10:51:49 -08:00
Steve Kriss 8878ba860e don't remove annotations from PVs on restore
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-12-21 13:23:48 -08:00
Andy Goldstein 1210cb36e1
Merge pull request #253 from skriss/update-license
Update all license headers
2017-12-19 19:26:54 -05:00
Steve Kriss 3641c2c043 update all license headers
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-12-15 13:38:12 -08:00
Steve Kriss 56c9d68137 switch to logrus.FieldLogger and arktest.NewLogger() everywhere
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-12-13 09:38:00 -08:00
Andy Goldstein 992940c55c
Merge pull request #227 from skriss/plugin-logger-fix
Bug fixes: obj/block store plugin logging and remapped namespaces issue
2017-11-30 12:17:56 -05:00
Steve Kriss 121b7153a7 when restoring, don't restore the Namespaces cluster-scoped resource independently
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-11-30 09:07:38 -08:00
Andy Goldstein bd8f433188
Merge pull request #229 from skriss/plugin-docs
add godoc for ResourceSelector
2017-11-30 11:25:53 -05:00
Steve Kriss 94ac3b3529 godoc for ResourceSelector
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-11-30 08:20:27 -08:00
Steve Kriss cbcd15d603 add/update documentation for plugins
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-11-29 14:24:23 -08:00
Andy Goldstein c700455272 Support custom volume snapshots & restores
The main Ark code was hard-coding specific support for AWS, GCE, and
Azure volume snapshots and restores, and anything else was considered
unsupported.

Add GetVolumeID and SetVolumeID to the BlockStore interface, to allow
block store plugins to handle volume snapshots and restores.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-11-29 13:19:40 -05:00
Steve Kriss 179b95c81d convert restorers to plugins
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-11-28 10:58:12 -08:00
Andy Goldstein af189fd5f4 Add error & logSource hooks to backup & restore loggers
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-11-14 14:19:52 -05:00
Steve Kriss 55c038afa0 fix restore namespace remapping bug
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-11-02 10:39:54 -07:00
Steve Kriss c49d11f17a
Merge pull request #171 from nrb/168-fix
Don't delete 'headless' services
2017-11-01 16:30:32 -07:00
Nolan Brubaker d87e8ee16e Don't delete 'headless' services
Deleting the clusterIP field when the service should be headless will
cause it to be assigned a new IP on restore; instead it should retain
the headless state after restoration.

Fixes #168

Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2017-11-01 14:47:08 -07:00
Andy Goldstein c1bc52eb65 Update gofmt
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-30 13:31:03 -04:00
Andy Goldstein 15fe87aea3 Fix clientset imports
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-30 13:31:03 -04:00
Andy Goldstein 43449885a1 React to move to k8s.io/api
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-30 13:30:27 -04:00
Steve Kriss a7cc58730e add --include-cluster-resources flag to restores (optional, default true)
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-10-23 10:51:07 -07:00
Steve Kriss e460199536 fix restore log statement
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-10-23 10:50:55 -07:00
Andy Goldstein 901f8e1302 Add pod exec backup hooks
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-20 10:20:59 -04:00
Devan Goodwin ed0194c09b Restructure backups for resource prioritization.
Previously the directory structure separated resources depending on
whether or not they were cluster or namespace scoped. All cluster
resources were restored first, then all namespace resources. Priority
did not apply across both and you could not order any namespace
resources before any cluster resources.

This restructure sorts firstly on resource type.

resources/serviceaccounts/namespaces/ns1.json
resources/nodes/cluster/node1.json

This will break old backups as the format is no longer consistent as
announced on the Google group.

Signed-off-by: Devan Goodwin <dgoodwin@redhat.com>
2017-10-17 08:49:05 -03:00
Steve Kriss 9438a8670a when backing up PVCs, also back up claimed PVs
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-10-11 09:54:57 -07:00
Steve Kriss fa427ebcfd switch to logrus for per-backup/restore logs
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-10-10 14:11:21 -07:00
ashish-amarnath 6dc81b42f5 Merge branch 'master' into support-multi-az-pvs
Signed-off-by: Ashish Amarnath <ashish.amarnath@gmail.com>
2017-10-06 23:24:41 -07:00
Ashish Amarnath 9fc9dbb413 Preserve PV's AZ info when snapshotting and restoring PVs.
- Read PV's AZ info from fault-domain label of the PV object for snapshotting.
- Store PV's AZ info in the VolumeInfo.
- Add tests for reading the label from the PV object.
- Remove availability zone validation in AWS and GCP BlockStorageAdaptor.
- Add volumeAZ as a parameter to methods in the BlockStorageAdapter interface.
- Get AZ from VolumeInfo when restoring PV snapshot.
- Remove references to PV availability zone in docs.

Signed-off-by: Ashish Amarnath <ashish.amarnath@gmail.com>
2017-10-06 23:24:41 -07:00
Steve Kriss 914165095a switch logging to logrus and errors to pkg/errors
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-10-05 08:49:33 -07:00
Andy Goldstein e8a88747eb Use pointers when printing schema.GroupResource
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-09-13 09:51:40 -04:00
Andy Goldstein 273b563c86 Add per-restore logs
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-09-13 09:51:40 -04:00
Steve Kriss 4dfce17de5 add resource includes/excludes for Restores
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-09-12 12:43:23 -07:00
Justin Nauman af2a792a9a Allows explicit include/exclude of namespaces on restores
- Introduces similar Include/Exclude declaration on the Restore
resource and cli flags
- Kept support for legacy Namespaces attribute until it could be
deprecating.  Defining both IncludeNamespaces and Namespaces results
in a validation error and the Restore will not be processed (shouldn't
be able to occur)

Signed-off-by: Justin Nauman <justin.r.nauman@gmail.com>
2017-09-05 17:17:41 -05:00
Steve Kriss 768aed4ddd make --snapshot-volumes, --restore-volumes optional with sensible default behavior based on PVProvider existence
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-08-23 09:47:52 -07:00
Steve Kriss ebc06fd632 make PVProvider optional in server config; disallow snap/restore PVs when not provided
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-08-23 09:46:15 -07:00
Andy Goldstein a865cb87ee Merge pull request #37 from skriss/iops_fix
only save/use iops for io1 volumes
2017-08-14 15:24:30 -04:00
Steve Kriss aff57e0571 switch to int64 for iops val
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-08-14 09:42:43 -07:00
Steve Kriss 49809b0a59 check for namespaces/ dir before reading it
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-08-11 14:05:06 -07:00
Andy Goldstein d5953b3772 Simplify check for owner references
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-08-02 17:10:39 -04:00
Andy Goldstein 2fe501f527 Initial commit
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-08-02 13:27:17 -04:00