Compare commits

..

1118 Commits

Author SHA1 Message Date
Steve Kriss
a357f21aec Merge pull request #1778 from skriss/v1.1.0-release
v1.1.0 docs & changelog
2019-08-22 08:34:59 -06:00
Steve Kriss
dfb225807b v1.1.0 changelog
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-08-21 15:01:10 -06:00
Steve Kriss
b1b6a79dfc Merge pull request #1776 from heptio/revert-1769-ssl
Revert "allow self signed certs with insecureSkipVerify"
2019-08-20 12:16:21 -06:00
KubeKween
b25865f5bb Revert "allow self signed certs with insecureSkipVerify (#1769)"
This reverts commit 8e35ce0bde.

Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-08-20 11:02:27 -07:00
Steve Chung
8e35ce0bde allow self signed certs with insecureSkipVerify (#1769)
* patch velero to handle self-signed certs on client

you'll get this error otherwise:
x509: certificate signed by unknown authority

Signed-off-by: Steven Chung <schung@d2iq.com>
2019-08-20 10:29:02 -07:00
Steve Kriss
9e946ee698 v1.1.0 docs
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-08-20 10:44:57 -06:00
betta1
cfb663f795 Add the prefix to BSL config map so that object stores can use it when initializing (#1767)
Signed-off-by: Antony Bett <antony.bett@gmail.com>
2019-08-19 14:05:38 -06:00
Nolan Brubaker
a0cd954ce9 Merge pull request #1772 from zakkg3/master
[DOCS] Add stable/velero to helm commands
2019-08-19 12:44:06 -04:00
Nicolas Kowenski
67203ff972 add stable/velero to helm commands
Signed-off-by: Nicolas Kowenski <nico@garufa.ethz.ch>
2019-08-19 10:56:11 +02:00
Nolan Brubaker
af4b9373fc Merge pull request #1762 from skriss/v1.1-beta.2-docs
replace v1.1.0-beta.1 docs with v1.1.0-beta.2 docs
2019-08-13 16:39:53 -04:00
Nolan Brubaker
90bb939c4d Merge pull request #1761 from skriss/v1.1-beta.2-changelog
v1.1.0-beta.2 changelog
2019-08-13 16:39:04 -04:00
Steve Kriss
c80f679802 replace v1.1.0-beta.1 docs with v1.1.0-beta.2 docs
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-08-13 13:41:36 -06:00
Steve Kriss
76a91a80b2 v1.1.0-beta.2 changelog
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-08-13 13:38:01 -06:00
Steve Kriss
3c8020e922 Merge pull request #1748 from nrb/fix-1743
Use custom namespace when creating Velero clients
2019-08-13 12:08:30 -06:00
Nolan Brubaker
dadb466545 Document process for adding VELERO_NAMESPACE
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-08-13 13:42:08 -04:00
Steve Kriss
5ef0a84128 create pod volume backups in backup's namespace during sync (#1760)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-08-13 10:20:25 -07:00
Nolan Brubaker
363c2692a1 Use custom namespace when creating Velero clients
The Velero deployment did not have a way of exposing the namespace it
was installed in to the API client. This is a problem for plugins that
need to query for resources in that namespaces, such as the restic
restore process that needs to find PodVolume(Backup|Restore)s.

While the Velero client is consulted for a configured namespace, this
cannot be set in the server pod since there is no valid home directory
in which to place it.

This change provides the namespace to the deployment via the downward
API, and updates the API client factory to use the VELERO_NAMESPACE
before looking at the config file, so that any plugins using the client
will look at the appropriate namespace.

Fixes #1743

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-08-13 13:06:12 -04:00
Christian Kotzbauer
1670aa17b6 Fix port-forward typo (#1756)
* doc: fix typo

Signed-off-by: Christian Kotzbauer <christian.kotzbauer@gmail.com>

* doc: fix typo

Signed-off-by: Christian Kotzbauer <christian.kotzbauer@gmail.com>

* doc: fix typo

Signed-off-by: Christian Kotzbauer <christian.kotzbauer@gmail.com>
2019-08-12 11:37:22 -06:00
Nolan Brubaker
52e5589b3d Merge pull request #1705 from skriss/pv-cloning-design
draft design doc for cloning PVs while remapping namespaces
2019-08-12 12:33:33 -04:00
Jonas Rosland
e576f23c70 Add SEO functionality to the site (#1753)
* Add SEO functionality to the site

Signed-off-by: Jonas Rosland <jrosland@vmware.com>

* Add some more SEO

Signed-off-by: Jonas Rosland <jrosland@vmware.com>
2019-08-12 10:11:42 -06:00
Adnan Abdulhussein
7b7b96de74 velero install: support velero/restic pod cpu/mem requests with unbounded limits (#1745)
* support velero/restic pod cpu/mem requests with unbounded limits

explicitly treat "0" value as unbounded

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>

* update flag documentation

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>

* changelog

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>

* update restic configmap docs

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
2019-08-09 12:54:04 -06:00
Nolan Brubaker
ad026107c9 Merge pull request #1741 from prydonius/1731-sort-resource-list
sort output of resource list in `velero backup describe --details`
2019-08-09 14:35:54 -04:00
Adnan Abdulhussein
92b930d351 sort GVKs in output
Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
2019-08-08 15:13:35 -07:00
Adnan Abdulhussein
f18d7300a8 changelog
Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
2019-08-08 13:56:48 -07:00
Adnan Abdulhussein
faef20d45a ensure backup resource list per gvk is sorted
Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
2019-08-08 13:53:40 -07:00
Steve Kriss
9b18e238b1 change to approved
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-08-08 11:21:14 -06:00
Steve Kriss
5917445511 incorporate review feedback
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-08-08 10:19:34 -06:00
Nolan Brubaker
1429f226ed Merge pull request #1739 from skriss/fix-pvb-upload-bug
bug fix: upload pod volume backups from *all* pods to obj storage
2019-08-08 11:42:46 -04:00
Steve Kriss
c69fa4d0e1 bug fix: upload pod volume backups from *all* pods to obj storage
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-08-08 09:27:46 -06:00
Nolan Brubaker
53b5b87742 Merge pull request #1736 from skriss/goreleaser-fixes
goreleaser: archive -> archives, add auto prerelease setting
2019-08-07 12:16:52 -04:00
Nolan Brubaker
e2278ed9d2 Merge pull request #1737 from skriss/move-pkg-util-test
move contents of pkg/util/test into pkg/test
2019-08-07 11:56:01 -04:00
Steve Kriss
ffa3251efc move contents of pkg/util/test into pkg/test
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-08-07 08:26:00 -06:00
Steve Kriss
efdb3796ac goreleaser: archive -> archives, add auto prerelease setting
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-08-07 08:18:40 -06:00
Steve Kriss
9d9c232729 add v1.1.0-beta.1 changelog (#1733)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-08-07 07:51:46 -06:00
Nolan Brubaker
d5dd39c941 Merge pull request #1732 from skriss/v1.1-beta.1-docs
generate v1.1.0-beta.1 docs
2019-08-06 18:01:10 -04:00
Steve Kriss
d881a10fba generate v1.1.0-beta.1 docs
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-08-06 15:14:16 -06:00
Steve Kriss
80692a8a39 Properly restore PVs with a reclaim policy of Retain and restic backups (#1713)
* reorganize persistent volume restore code for clarity

Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-08-06 13:40:35 -07:00
KubeKween
4accb8512a Restore from PodVolumeBackups (#1723)
* Restore from PodVolumeBackups

Signed-off-by: Carlisia <carlisiac@vmware.com>

* Partially address code reviews

Signed-off-by: Carlisia <carlisiac@vmware.com>

* Partially address code reviews #2

Signed-off-by: Carlisia <carlisiac@vmware.com>

* Clean up struct

Signed-off-by: Carlisia <carlisiac@vmware.com>

* Fix log messages

Signed-off-by: Carlisia <carlisiac@vmware.com>

* Fix tests

Signed-off-by: Carlisia <carlisiac@vmware.com>

* Clean up

Signed-off-by: Carlisia <carlisiac@vmware.com>

* Add changelog

Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-08-06 13:17:36 -07:00
Adnan Abdulhussein
4e1b1f9457 use Backup CR labels as tags for snapshots (#1729)
* use Backup CR labels as tags for snapshots

This allows users to define custom tags to be added to snapshots, by
specifying custom labels on the Backup CR with the `velero backup create
--labels` flag.

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
2019-08-06 13:01:36 -07:00
Nolan Brubaker
de442c1106 Merge pull request #1727 from skriss/fix-pvb-sync
fix bugs preventing pod volume backups from syncing properly
2019-08-06 14:13:32 -04:00
Steve Kriss
6522ba7c42 fix bugs preventing pod volume backups from syncing properly
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-08-06 09:23:49 -06:00
Steve Kriss
a590fc9468 refactor GetBackupVolumeSnapshots and GetPodVolumeBackups (#1721)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-08-05 15:42:01 -06:00
Steve Kriss
539e0b54c6 use the persistent --namespace flag in 'velero install' (#1722)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-08-05 15:40:39 -06:00
Nolan Brubaker
a4e70456a1 Add resource limits to restic init container (#1677)
* Add resource limits to restic init container

Fixes #1201

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Start restic restore item action tests

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Get initial tests for restore action working

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Add new test case

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Move resource parsing into a shared function

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Fetch request/limits from plugin's ConfigMap

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Use builders

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Use moved ParseResourceRequirements function

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Move init container building inline

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Drop CPU limit down a bit and clarify error message

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Fix godoc

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Add resource requirements to doc

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-08-05 13:18:11 -06:00
Adnan Abdulhussein
2254635bcb print resource list metadata in velero backup describe --details (#1714)
* print resource list metadata in velero backup describe details

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>

* rewrite TestGetDownloadURL to test more scenarios

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>

* move backup printer helpers to backup_printer.go

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>

* move describe printer helpers back to backup_describer

and rename to prefix with describe* to indicate that they are used for the describe command

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>

* split backup and restore tests for TestGetDownloadURL

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>

* friendlier error message when backup resource list missing

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
2019-08-05 12:23:20 -06:00
Adnan Abdulhussein
07525bd593 store backup resource list metadata in object storage (#1709)
* move backedUpItems to pkg/backup.Request struct

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>

* construct resource itemKey field from gvk

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>

* store backup resource list metadata in object storage

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>

* remove debug log

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>

* fix formatting

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>

* add missing license blocks and split BackupInfo struct lines

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>

* add test for checking BackedUpItems matches tarball contents

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>

* add comment to explain test

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
2019-08-05 11:15:55 -06:00
Nolan Brubaker
635dd27e1a Make secret file optional on install (#1699)
* Make secret file optional on install

Fixes #1689

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-08-01 15:57:36 -07:00
Adnan Abdulhussein
2a6929d453 add velero install flags for configuring restic resource requirements (#1710)
* add velero install flags for configuring restic resource requirements

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
2019-07-31 12:24:47 -07:00
Steve Kriss
b24a603711 periodically check for stale restic repo locks (#1708)
* periodically check for stale restic repo locks

Signed-off-by: Steve Kriss <krisss@vmware.com>

* changelog

Signed-off-by: Steve Kriss <krisss@vmware.com>

* only try to init a restic repo if it doesn't already exist

Signed-off-by: Steve Kriss <krisss@vmware.com>

* reword comment

Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-07-31 10:52:23 -07:00
Steve Kriss
f2d06bc5e9 strip leading/trailing slashes from BSL bucket & prefix vals (#1694)
* strip leading/trailing slashes from BSL bucket & prefix vals

Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-07-31 08:27:12 -07:00
Steve Kriss
4543258970 Update tests to use object builders in pkg/builder (#1707)
* add pkg/builder with BackupBuilder and ObjectMeta functional options

Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-07-31 07:46:48 -07:00
carthewd
22eca22ac8 Add JSON as an option for log output (#1654)
* Add JSON as an option for log output

Signed-off-by: Donovan Carthew <donovan.carthew@gmail.com>
2019-07-30 16:29:34 -07:00
Pierre Ozoux
6188cdffb0 Fixes documentation about aws region. (#1690)
Signed-off-by: pierreozoux <pierre@ozoux.net>
2019-07-30 10:16:05 -06:00
Adnan Abdulhussein
935107e1a2 update backup resource list proposal to use gzipped json (#1706)
Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
2019-07-29 16:08:43 -07:00
Steve Kriss
bf247836e6 Migrate restic backup tests (#1703)
* migrate pkg/backup restic tests to new structure

Signed-off-by: Steve Kriss <krisss@vmware.com>

* rename backup_new_test.go to backup_test.go

Signed-off-by: Steve Kriss <krisss@vmware.com>

* use pod volume backup builder

Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-07-29 15:29:44 -07:00
Steve Kriss
b24e940399 V1.1 docs updates (#1704)
* remove docs header about project rename

Signed-off-by: Steve Kriss <krisss@vmware.com>

* remove Upgrade to 1.0 page from master TOC

Signed-off-by: Steve Kriss <krisss@vmware.com>

* standardize TOC titles

Signed-off-by: Steve Kriss <krisss@vmware.com>

* add backup/restore docs for undocumented features

Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-07-29 14:37:18 -07:00
Steve Kriss
65030f7fbc draft design doc for cloning PVs while remapping namespaces
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-07-29 14:35:54 -06:00
Adnan Abdulhussein
248ee89123 add configurable CPU/memory requests/limits for velero pod on install (#1678)
* add configurable CPU/memory requests/limits for velero pod on install

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
2019-07-29 15:13:06 -04:00
Adnan Abdulhussein
52d97e7bd7 proposal: expose list of backed up resources in backup details (#1682)
* proposal: expose list of backed up resources in backup details

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
2019-07-29 14:00:56 -04:00
ThoTischner
b8f3a008cb Add docu for restic pvc backup annotation watch controller (#1680)
Signed-off-by: Thomas Tischner <tti@bitsbeats.com>
2019-07-25 12:54:09 -06:00
Nolan Brubaker
25a481f6b1 Clarify language on the restic docs (#1700)
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-07-25 08:59:47 -06:00
KubeKween
3b9af8c654 Store PodVolumeBackups in obj storage & use as source of truth (#1577)
* Store PodVolumeBackups in object storage

Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-07-24 15:51:20 -04:00
Nolan Brubaker
f80e1dc390 Enable Jekyll incremental rebuilds (#1695)
Without the incremental switch, live rebuilds were taking 20s (on a
Linux host) for a single-line change. With the switch, they dropped to
8s.

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-07-23 12:45:54 -06:00
Steve Kriss
3c4dd3e526 fix typo in schedule create example (#1693)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-07-23 11:02:38 -07:00
Steve Kriss
8336d95f57 tweak use case bullets in readme for clarity (#1692)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-07-23 10:13:05 -07:00
Nolan Brubaker
5f409f12c8 Document --pod-annotations install argument (#1674)
* Document --pod-annotations install argument

Fixes #1667

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Revert v1.0.0 edits

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Make pod annotations example commands complete

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-07-19 12:12:57 -07:00
Adnan Abdulhussein
65906efffa fix Deployments in examples for apps/v1 selector requirement (#1684)
The apps/v1 API makes the selector in Deployments a required property.

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
2019-07-19 11:40:47 -06:00
Nolan Brubaker
c8bac5bfae Merge pull request #1681 from jonasrosland/add-survey
Add link to the Velero user survey
2019-07-18 12:23:20 -04:00
jonasrosland
92ac710dab Add link to the Velero user survey
Signed-off-by: jonasrosland <jrosland@vmware.com>
2019-07-18 12:13:28 -04:00
Nolan Brubaker
c69b94da76 Merge pull request #1649 from skriss/fix-hooks-link
fix link for hooks example
2019-07-17 18:48:47 -04:00
Steve Kriss
927d2775bf add make gen-docs to generate a new versioned docs directory (#1662)
* add make gen-docs to generate a new versioned docs directory

Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-07-17 18:44:13 -04:00
Steve Kriss
1594bdc8d0 fix jekyll build errors (#1666)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-07-17 14:24:18 -07:00
Nolan Brubaker
aa8c0cd471 Honor kube client flags in install command (#1656)
Flags specifying the kubeconfig or kubecontext to use weren't actually
being used by the install command.

Fixes #1651

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-07-17 14:19:14 -07:00
Nolan Brubaker
3124570c7f Remove references to apps/v1beta1 API group (#1673)
* Remove references to apps/v1beta1 API group

In Kubernetes v1.16, the apps/v1 API group will be the default served
for relevant resources.

Update any references to apps/v1beta1 for fowards compatibility.

Fixes #1672

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Update API group on plugin commands

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-07-17 15:03:48 -06:00
Nolan Brubaker
1d54996fce Document Helm secrets format. (#1665)
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-07-17 14:03:31 -07:00
Nolan Brubaker
5841f82ee9 Merge pull request #1671 from prydonius/1663-update-azure-sp-creation-docs
docs: remove custom password option from azure service principle create command
2019-07-17 13:42:42 -04:00
Adnan Abdulhussein
1c69bafeeb docs: remove custom password option from azure service principle create command
Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
2019-07-16 15:13:27 -07:00
Steve Kriss
8e098e2f6c document the ConfigMap convention for plugins (#1670)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-07-16 14:21:40 -07:00
Adnan Abdulhussein
500d5485b1 omit storageClassName in nginx example to use default StorageClass (#1669)
Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
2019-07-16 11:15:35 -06:00
Steve Kriss
1bb167ef90 add restore item action to change PVC/PV storage class name (#1621)
* add restore item action to change PVC/PV storage class name

Signed-off-by: Steve Kriss <krisss@vmware.com>

* code review

Signed-off-by: Steve Kriss <krisss@vmware.com>

* change existing plugin names to lowercase/hyphenated

Signed-off-by: Steve Kriss <krisss@vmware.com>

* add validation for new storage class name

Signed-off-by: Steve Kriss <krisss@vmware.com>

* add test cases

Signed-off-by: Steve Kriss <krisss@vmware.com>

* changelog

Signed-off-by: Steve Kriss <krisss@vmware.com>

* fix imports

Signed-off-by: Steve Kriss <krisss@vmware.com>

* update plugin names to be more consistent

Signed-off-by: Steve Kriss <krisss@vmware.com>

* update unit tests to use pkg/test object constructors

Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-07-15 11:19:38 -07:00
Steve Kriss
11194d1071 fix link for hooks example
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-07-11 12:25:16 -06:00
Nolan Brubaker
63964fc6f9 Append "/mount" to directory for CSI volumes (#1615)
CSI volumes are mounted one level deeper than "native" kubernetes
volumes, and this needs to be appended for proper restic support.

Fixes #1313.

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-07-10 15:16:21 -07:00
ThoTischner
d615cc6de0 openshift needs namespace annotation for restic to schedule on all nodes (#1629)
* openshift needs namespace annotation for restic to schedule on all nodes

Signed-off-by: Thomas Tischner <tti@bitsbeats.com>
2019-07-10 14:04:39 -07:00
Steve Kriss
8cde8fdbc7 update GitHub feature enhancement template (#1632)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-07-10 13:45:54 -07:00
Steve Kriss
ac00185a5f add design/ dir and doc template (#1636)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-07-10 13:35:45 -07:00
Nolan Brubaker
31973fbf04 Merge pull request #1640 from skriss/restore-test-refactor
Reorganize pkg/restore test code
2019-07-10 16:11:01 -04:00
Steve Kriss
d1025f7547 rename restore_new_test.go to restore_test.go
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-07-10 09:59:27 -06:00
Steve Kriss
678c02c560 move contents of restore_test.go into other files and delete it
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-07-10 09:59:01 -06:00
Nolan Brubaker
7724464017 Merge pull request #1605 from Prajyot-Parab/add-ppc64le-support
enable support for ppc64le architecture
2019-07-09 13:43:11 -04:00
Prajyot-Parab
f44bd53cf0 minor fixes
Signed-off-by: Prajyot-Parab <Prajyot.Parab@ibm.com>
2019-07-09 06:02:14 +00:00
Nolan Brubaker
2498ac6cab Merge pull request #1630 from jwmatthews/cli_namespace
bug fix: Fixed namespace usage with cli command 'version'
2019-07-08 13:42:29 -04:00
John Matthews
afa49f398f bug fix: Fixed namespace usage with cli command 'version'
Signed-off-by: John Matthews <jwmatthews@gmail.com>
2019-07-07 13:54:46 -04:00
Traci Kamp
f829dabcf4 Add pod-annotations CLI flag to the install command (#1626)
* allow users to specify additional Velero/restic pod annotations on the command line with the pod-annotations flag

Signed-off-by: Traci Kamp <traci.kamp@gmail.com>
2019-07-03 15:22:34 -07:00
Adnan Abdulhussein
eec5cc687e validate pod volumes hostpath mount on restic server startup (#1616)
Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
2019-07-03 14:20:31 -06:00
Steve Kriss
bf00754280 fix schedule create examples to use hours as units (#1625)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-07-03 12:20:49 -07:00
Nolan Brubaker
13cac85c1e Merge pull request #1614 from skriss/restore-pv-tests
migrate restore PV tests
2019-07-03 12:34:09 -04:00
Steve Kriss
567802299b move PV/PVC setup helpers into pkg/test
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-07-03 08:50:11 -06:00
Steve Kriss
adb93c33b1 migrate restore PV tests
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-07-03 08:50:09 -06:00
Nolan Brubaker
e371ba78b0 Merge pull request #1612 from skriss/restore-addl-items-bugs
properly filter additional items returned from restore item actions
2019-06-28 17:12:38 -04:00
Adnan Abdulhussein
2156124dfc record PodVolumeBackup/Restore start and completion timestamps (#1609)
* record PodVolumeBackup start and completion timestamps

adds startTimestamp and completionTimestamp fields to the
PodVolumeBackup status spec

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>

* record PodVolumeRestore start and completion timestamps

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
2019-06-28 11:58:02 -04:00
Steve Kriss
db393ec199 properly filter additional items returned from restore item actions
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-06-28 08:59:23 -06:00
Steve Kriss
022099a62e Refactor pkg/restore tests (part 3) (#1611)
* add modifying restore item action tests

Signed-off-by: Steve Kriss <krisss@vmware.com>

* add restore item action additional items tests

Signed-off-by: Steve Kriss <krisss@vmware.com>

* migrate ShouldRestore test

Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-06-27 15:43:59 -07:00
Nolan Brubaker
55054f67a5 Merge pull request #1607 from skriss/fix-restore-action-bugs
Fix bugs in determining which restore item actions to run
2019-06-27 16:50:58 -04:00
Steve Kriss
75a96dfa92 fix bugs in finding applicable restore item actions
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-06-27 13:06:16 -06:00
Steve Kriss
81c2adc059 Refactor pkg/restore tests (part 2) (#1606)
* update TestPrioritizeResources to use real discovery helper

Signed-off-by: Steve Kriss <krisss@vmware.com>

* migrate invalid tarball contents tests

Signed-off-by: Steve Kriss <krisss@vmware.com>

* migrate item restore tests

Signed-off-by: Steve Kriss <krisss@vmware.com>

* migrate restore item action tests

Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-06-27 11:57:47 -07:00
Nolan Brubaker
dd96aa76db Merge pull request #1603 from skriss/restore-tests
Migrate restore tests to new structure (part 1)
2019-06-26 12:37:01 -04:00
Steve Kriss
0089fa4d93 migrate restore resource priorities test
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-06-26 10:24:02 -06:00
Nolan Brubaker
553df25710 Merge pull request #1604 from skriss/update-install-link
update README.md link to install docs, minor reorg install docs content
2019-06-26 12:12:16 -04:00
root
764de79cf5 add changelog
Signed-off-by: root <root@prajyot-ppc-velero-client.novalocal>
2019-06-26 11:13:49 +00:00
root
f4c64ae75a enable support for ppc64le architecture
Signed-off-by: root <root@prajyot-ppc-velero-client.novalocal>
2019-06-26 10:37:34 +00:00
Steve Kriss
c48586a8c7 update README.md link to install docs, minor reorg install docs content
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-06-25 09:00:40 -06:00
Steve Kriss
5d8ba1b90d migrate namespace mapping tests
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-06-24 16:57:30 -06:00
Steve Kriss
1a339f06ac migrate restore resource filtering tests
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-06-24 15:53:15 -06:00
Adnan Abdulhussein
b0bdaeea73 ensure correct backup item actions run with namespace selector (#1601)
* ensure correct backup item actions run with namespace selector

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>

* changelog

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>

* don't run backup item actions for namespace resources

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>

* simplify cluster-scope resources checks

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
2019-06-24 15:50:25 -06:00
Nolan Brubaker
08fe7be851 Fix test conflicts from #1595 and #1598 (#1602)
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-06-24 15:34:56 -06:00
Nolan Brubaker
67512a3808 Merge pull request #1595 from skriss/restore-test-refactor-1
initial refactoring for pkg/restore tests
2019-06-24 17:08:51 -04:00
Nolan Brubaker
37c7b618ad Merge pull request #1598 from skriss/rm-has-controller-owner
remove unused hasControllerOwner func and tests
2019-06-24 16:51:28 -04:00
Nolan Brubaker
d143137a70 Merge pull request #1599 from jonasrosland/add-github-link
Add GitHub link in the footer
2019-06-24 16:39:59 -04:00
Steve Kriss
5634a4f463 migrate backup hooks tests (#1591)
* migrate hooks tests

Signed-off-by: Steve Kriss <krisss@vmware.com>

* add more test cases

Signed-off-by: Steve Kriss <krisss@vmware.com>

* refactor to strongly typed expectation, add pre+post hook test case

Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-06-24 12:23:17 -07:00
Steve Kriss
19052994ed replace TestBackup with pkg/backup.Builder (#1593)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-06-21 17:08:08 -04:00
jonasrosland
8cb9ee9eb8 Add GitHub link in the footer
Signed-off-by: jonasrosland <jrosland@vmware.com>
2019-06-21 16:53:00 -04:00
Steve Kriss
0d326a3903 remove unused hasControllerOwner func and tests
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-06-21 11:44:13 -06:00
Mickey Boxell
d916ae0a25 document Oracle Cloud Storage as a backup provider (#1570)
Signed-off-by: mickey.boxell <mickey.boxell@oracle.com>
2019-06-21 10:29:58 -06:00
Nolan Brubaker
b00e0e834a Merge pull request #1594 from jonasrosland/community-update
Add more community info - direct links to meetings and ZenHub
2019-06-21 12:20:34 -04:00
Steve Kriss
d421fcd85c initial structure for refactored pkg/restore tests
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-06-21 09:15:18 -06:00
Steve Kriss
0735ee7218 extract shared API test helpers to pkg/test
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-06-20 14:57:31 -06:00
jonasrosland
223aec8200 Add more community info - direct links to meetings and ZenHub
Signed-off-by: jonasrosland <jrosland@vmware.com>
2019-06-20 13:35:32 -04:00
Jonas Rosland
870743a28d Add redirect for docs (#1584)
* Add redirects for docs

Signed-off-by: jonasrosland <jrosland@vmware.com>
2019-06-19 12:20:56 -04:00
Adnan Abdulhussein
1f4139a5bf allow exclusion of resources using standard label (#1588)
* allow exclusion of resources using standard label

excludes any resources with the velero.io/exclude-from-backup=true label

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
2019-06-19 10:58:02 -04:00
Steve Kriss
a2e88c4d3f Merge pull request #1585 from nrb/local-docs
Add make serve-docs target for local viewing
2019-06-18 14:00:09 -06:00
Adnan Abdulhussein
2d81e29276 ensure backup item action modifications reflected in tarball filepath (#1587)
* ensure backup item action modifications reflected in tarball filepath

This patch ensures the updated backup item's name and namespace are used
when constructing the filepath for the tarball.

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>

* changelog

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
2019-06-18 12:19:00 -06:00
Ross Fenrick
5d3312b7b5 added top spacing and reduced bottom (#1583)
* added top spacing and reduced bottom

Signed-off-by: Ross Fenrick <rossf@heptio.com>

* added marign to h3's

Signed-off-by: Ross Fenrick <rossf@heptio.com>
2019-06-18 12:14:13 -06:00
Nolan Brubaker
fac3cd4a78 Merge pull request #1574 from skriss/backup-snapshot-tests
migrate backup PV snapshot tests
2019-06-17 14:47:38 -04:00
Stephen Carter
3ff95eaa40 Add restic instructions for Enterprise PKS (#1579)
* Add restic instructions for Enterprise PKS

Signed-off-by: Stephen Carter <carters@vmware.com>

* Add instructions to v1.0.0 docs

Signed-off-by: Stephen Carter <carters@vmware.com>
2019-06-14 15:35:44 -07:00
Nolan Brubaker
023d43d0fe Add make serve-docs target for local viewing
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-06-14 15:15:36 -04:00
Nolan Brubaker
b807b449d6 Merge pull request #1582 from jonasrosland/add-adnan
Adding Adnan to the team
2019-06-14 15:07:01 -04:00
jonasrosland
1ded7c7207 Adding Adnan to the team
Signed-off-by: jonasrosland <jrosland@vmware.com>
2019-06-14 10:51:52 -04:00
Monica
f3850210aa Discontinue use of excerpt separators in blog posts. (#1578)
Signed-off-by: Monica rodriguezmo@vmware.com
2019-06-13 10:30:36 -07:00
Steve Kriss
e2bf39a027 migrate PV snapshot tests
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-06-12 13:03:32 -06:00
Steve Kriss
6513e8f30e migrate more backup action tests, remove obsolete test code (#1564)
* migrate more backup action tests, remove obsolete test code

Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-06-12 14:45:04 -04:00
Steve Kriss
49f52b54b2 Merge pull request #1562 from carlisia/c-bug-sort
Fix test comparison
2019-06-11 12:34:35 -06:00
Adnan Abdulhussein
74b575200c hide server commands in velero CLI (#1561)
* hide server commands in velero CLI

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>

* changelog

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>

* remove unnecessary comment

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
2019-06-10 19:20:17 -06:00
Carlisia
520077c3a9 Fix test comparison
Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-06-10 16:34:29 -07:00
Steve Kriss
e183c4b597 remove glog (#1559)
* remove glog refs, replace with klog equivalents

Signed-off-by: Steve Kriss <krisss@vmware.com>

* remove glog from deps

Signed-off-by: Steve Kriss <krisss@vmware.com>

* changelog

Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-06-10 15:44:44 -07:00
Steve Kriss
f0f7d31e1b move issue-template-gen from docs/ to hack/ (#1558)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-06-10 15:22:27 -07:00
Steve Kriss
9a62d887d3 update go-plugin to latest for bug fix (#1560)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-06-10 14:15:00 -07:00
Adnan Abdulhussein
d6c60b2dd5 fix panic when processing DeleteBackupRequest objs without labels (#1556)
This fix initialises an empty map if the request object's Labels map
is nil, allowing the controller to later add and modify labels on the
object.

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
2019-06-10 10:04:51 -07:00
Steve Kriss
9e7ff4e3d9 Refactoring for backup item action tests (#1545)
* migrate and enhance backup item action tests

Signed-off-by: Steve Kriss <krisss@vmware.com>

* migrate terminating resource test

Signed-off-by: Steve Kriss <krisss@vmware.com>

* add godoc for test functions

Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-06-09 21:02:49 -07:00
Pranav Gaikwad
bb12cbd2d7 Support for multiple AWS profiles (#1548)
* added support for multiple AWS credential profiles

Signed-off-by: Pranav Gaikwad <pgaikwad@redhat.com>
2019-06-07 11:01:39 -07:00
Steve Kriss
16a08b82a9 Merge pull request #1543 from AliyunContainerService/master
add a link of velero plugin for alibabacloud to support-matrix docs
2019-06-07 08:13:30 -06:00
Shuwei Hao
c539e8ad63 add a link of velero plugin for alibabacloud to support-matrix docs
Signed-off-by: Shuwei Hao <haoshuwei24@gmail.com>
2019-06-07 22:00:55 +08:00
Adnan Abdulhussein
f1319be60b fixes inlining of command in GCP setup docs (#1547)
* fixes inlining of command in GCP setup docs

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
2019-06-06 16:39:05 -07:00
coonsd
7d9fc88eb3 Signed-off-by: David Coons <coonsd@oregonstate.edu> (#1550) 2019-06-06 06:10:31 -07:00
KubeKween
0a771e6a53 Add cmd to list plugins (#1535)
* Add cmd to list plugins

Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-06-05 13:41:02 -04:00
Steve Kriss
bc7ee686d7 Merge pull request #1428 from guilhem/glob
Add ability to use wildcard in includes/excludes
2019-06-05 09:53:37 -06:00
Guilhem Lettron
81a26e4aad Add ability to use wildcard in includes/excludes
Use https://github.com/gobwas/glob as glob engine
Fix #373

Signed-off-by: Guilhem Lettron <guilhem@barpilot.io>
2019-06-05 16:28:25 +02:00
Steve Kriss
caa0bff5a3 Initial pkg/backup test refactoring (#1532)
Initial pkg/backup test refactoring

Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-06-04 19:47:22 -07:00
Steve Kriss
83c3143825 Merge pull request #1506 from nrb/ci-optimization
Only run CI when relevant files have changed
2019-05-31 09:57:56 -06:00
Nolan Brubaker
81287e4751 Only run CI when relevant files have changed
If nothing outside of the site directory was modified, don't run `make
ci`.

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-05-30 17:32:23 -04:00
KubeKween
0804f34644 Don't log error if restic volume is empty (#1480)
* Don't log error if restic volume is empty

Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-05-30 12:48:21 -04:00
Steve Kriss
411d44a673 allow individual backup storage locations to be read-only (#1517)
* allow individual backup storage locations to be read-only

Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-05-29 14:21:25 -04:00
Steve Kriss
4e2e4cd5c4 Merge pull request #1490 from abessifi/restic-openshift
[DOC] Restic support on OpenShift
2019-05-29 08:29:42 -06:00
abessifi
108d826ca5 [DOC] Restic support on OpenShift
Signed-off-by: abessifi <ahmed.bessifi@gmail.com>
2019-05-29 14:12:10 +02:00
Jonas Rosland
bbb11a8d23 Docs updates - extra finishing touches (#1516)
* Docs formatting updates

Signed-off-by: Jonas Rosland <jrosland@vmware.com>
2019-05-28 12:42:27 -04:00
Nolan Brubaker
82e464672b Merge pull request #1526 from emenare/1521-emenare
1521: Change menu order for docs header.
2019-05-28 11:56:23 -04:00
Monica Rodriguez
035c297287 1521: Change menu order for docs header.
Signed-off-by: Monica rodriguezmo@vmware.com
2019-05-28 11:32:39 -04:00
Steve Kriss
02095d21d8 Merge pull request #1513 from jonasrosland/master
Fix formatting on AWS docs
2019-05-22 09:03:39 -06:00
Jonas Rosland
5f7bab945d Fix formatting on AWS docs
Signed-off-by: Jonas Rosland <jrosland@vmware.com>
2019-05-21 14:35:58 +02:00
Nolan Brubaker
ddb335475b Merge pull request #1510 from skriss/1.14-deps
upgrade to kubernetes 1.14 dependencies
2019-05-20 16:30:57 -04:00
Nolan Brubaker
915b3a1ddf Merge pull request #1509 from skriss/rm-cli-doc-gen-code
remove obsolete code for generating CLI ref docs (breaks go test ./...)
2019-05-20 16:28:16 -04:00
Steve Kriss
a1f26aa3a8 remove obsolete code for generating CLI ref docs (breaks go test ./...)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-05-20 13:26:44 -06:00
Steve Kriss
9287505f62 fixes for breaking changes
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-05-20 13:25:36 -06:00
Steve Kriss
02c7df9ea0 update generated code
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-05-20 13:25:36 -06:00
Steve Kriss
13b6cbb4db update to kubernetes 1.14 deps
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-05-20 13:25:36 -06:00
Steve Kriss
029cee6bc3 Merge pull request #1504 from jonasrosland/1.0-blog
Add 1.0 release blog
2019-05-20 09:53:04 -06:00
Jonas Rosland
1ed5255f17 Add 1.0 release blog
Signed-off-by: Jonas Rosland <jrosland@vmware.com>
2019-05-20 14:54:06 +02:00
Steve Kriss
72f5cadc3a Merge pull request #1502 from skriss/1.0-docs
add 1.0 docs
2019-05-19 20:02:15 -06:00
Steve Kriss
1ed1a84ebf Merge pull request #1478 from skriss/readme-updates
remove text about release tarball containing static YAML
2019-05-19 20:00:29 -06:00
Steve Kriss
15289295af Merge pull request #1491 from skriss/1.0-changelog
1.0 changelog
2019-05-19 19:59:48 -06:00
Steve Kriss
f44ad1ad34 update root README.md to point to 1.0 docs
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-05-19 13:47:00 -06:00
Steve Kriss
e7e2e8c390 add 1.0 changelog
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-05-19 13:42:16 -06:00
Steve Kriss
effa5dbeee add 1.0 docs
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-05-19 13:41:47 -06:00
Steve Kriss
f3fd902de8 remove text about release tarball containing static YAML
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-05-19 13:39:15 -06:00
Steve Kriss
ac9b29f2d7 Merge pull request #1503 from skriss/fix-links
update docs links to point to velero.io
2019-05-19 13:17:49 -06:00
Steve Kriss
93c0ed111f update docs links to point to velero.io
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-05-19 13:11:30 -06:00
Steve Kriss
0753a2572a Merge pull request #1501 from skriss/migration-secret
add instructions for getting local credentials when upgrading
2019-05-19 12:39:40 -06:00
Steve Kriss
a053989693 add instructions for getting local credentials when upgrading
Signed-off-by: Steve Kriss <krisss@vmware.com>
Co-authored-by: Nolan Brubaker <brubakern@vmware.com>
2019-05-19 12:32:30 -06:00
Steve Kriss
6db2283b84 Merge pull request #1497 from skriss/docs-fixes
docs fixes
2019-05-17 14:01:34 -07:00
Steve Kriss
9194eba5f0 add master docs to dropdown
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-05-17 14:55:15 -06:00
Steve Kriss
e57eeef208 fix image link
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-05-17 14:55:15 -06:00
Steve Kriss
b0afa979ff remove issue-template-gen/ from v0.10 and master docs
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-05-17 14:55:15 -06:00
Steve Kriss
e8e5485b94 Merge pull request #1495 from jonasrosland/master
Small fixes to the README and site
2019-05-17 13:54:14 -07:00
Jonas Rosland
eafe53560b Small fixes to the README and site
Signed-off-by: Jonas Rosland <jrosland@vmware.com>

Add docs/latest

Signed-off-by: Jonas Rosland <jrosland@vmware.com>

Add hardcoded links to latest release for now

Signed-off-by: Jonas Rosland <jrosland@vmware.com>
2019-05-17 22:48:22 +02:00
Steve Kriss
f3663846a2 Merge pull request #1496 from carlisia/c-types2
Add types
2019-05-17 12:41:17 -07:00
Carlisia
bdb7fe854c Add types
Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-05-17 12:17:10 -07:00
Lee Springer
d995018a3e add velero.io site content, move docs to under site/docs (#1489)
* Adding in Jekyll site | Adjusting gitignore for Jekyll build | Moving docs to site folder

Signed-off-by: Lee Springer <lee@smalltalk.agency>

Adding in Jekyll site | Adjusting gitignore for Jekyll build | Moving docs to site folder

Signed-off-by: Lee Springer <lee@smalltalk.agency>

* Restore main.go to original location

Signed-off-by: Lee Springer <lee@smalltalk.agency>

* Updates to footer

Signed-off-by: Lee Springer <lee@smalltalk.agency>

* Updates to homepage links

Signed-off-by: Lee Springer <lee@smalltalk.agency>

* Content updates

Signed-off-by: Lee Springer <lee@smalltalk.agency>
2019-05-17 10:56:03 -07:00
Steve Kriss
5d8df26b35 Merge pull request #1485 from skriss/0.11.1-cl-master
v0.11.1 changelog (in master branch)
2019-05-17 09:44:00 -07:00
Nolan Brubaker
deb8a27bd4 Merge pull request #1488 from skriss/ubuntu-base
change base images to ubuntu:bionic
2019-05-15 13:33:18 -07:00
Steve Kriss
c49e1ff0cc change base images to ubuntu:bionic
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-05-15 12:56:20 -07:00
Mayank
5a811b4629 Add OpenEBS to Volume Snapshot Providers (#1483)
Signed-off-by: mayank <mayank.patel@cloudbyte.com>
2019-05-15 10:20:07 -07:00
KubeKween
5602ca9d29 Add all api types to docs (#1482)
* Add all api types to docs

Signed-off-by: Carlisia <carlisiac@vmware.com
2019-05-15 09:59:19 -07:00
Steve Kriss
95d2d47b77 v0.11.1 changelog
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-05-15 09:45:19 -07:00
Steve Kriss
ee8f8ca1db Merge pull request #1479 from carlisia/c-site
Ignore site directory when making
2019-05-14 10:06:33 -07:00
Carlisia
91a35c2f4e Ignore site directory when making
Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-05-14 09:57:08 -07:00
Nolan Brubaker
b3c6e5e483 Add more examples to schedule create (#1473)
Partially addresses #1464

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-05-13 09:25:25 -07:00
Nolan Brubaker
079444410f Document that hooks don't execute within a shell (#1474)
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-05-13 09:24:27 -07:00
Nolan Brubaker
c209f0c0c3 Add snapshot-location to velero create command (#1472)
`velero snapshot-location create` existed, but not `velero create
snapshot-location`; update subcommand for parity with backup-location

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-05-13 09:23:25 -07:00
Steve Kriss
d05f8e53d8 Merge pull request #1466 from skriss/rc1-changelog
add changelog for v1.0.0-rc.1
2019-05-10 14:01:02 -06:00
Steve Kriss
a1eb8411f9 Merge pull request #1469 from nrb/always-pull-base-image
Always pull the docker layers on image build
2019-05-10 13:22:36 -06:00
Nolan Brubaker
e52b04dfa3 Always pull the docker layers on image build
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-05-10 15:14:53 -04:00
Steve Kriss
8c2c96adeb add changelog for v1.0.0-rc.1
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-05-10 09:05:22 -06:00
Steve Kriss
a27e1a4c02 Merge pull request #1465 from nrb/fix-1436
Add documentation for minio running in KinD
2019-05-09 14:40:54 -06:00
Steve Kriss
757a9862a5 Merge pull request #1462 from nrb/fix-1453
Add flag to disable creation of VSL on install
2019-05-09 14:38:29 -06:00
Nolan Brubaker
363748667b Fix instances of 'an Velero' typo
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-05-09 16:34:25 -04:00
Nolan Brubaker
d4f9c62449 Add documentation for minio running in KinD
Fixes #1436

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-05-09 16:31:20 -04:00
Nolan Brubaker
e0bc14d56b Add flag to disable creation of VSL on install
Fixes #1453

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-05-09 15:04:42 -04:00
Steve Kriss
f27ff115e2 Merge pull request #1461 from nrb/restic-limitations
Document more restic limitations
2019-05-09 12:37:16 -06:00
Nolan Brubaker
b82e221310 Document more restic limitations
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-05-09 14:05:06 -04:00
Steve Kriss
c96b7b3e40 update build-from-scratch.md for clarity, velero install cmd (#1458)
* update build-from-scratch.md for clarity, velero install cmd

Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-05-08 09:32:55 -07:00
Fábio Franco Uechi
58d34700da Add new gauge to hold the timestamp of the last successful backup (#1448)
* add new gauge to hold the timestamp of the last sucessfull backup

Signed-off-by: fabito <fuechi@ciandt.com>

* add changelog entry

Signed-off-by: fabito <fuechi@ciandt.com>

* fix gauge name

Signed-off-by: fabito <fuechi@ciandt.com>

* renaming metric to backup_last_successful_timestamp

Signed-off-by: fabito <fuechi@ciandt.com>

* fix typo

Signed-off-by: fabito <fuechi@ciandt.com>

* ✏️ fix typo II

Signed-off-by: fabito <fuechi@ciandt.com>

* 🔀 rename method

Signed-off-by: fabito <fuechi@ciandt.com>
2019-05-08 07:00:26 -06:00
Nolan Brubaker
05b8edf894 Merge pull request #1457 from skriss/shortcuts-perf-issue
shortcut expander: use discovery helper's cached resource list
2019-05-07 15:57:12 -04:00
Nolan Brubaker
e5e3bc6b89 Merge pull request #1455 from skriss/install-config-links
add links to the configurable BSL/VSL params on install pages
2019-05-07 15:56:33 -04:00
Steve Kriss
90c89f764e shortcut expander: use discovery helper's cached resource list
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-05-07 12:23:45 -06:00
Steve Kriss
cdd583b8bf add links to the configurable BSL/VSL params on install pages
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-05-07 09:33:47 -06:00
Nolan Brubaker
e0b3e6fa5f Add note about restic support being beta (#1446)
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-05-06 10:15:12 -07:00
Fábio Franco Uechi
24d28c8633 Check for backup existence before download (#1447)
* check for backup existence in download command

Signed-off-by: fabito <fuechi@ciandt.com>
2019-05-06 12:24:29 -04:00
Steve Kriss
0462217c9b Merge pull request #1445 from nrb/inprogress-troubleshooting
Add note about backups stuck InProgress
2019-05-03 15:34:38 -06:00
Nolan Brubaker
e35cf8845d Add note about backups stuck InProgress
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-05-03 17:28:37 -04:00
Nolan Brubaker
7a04e987ea Merge pull request #1442 from skriss/beta.1-changelogs
Beta.1 changelogs
2019-05-03 15:46:14 -04:00
Steve Kriss
4352158435 add v0.11.1-beta.1 changelog
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-05-03 12:49:49 -06:00
Steve Kriss
71f358c160 add v1.0.0-beta.1 changelog
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-05-03 12:49:49 -06:00
Nolan Brubaker
884e512f93 Use latest container image when version is empty (#1439)
When using `velero install`, the image used should be a reasonable
default, even if buildinfo.Version is missing (such as when using `go
build` directly).

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-05-03 11:10:47 -07:00
Nolan Brubaker
26d86f514c Merge pull request #1438 from skriss/loc-cred-doc
add note about single credentials per provider to locations doc
2019-05-03 13:53:52 -04:00
Steve Kriss
c0e105f5cd add note about single credentials per provider to locations doc
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-05-03 11:38:14 -06:00
Steve Kriss
6ebedf6b25 more docs updates (#1432)
* revise versions.md, move supported K8s info into support-matrix.md

Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-05-03 10:05:11 -07:00
Nolan Brubaker
de79f4d0b7 Merge pull request #1405 from skriss/gcp-project
GCP: add optional 'project' config to volume snapshot location
2019-05-03 11:24:42 -04:00
Steve Kriss
2406994740 remove ref to v0.10 from BSL validation error msg (#1429)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-05-02 11:20:50 -07:00
Nolan Brubaker
ac9e0173e8 Merge pull request #1420 from skriss/1.0-upgrade-doc
doc on upgrading to v1.0
2019-05-02 14:02:59 -04:00
Steve Kriss
c95abf69b2 update docs/backup.md (#1427)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-05-01 13:59:07 -07:00
Steve Kriss
f3d36afd3a remove refs to pre-v1.0 velero versions from docs (#1425)
* remove refs to pre-v1.0 velero versions from docs

Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-05-01 13:54:51 -07:00
Nolan Brubaker
0205a43028 Merge pull request #1392 from canshul08/restore_labels
Validate restore name label length
2019-05-01 16:01:16 -04:00
Anshul Chandra
4e12b08953 Validate restore name label length
Velero should handle cases when the label length exceeds 63 characters.

- if the length of the backup/restore name is <= 63 characters, use it as the value of the label
- if it's > 63 characters, take the SHA256 hash of the name. the value of
  the label will be the first 57 characters of the backup/restore name
  plus the first six characters of the SHA256 hash.

Fixes heptio#1021

Signed-off-by: Anshul Chandra <anshulc@vmware.com>
2019-05-01 10:25:11 -07:00
Steve Kriss
721d19c7bf doc on upgrading to v1.0
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-30 14:49:23 -06:00
Nolan Brubaker
28612afa27 Merge pull request #1416 from skriss/restic-connect
switch to snapshots cmd for checking repo exists
2019-04-30 12:24:17 -04:00
Steve Kriss
987ce55894 Merge pull request #1417 from carlisia/c-minor-doc
Super minor doc cleanup
2019-04-30 08:35:59 -06:00
Carlisia
4514c2e27d Super minor doc cleanup
Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-04-29 18:18:41 -07:00
Steve Kriss
660080e6f3 remove all remaining legacy Ark references (#1415)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-29 12:33:54 -07:00
Steve Kriss
dea81bbe15 switch to snapshots cmd for checking repo exists
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-29 12:19:03 -06:00
Steve Kriss
3b5de11c74 update to optionally use distinct snapshot vs volume project
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-29 09:47:13 -06:00
Steve Kriss
4ed63edea0 GCP: add optional 'project' config to volume snapshot location
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-29 09:47:13 -06:00
Steve Kriss
8392e6d83f add PartiallyFailed phase for backups, log+continue on errors (#1386)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-26 09:14:26 -07:00
Steve Kriss
42f351b000 Merge pull request #1407 from nrb/bucket-dashes
Throw an error on an invalid bucket name
2019-04-25 15:41:19 -06:00
Nolan Brubaker
bf19623e82 Merge pull request #1389 from skriss/restore-partially-failed
Add PartiallyFailed phase for restores
2019-04-25 17:06:26 -04:00
Nolan Brubaker
f2b4e73e2e Merge pull request #1406 from skriss/examples
copy examples/ dir as-is to release tarballs
2019-04-25 17:04:50 -04:00
Nolan Brubaker
9e19ab8d8b Throw an error on an invalid bucket name
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-04-25 16:26:03 -04:00
Steve Kriss
26b940c81c copy examples/ dir as-is to release tarballs
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-25 13:09:58 -06:00
Sylvain Rabot
011db15f1c azure: restore volumes with zone (#1298)
Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
2019-04-25 11:25:57 -07:00
Steve Kriss
dda76b05a8 Merge pull request #1400 from skriss/alpha2-changelog
v1.0.0-alpha.2 changelog
2019-04-24 20:19:50 -06:00
Steve Kriss
c7025b98e4 v1.0.0-alpha.2 changelog
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-24 15:43:32 -06:00
Nolan Brubaker
58bb7ed3aa Merge pull request #1390 from carlisia/c-check-for-backup-III
Fail backup if it already exists in object storage
2019-04-24 17:31:48 -04:00
Carlisia
6f496a8921 Bug fix
Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-04-24 14:18:24 -07:00
Steve Kriss
3155bb159f remove VolumeBackupInfo from API pkg (#1388)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-24 13:16:03 -07:00
Steve Kriss
dcd663b8cf bug fix: set discovery helper's logger in constructor (#1399)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-24 13:12:03 -07:00
Steve Kriss
0471c6ee35 Merge pull request #1397 from nrb/uninstall-docs
Add instructions for uninstalling Velero
2019-04-24 13:54:02 -06:00
Nolan Brubaker
15aaa7bb9d Add instructions for uninstalling Velero
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-04-24 15:15:16 -04:00
Carlisia
fc25f0ae89 Clean up + changelog
Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-04-24 12:04:19 -07:00
Steve Kriss
c201a2c103 fix describer output
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-24 12:57:40 -06:00
Steve Kriss
1a55964326 update CLI outputs for PartiallyFailed phase
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-24 12:57:40 -06:00
Steve Kriss
eb30ec0666 move restores to PartiallyFailed if >=1 error in restore results
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-24 12:57:40 -06:00
Nolan Brubaker
e7e666306c Merge pull request #1394 from skriss/update-minio-install-docs
switch minio install docs to use velero install
2019-04-24 14:37:10 -04:00
Nolan Brubaker
8cd46b8a0c Merge pull request #1393 from skriss/update-ibm-install-docs
update IBM install doc to use velero install, remove examples
2019-04-24 14:36:04 -04:00
Steve Kriss
db9f8e16d9 Merge pull request #1376 from nrb/install-docs
Document install command
2019-04-24 12:12:57 -06:00
Nolan Brubaker
9cd2862c8e Document install command for GCP, AWS, and Azure
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-04-24 14:06:36 -04:00
Carlisia
7e949080cf Revert
Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-04-24 11:05:23 -07:00
Carlisia
7d28f82540 Address code review
Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-04-24 10:54:43 -07:00
Steve Kriss
b6cfce2dd9 switch minio install docs to use velero install
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-24 11:31:25 -06:00
Steve Kriss
64dd3ed7ad update IBM install doc to use velero install, remove examples
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-24 11:18:08 -06:00
Steve Kriss
e9c131df71 Merge pull request #1391 from vbellur/patch-3
Update mailing list URL in SUPPORT.md
2019-04-24 08:29:50 -06:00
Vijay Bellur
662a36df90 Update mailing list in SUPPORT.md
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
2019-04-23 20:45:56 -07:00
Carlisia
38ccb40ca1 Add back code and tests
Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-04-23 16:19:49 -07:00
Carlisia
c59d03dfb1 Fix test?
Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-04-22 15:22:58 -07:00
Carlisia
c7bb288d87 More clean up
Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-04-22 15:22:58 -07:00
Carlisia
05a88345e5 Code clean up
Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-04-22 15:22:58 -07:00
Andy Goldstein
01d0b026e9 Fail backup if it already exists in object storage
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2019-04-22 15:22:58 -07:00
Steve Kriss
134323fbf7 Merge pull request #1385 from nrb/deploy-tags
Provide more specific label for velero deployment
2019-04-19 12:37:28 -06:00
Nolan Brubaker
8870281afc Merge pull request #1353 from fabito/gauge-for-number-of-backups-and-restores
Add gauge metrics for number of existing backups and restores
2019-04-19 12:52:55 -04:00
Steve Kriss
6dd007b507 remove deprecated hooks (replaced by pre hooks) (#1384)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-19 08:40:35 -07:00
Nolan Brubaker
e85c367ce5 Provide more specific label for velero deployment
Using only the `component: velero` selector caused the restic pods to be
matched, as well, which made things such as `kubectl logs` return too
much information.

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-04-18 14:18:21 -04:00
Nolan Brubaker
b01b12472f Merge pull request #1375 from ctrox/gcp-snapshot-location
GCP: Implement configurable snapshot location
2019-04-18 12:06:18 -04:00
fabito
475cf2ab60 add new metrics (gauges): backup_total and restore_total
Signed-off-by: fabito <fuechi@ciandt.com>
2019-04-18 01:28:38 -03:00
Nolan Brubaker
f8f0d15da2 Add --namespace parameter to install command (#1380)
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-04-17 09:38:14 -07:00
Cyrill Troxler
6020823aaf Add config parameter for gcp to customize the snapshot location
Signed-off-by: Cyrill Troxler <cyrill@nine.ch>
2019-04-17 18:34:09 +02:00
Cyrill Troxler
ff642d739d Update vendored google API
Signed-off-by: Cyrill Troxler <cyrill@nine.ch>
2019-04-17 18:33:56 +02:00
Nolan Brubaker
0750b2c789 Merge pull request #1367 from skriss/restic-repo-fixes
Restic repository management fixes
2019-04-17 11:49:17 -04:00
Nolan Brubaker
975bec692b Merge pull request #1378 from skriss/move-restore-result
move RestoreResult from api to pkg/restore, rename to Result
2019-04-17 11:29:18 -04:00
Nolan Brubaker
38604e88fe Merge pull request #1379 from skriss/archive-wrap-in-dir
wrap contents of release tarball in directory
2019-04-17 11:28:03 -04:00
Steve Kriss
c475108345 changelog
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-17 08:24:06 -06:00
Nolan Brubaker
f2418052e4 Merge pull request #1377 from jmontleon/fix-restic-repo
Fix restic repository identifier
2019-04-16 17:46:56 -04:00
Steve Kriss
2cef9d26ec wrap contents of release tarball in directory
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-16 14:27:49 -06:00
Steve Kriss
5bc6695109 move RestoreResult from api to pkg/restore, rename to Result
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-16 12:57:02 -06:00
Jason Montleon
8c9ae491f0 Fix restic repository identifier
Signed-off-by: Jason Montleon <jmontleo@redhat.com>
2019-04-16 12:24:25 -04:00
Nolan Brubaker
39bab5ada9 Merge pull request #1372 from skriss/v1.0.0-alpha.1-changelog
v1.0.0-alpha.1 changelog
2019-04-15 17:48:16 -04:00
Steve Kriss
316e6cc67e v1.0.0-alpha.1 changelog
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-15 15:41:21 -06:00
Nolan Brubaker
6f474016a6 Add velero install command (#1287)
Add velero install command

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-04-15 14:10:11 -07:00
Steve Kriss
bc8f07f963 Azure: add support for loading env vars from a file, $AZURE_CREDENTIALS_FILE (#1364)
* azure: load env vars from AZURE_CREDENTIALS_FILE if it exists

Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-15 14:05:13 -07:00
Nolan Brubaker
9470983d5f Merge pull request #1365 from skriss/update-base-images
switch to debian:stretch-slim base images and go 1.12.x
2019-04-15 16:24:17 -04:00
Nolan Brubaker
94f014101d Merge pull request #1323 from skriss/v1.0-removals
v1.0 removals
2019-04-15 16:24:02 -04:00
Nolan Brubaker
c38def0849 Merge pull request #1370 from skriss/install-fixes
add some missing config to pkg/install daemonset, deployment
2019-04-15 15:45:52 -04:00
Steve Kriss
66c6d7a026 add some missing config to pkg/install daemonset, deployment
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-15 13:12:35 -06:00
Nolan Brubaker
9b9b4f666e Merge pull request #1369 from skriss/update-daemonset-log
update daemonset log to show version and SHA
2019-04-15 13:37:59 -04:00
Steve Kriss
373e4c9abe update daemonset log to show version and SHA
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-15 11:27:04 -06:00
Steve Kriss
ce374584c4 changelog
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-15 10:17:41 -06:00
Steve Kriss
c59544cb79 remove backup.status.volumeBackups and all related code
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-15 10:17:40 -06:00
Steve Kriss
6ed4e1f147 remove legacy metrics
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-15 10:17:03 -06:00
Steve Kriss
b04d6b02f3 remove support for legacy restic annotations
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-15 10:17:03 -06:00
Steve Kriss
7f36f78aee remove code that removes legacy GC finalizer from backups
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-15 10:17:03 -06:00
Steve Kriss
892673816b remove legacy restore label
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-15 10:17:03 -06:00
Steve Kriss
c8c03a38e9 remove support for legacy Azure snapshot ID format
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-15 10:17:03 -06:00
Steve Kriss
ede9a8f5b4 remove support for legacy client config file
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-15 10:17:03 -06:00
Steve Kriss
b87de94723 remove legacy hook annotation support
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-15 10:17:03 -06:00
Steve Kriss
77e648eafa remove Ark field from RestoreResult
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-15 10:17:02 -06:00
Steve Kriss
d49008dec0 remove Ark API pkg and generated code
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-15 10:15:18 -06:00
Steve Kriss
b03da3c0ed remove code referencing Ark API pkg
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-15 10:15:18 -06:00
Steve Kriss
49cb4cd5c3 switch to debian:stretch-slim base images and go 1.12.x
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-15 10:07:23 -06:00
Steve Kriss
3ed97db550 Merge pull request #1362 from nrb/include-resources-examples
Add example for restoring with --include-resources
2019-04-12 14:45:15 -06:00
Steve Kriss
44acdcbc60 repo ensurer: fix channel lifecycles
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-12 14:43:40 -06:00
Steve Kriss
5d06bd4ab9 restic repo controller: lower resync period to 5min
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-12 14:43:40 -06:00
Steve Kriss
0328a70ff0 repo ensurer: rename readyChans to repoChans
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-12 14:43:40 -06:00
Steve Kriss
8d61cb0384 repo ensurer: wait at most one minute for repo to become ready
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-12 14:43:40 -06:00
Steve Kriss
f879670906 repo ensurer: return error if new repo becomes NotReady
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-12 14:43:40 -06:00
Steve Kriss
7251c8ca81 restic: change log statement from error to debug
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-12 14:43:40 -06:00
Steve Kriss
02cbb77dea Merge pull request #1366 from nrb/fix-1363
Prepend velero.io to non-namespaced names
2019-04-12 14:43:17 -06:00
Nolan Brubaker
d679498c8a Add example for restoring with --include-resources
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-04-12 16:36:39 -04:00
Nolan Brubaker
c326f59627 Prepend velero.io to non-namespaced names
Prior to 1.0, user-provided values such as cloud provider names didn't
need to be namespaced. This change allows those values to continue
working without the user editing the fields manually.

Fixes #1363

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-04-12 16:31:16 -04:00
Nolan Brubaker
bc93b2bbac Merge pull request #1358 from skriss/restore-log-fix
instantiate plugin manager with per-restore logger so plugin logs are captured
2019-04-12 12:47:11 -04:00
Steve Kriss
3116185e5b instantiate plugin manager with per-restore logger so plugin logs are captured
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-12 10:36:20 -06:00
KubeKween
abee09aa2d Add validation for plugin name format and dups (#1339)
* Add validation for plugin name format and dups

Signed-off-by: Carlisia <carlisiac@vmware.com>

* Bug fix

Signed-off-by: Carlisia <carlisiac@vmware.com>

* Add changelog

Signed-off-by: Carlisia <carlisiac@vmware.com>

* Address code reviews

Signed-off-by: Carlisia <carlisiac@vmware.com>

* Fix code

Signed-off-by: Carlisia <carlisiac@vmware.com>

* Address code reviews

Signed-off-by: Carlisia <carlisiac@vmware.com>

* Add documentation

Signed-off-by: Carlisia <carlisiac@vmware.com>

* Update godoc

Signed-off-by: Carlisia <carlisiac@vmware.com>

* More doc

Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-04-12 08:25:04 -06:00
Aman Wangde
0e0f357cef Added ability to disable controllers (#1326)
Signed-off-by: James King <james.king@emc.com>
2019-04-10 15:41:28 -04:00
Steve Kriss
23c0d3f612 Merge pull request #1352 from rohandvora/default-backup-ttl
Set default backup TTL
2019-04-09 15:34:32 -06:00
Rohan Vora
4beb8aab3c Set default backup TTL
Set default backup TTL to 30 days when TTL
is not provided in the backup yaml configuration.

Updates #138

Signed-off-by: Rohan Vora <vorar@vmware.com>
2019-04-09 14:13:29 -07:00
Imran Pochi
b444d3c2f1 Update Restic documentation for RancherOS (#1348)
Signed-off-by: Imran Pochi <pochiimran@yahoo.co.in>
2019-04-09 11:22:50 -07:00
KubeKween
13eaad0e64 Refactor protobuf (#1354)
* Update protobuffs

Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-04-09 13:50:05 -04:00
Steve Kriss
956152d6e1 Merge pull request #1355 from nrb/backup-examples
Add examples to backup create command
2019-04-09 08:15:00 -06:00
Nolan Brubaker
bca21a1ec0 Add examples to backup create command
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-04-05 14:40:05 -04:00
Steve Kriss
2f47ca62ad always allow 'bucket' as a config key for object stores (#1349)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-05 11:24:55 -07:00
sseago
a519547efc Adds support for allowing a RestoreItemAction to skip item restore (#1336)
* Adds support for allowing a RestoreItemAction to skip item restore

This allows a RestoreItemAction plugin to signal to velero that
the returned item should be skipped rather than restored to the
cluster.

To support this, a boolean SkipRestore attribute is added to
RestoreItemActionExecuteOutput. If restore.restoreResource finds
this set to true, any remaining actions on this item are skipped,
and restore on this item is skipped. Execution continues with
the next item of this resource type.

To signal this for a particular item, the RestoreItemAction's
Execute method should call WithoutRestore() on the
RestoreItemActionExecuteOutput before returning it.

Signed-off-by: Scott Seago <sseago@redhat.com>

* Autogenerated code to support SkipRestore

Signed-off-by: Scott Seago <sseago@redhat.com>

* Added changelog for #1336

Signed-off-by: Scott Seago <sseago@redhat.com>
2019-04-04 13:39:54 -06:00
Fábio Franco Uechi
0167539a14 add new counter metrics for backup deletion (#1280)
* compute backup deletion metrics (attempt, success, fail)

Signed-off-by: fabito <fuechi@ciandt.com>
2019-04-04 14:25:59 -04:00
Steve Kriss
985479094f Merge pull request #1342 from cwilkers/patch-1
Add NooBaa to support matrix
2019-04-03 07:32:28 -06:00
Chandler Wilkerson
a611658436 Add NooBaa to support matrix
Per https://github.com/heptio/velero/pull/1334#issuecomment-479190807

Signed-off-by: cwilkers <cwilkers@redhat.com>
2019-04-03 07:08:24 -05:00
Nolan Brubaker
0f442b002d Merge pull request #1341 from skriss/fix-changelogs
changelog fixes
2019-04-02 17:24:52 -04:00
Steve Kriss
a774b54ae7 changelog fixes
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-02 15:16:47 -06:00
Steve Kriss
2e3f00f64d Merge pull request #1340 from carlisia/c-copy
Fix copyright
2019-04-01 15:49:06 -06:00
Nolan Brubaker
c3a933d3e3 Merge pull request #1338 from skriss/validate-config-keys
objectstores/volumesnapshotters: check for invalid keys in config
2019-04-01 15:11:15 -04:00
Nolan Brubaker
bbd28a9fb9 Merge pull request #1337 from skriss/logs-cmd-validation
logs commands: validate item exists & is finished processing
2019-04-01 15:10:52 -04:00
Carlisia
23b1098950 Fix copyright
Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-04-01 12:06:14 -07:00
Steve Kriss
1d3d66aa77 logs commands: validate backup/restore exists & is finished processing
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-01 12:39:02 -06:00
Fábio Franco Uechi
40c7fbce09 Gracefully handle failed API groups from the discovery API (#1293)
* log details and continue executing if error of type ErrGroupDiscoveryFailed is returned by discovery API

Signed-off-by: fabito <fuechi@ciandt.com>
2019-04-01 14:27:37 -04:00
Steve Kriss
6bf29e17aa objectstores/volumesnapshotters: check for invalid keys in config
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-01 08:15:24 -06:00
Steve Kriss
7298a4eda0 allow restic restore helper image to be specified via ConfigMap (#1311)
* allow restic restore helper image to be specified via ConfigMap

Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-03-29 17:11:34 -04:00
Steve Kriss
2a36cdcbf6 set backup start timestamp before patching to inprogress (#1330)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-03-29 13:33:50 -07:00
Steve Kriss
dcee310745 improve handling of custom S3 URLs (#1331)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-03-29 13:32:43 -07:00
Steve Kriss
a696cd09f2 remove Warning from restore item action output (#1318)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-03-28 13:08:37 -07:00
Steve Kriss
be42ea782d turn down log levels in plugin server to DEBUG (#1325)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-03-28 12:44:26 -07:00
Steve Kriss
9b635c0e14 add additionalItems to restore item actions (#1304)
* add additionalItems to restore item actions

Signed-off-by: Steve Kriss <krisss@vmware.com>
Co-authored-by: Andy Goldstein <goldsteina@vmware.com>
2019-03-28 12:21:56 -07:00
KubeKween
477e42286c Bump plugin client version (#1319)
* Bump plugin client version

Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-03-28 11:34:43 -04:00
Nolan Brubaker
21f3169ad3 Merge pull request #1321 from skriss/rename-block-store
rename BlockStore to VolumeSnapshotter
2019-03-28 11:33:06 -04:00
Nolan Brubaker
59e0ef4524 Merge pull request #1322 from skriss/fix-grpc-streaming
don't wrap io.EOF errors during gRPC streaming
2019-03-28 11:30:54 -04:00
Steve Kriss
86293b68b3 don't wrap io.EOF errors during gRPC streaming
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-03-27 16:22:28 -06:00
Steve Kriss
e4e0ed68a6 changelog
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-03-27 14:58:11 -06:00
Steve Kriss
bb9c3f6a1a rename BlockStore to VolumeSnapshotter
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-03-27 14:55:28 -06:00
Nolan Brubaker
3f2c28f6bb Merge pull request #1301 from skriss/plugins-error-location
log error locations from plugin logger and don't overwrite in client
2019-03-27 11:21:52 -04:00
Nolan Brubaker
60460f6920 Merge pull request #1300 from skriss/plugin-error-stacks
Add stack traces to plugin errors so error location info can be logged
2019-03-27 11:21:00 -04:00
Steve Kriss
7b0d8217de send plugin error stack traces over gRPC and log error locations
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-03-27 08:34:03 -06:00
Matt Stump
f8baf4f4f0 Fix for #1312, use describe to determine if AWS EBS snapshot is encrypted and explicitly pass that value in EC2 CreateVolume call. (#1316)
Signed-off-by: Matt Stump <mstump@vorstella.com>
2019-03-26 17:30:27 -07:00
Steve Kriss
b1c0e9c49b update plugins to work with updated go-plugin (#1308)
* update plugins to work with updated go-plugin

Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-03-21 12:32:18 -07:00
Steve Kriss
4d7add1782 Merge pull request #1306 from pei0804/mustcompile
Improvement: regex faster
2019-03-21 09:07:20 -06:00
pei0804
7af9f8d74e compile only once for regexp.MustCompile
Signed-off-by: pei0804 <peeeei0804@gmail.com>
2019-03-21 21:51:48 +09:00
Steve Kriss
ff2db31b32 log error locations from plugin logger and don't overwrite in client
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-03-20 16:13:37 -06:00
Steve Kriss
bd662ab613 Merge pull request #1303 from carlisia/c-dep
Update go-plugin
2019-03-20 14:10:14 -06:00
Carlisia
01f2ae76e2 Update go-plugin
Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-03-20 13:02:51 -07:00
Steve Kriss
a111eed2af update license headers to Velero contributors (#1302)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-03-20 12:32:48 -07:00
Steve Kriss
4c73e23ce8 Merge pull request #1291 from carlisia/c-plugins-III
Split velero plugin client into its own package
2019-03-19 17:42:22 -06:00
Carlisia
a71e43b2b7 Split velero plugin client into its own package
Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-03-19 16:05:37 -07:00
Steve Kriss
1eac10ca9f Merge pull request #1288 from carlisia/c-plugins-II
Split plugin framework into its own package
2019-03-19 16:44:58 -06:00
Carlisia
7dfe58d37f Split plugin framework into its own package
Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-03-19 15:36:31 -07:00
Nolan Brubaker
78bf8fb868 Merge pull request #1297 from skriss/restic-exclude-hostpath-pv
exclude hostPath PVs from restic backup
2019-03-19 11:35:33 -04:00
Steve Kriss
7d66fc31bd pkg/restic: check for & skip hostPath PVC/PVs
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-03-19 08:57:47 -06:00
Steve Kriss
183bea369d make resticrepositories non-restorable resources (#1296)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-03-18 11:38:37 -07:00
Nolan Brubaker
de09fd7cdc Merge pull request #1294 from skriss/master-curl-redirect
add -L flag to curl commands (master branch)
2019-03-18 13:27:16 -04:00
Steve Kriss
f64b37289d add -L flag to curl commands
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-03-18 10:57:28 -06:00
KubeKween
73514a003b Move plugin interfaces to same package (#1264)
* Move plugin interfaces to same package

Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-03-14 16:35:06 -04:00
Steve Kriss
7674332313 pass --log-level to plugins (#1278)
Plumb the log level through to plugin processes


Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-03-14 10:53:36 -07:00
Steve Kriss
409116fce8 add basic plugin panic handlers (#1270)
* add server-side panic handlers to all plugin methods

Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-03-13 14:07:52 -04:00
Nolan Brubaker
503b112638 Add location resources and tests (#1277)
Add locations and tests to install package

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-03-13 11:23:00 -06:00
Steve Kriss
b286c652ec Merge pull request #1274 from MetisMachine/aws-new
AWS: Inclue zone in volume ID
2019-03-12 14:02:18 -06:00
tsturzl
89ca2571f3 AWS zone on volume IDs
Signed-off-by: Travis Sturzl<travis@metismachine.com>
2019-03-12 13:04:33 -06:00
Nolan Brubaker
394548afcd Merge pull request #1254 from skriss/remove-wait-for-pv
remove restore code that waits for a PV to become Available
2019-03-11 13:20:59 -04:00
KubeKween
4ee41a13a0 Merge pull request #1261 from asaf-erlich/patch-1
Update ark restore to not open every single file open during extracti…
2019-03-08 14:59:09 -08:00
asaf-erlich
4041044a93 Update ark restore to not open every single file open during extraction of the data
Original error was:

```
ark -n <redacted> restore logs <redacted>
time="2019-03-06T18:31:06Z" level=info msg="Not including resource" groupResource=nodes logSource="pkg/restore/restore.go:124"
time="2019-03-06T18:31:06Z" level=info msg="Not including resource" groupResource=events logSource="pkg/restore/restore.go:124"
time="2019-03-06T18:31:06Z" level=info msg="Not including resource" groupResource=events.events.k8s.io logSource="pkg/restore/restore.go:124"
time="2019-03-06T18:31:06Z" level=info msg="Not including resource" groupResource=backups.ark.heptio.com logSource="pkg/restore/restore.go:124"
time="2019-03-06T18:31:06Z" level=info msg="Not including resource" groupResource=restores.ark.heptio.com logSource="pkg/restore/restore.go:124"
time="2019-03-06T18:31:06Z" level=info msg="Starting restore of backup backup/<redacted>" logSource="pkg/restore/restore.go:342"
time="2019-03-06T18:31:06Z" level=info msg="error unzipping and extracting: open /tmp/604421455/resources/rolebindings.rbac.authorization.k8s.io/namespaces/<redacted>/<redacted>: too many open files" logSource="pkg/restore/restore.go:346"
```

Downloading the directory from s3 and untarring it I found 1036 files. The ulimit -n output says 1024. This is our team's best guess at a root cause. But the code fixed in the PR definitely is holding all the files open until the method closes: https://blog.learngoprogramming.com/gotchas-of-defer-in-go-1-8d070894cb01

Please note my go code abilities are not great and I did not test this. I just edited the file in github. All I did was remove the defer and put fileClose after the copy is done. Theoretically this should only hold one file open at a time now. Let me know if you want me to do any further steps.

Thank you,
-Asaf

Signed-off-by: Asaf Erlich <aerlich@groupon.com>
2019-03-07 11:23:35 -05:00
Nolan Brubaker
5e12a921b5 Merge pull request #1256 from carlisia/c-plugins
Add original item to restore plugin interface
2019-03-06 19:02:47 -05:00
Michal Wieczorek
1354e2b6ff Add original item to restore plugin interface
Signed-off-by: Michal Wieczorek <wieczorek-michal@wp.pl>
2019-03-05 17:09:42 -08:00
Steve Kriss
e29aa74a23 remove restore code that waits for a PV to become Available
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-03-05 17:04:52 -07:00
Nolan Brubaker
ce3f43e876 Merge pull request #1251 from skriss/backup-extractor
move backup extraction logic to its own type
2019-03-05 16:37:48 -05:00
Nolan Brubaker
5912fe66e5 Merge pull request #1250 from skriss/extract-pv-restorer
move pvRestorer and tests to their own files
2019-03-05 16:37:32 -05:00
KubeKween
c006d9246f Merge pull request #1248 from DheerajSShetty/describe_ouput
Improve `describe` output
2019-03-04 13:34:42 -08:00
DheerajSShetty
1b031f0cc4 Improve describe output
* Move Phase to right under Metadata(name/namespace/label/annotations)
 * Move Validation errors: section right after Phase: section and only
   show it if the item has a phase of FailedValidation
 * For restores move Warnings and Errors under Validation errors. Do not
   show Warnings or Errors if there are none.

Signed-off-by: DheerajSShetty <dheerajs@vmware.com>

Fixes #987
2019-03-04 13:21:18 -08:00
Steve Kriss
88e6a740f2 move pvRestorer and tests to their own files
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-03-01 15:07:25 -07:00
Steve Kriss
0fec56f488 move backup extraction logic to its own type
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-03-01 15:05:58 -07:00
KubeKween
e21940bee1 Merge pull request #1231 from skriss/k8s-1.12-deps
update kubernetes and azure dependencies to 1.12
2019-02-28 15:09:06 -08:00
Nolan Brubaker
421b64b1fa Merge pull request #1247 from skriss/pr-1146-changelog
add changelog for PR 1146
2019-02-28 18:08:32 -05:00
Steve Kriss
81e741ebfc add changelog for PR 1146
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-28 16:02:23 -07:00
Nolan Brubaker
fcf21813a5 Merge pull request #1246 from skriss/preserve-storageclass
when restoring a PV, don't remove its spec.storageClassName
2019-02-28 18:02:20 -05:00
Steve Kriss
8dd1cbf62b add changelog
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-28 15:58:18 -07:00
KubeKween
65f3926caa Merge pull request #1146 from skriss/replace-map-utils-final
replace ark's map_utils.go with structured types and apimachinery's unstructured helpers
2019-02-28 14:37:07 -08:00
Steve Kriss
31501b79b2 when deleting snapshot, don't error if it doesn't exist
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-28 15:33:05 -07:00
Steve Kriss
6bf837b233 address breaking changes in Azure SDK
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-28 15:33:05 -07:00
Steve Kriss
f908d5f8c0 upgrade Azure SDK to a GA version matching Kubernetes
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-28 15:33:05 -07:00
Steve Kriss
f8548e1ca1 tweak a couple of dependency versions
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-28 15:33:05 -07:00
Steve Kriss
58e471bda0 fix breaking changes
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-28 15:33:05 -07:00
Steve Kriss
61eab7dca3 update generated code using 1.12 generator
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-28 15:33:05 -07:00
Steve Kriss
efc490138c update to 1.12 dependencies
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-28 15:33:04 -07:00
Steve Kriss
80fe640b98 add changelog
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-28 14:36:38 -07:00
Steve Kriss
21c57c46b3 when restoring a PV, don't remove its spec.storageClassName
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-28 14:34:36 -07:00
KubeKween
7353294b7f Merge pull request #1236 from DheerajSShetty/squashed_feature
defer closing the ReadCloser in ObjectStoreGRPCServer.GetObject
2019-02-28 13:12:05 -08:00
Steve Kriss
7e736ab79d Merge pull request #1244 from carlisia/c-fiximages
Fix readme links
2019-02-28 13:07:49 -08:00
Carlisia
5468ccf5cb Fix readme links
Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-02-28 12:33:15 -08:00
DheerajSShetty
032aaac508 defer closing the ReadCloser in ObjectStoreGRPCServer.GetObject
Signed-off-by: DheerajSShetty <dheerajs@vmware.com>

Fixes #1093
2019-02-28 11:51:10 -08:00
KubeKween
ab2fc65c02 Merge pull request #1243 from skriss/changelogs
v0.10.2 and v0.11.0 changelogs
2019-02-28 07:03:24 -08:00
KubeKween
03b8f5397f Merge pull request #1203 from skriss/v0.11-changes
v0.11 changes
2019-02-28 07:01:23 -08:00
Steve Kriss
431602e852 add v0.11.0 changelog
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-27 12:40:42 -08:00
Steve Kriss
cb0a9281f6 add v0.10.2 changelog
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-27 08:23:21 -08:00
Nolan Brubaker
783c7d850c Merge pull request #1235 from skriss/restic-race-fix
Fix bugs in restic repository ensurer
2019-02-27 11:09:47 -05:00
Steve Kriss
e3e76c2067 pkg/restic: fix concurrency bugs causing dupe repos, panics
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-25 18:30:26 -08:00
KubeKween
e4771f582b Merge pull request #1232 from skriss/install-docs-updates
add more documentation about using official releases
2019-02-22 12:04:20 -08:00
Steve Kriss
4e0b0c87bb add more documentation about using official releases
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-22 12:56:52 -07:00
KubeKween
3724af259c Merge pull request #1227 from skriss/update-logo
update to logo with name
2019-02-21 09:10:17 -08:00
Steve Kriss
522ee9ad36 update to logo with name
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-21 10:00:06 -07:00
KubeKween
1b3c444720 Merge pull request #1190 from nrb/document-velero-migration
Instructions for migrating from Ark to Velero
2019-02-20 12:26:41 -08:00
Nolan Brubaker
3d2b031ee4 Document steps for migrating from Ark to Velero
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-02-20 15:18:31 -05:00
Steve Kriss
8be6f03ef0 Merge pull request #1212 from nrb/list-link-fix
Update support link to the google group
2019-02-14 11:28:15 -07:00
Nolan Brubaker
e2f84a1242 Update support link to the google group
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-02-14 13:19:22 -05:00
Nolan Brubaker
49eeeb04f0 Merge pull request #1204 from skriss/deprecation-notices
add deprecation notices to pkg/apis/ark/v1 types
2019-02-12 16:02:47 -05:00
Steve Kriss
e1d414338c Merge pull request #1200 from nrb/fix-1183
Fix restoring GCP regional disks
2019-02-12 13:48:42 -07:00
Nolan Brubaker
0ffaeb949d Fix restoring GCP regional disks
To create a regional disk, the URLs for the zones in which the disk is
replicated must be provided to the GCP API.

Fixes #1183

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-02-12 15:42:50 -05:00
Steve Kriss
ed73be44fd Merge pull request #1206 from nzoueidi/master
Add UTC time to --schedule
2019-02-12 09:19:53 -07:00
Naeil ZOUEIDI
988ce573c0 Add UTC time to --schedule
Signed-off-by: Naeil Ezzoueidi <naeilzoueidi@ubuntu.com>
2019-02-12 11:04:10 -05:00
Steve Kriss
780dc4551f fix compile err & test
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-11 16:45:04 -07:00
Steve Kriss
32835c63f6 code review feedback
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-11 16:21:49 -07:00
Steve Kriss
86c5c25d13 code review: remove obsolete commented code
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-11 16:21:49 -07:00
Steve Kriss
250f109c41 delete pkg/util/collections/map_utils.go & tests
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-11 16:21:49 -07:00
Steve Kriss
d8e9b772ff move MergeMaps func into pkg/restore where it's used
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-11 16:21:48 -07:00
Steve Kriss
88fc6e2141 pkg/controller: remove usage of pkg/util/collections
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-11 16:21:24 -07:00
Steve Kriss
38ad7d71f5 pkg/restore: remove usage of pkg/util/collections
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-11 16:20:41 -07:00
Steve Kriss
e91c841c59 pkg/backup: remove usage of pkg/util/collections
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-11 16:18:51 -07:00
Steve Kriss
902c0f797f pkg/podexec: remove usage of pkg/util/collections
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-11 16:18:37 -07:00
Steve Kriss
296dd6617e pkg/cloudprovider: remove usage of pkg/util/collections
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-11 16:17:33 -07:00
Steve Kriss
4cd8170386 add deprecation notices to pkg/apis/ark/v1 types
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-11 15:44:52 -07:00
Steve Kriss
551aaa646d remove note about rename being WIP, mention former name
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-11 12:46:21 -07:00
Steve Kriss
0df30c1e89 ark->velero in issue templates & bug cmd
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-11 12:43:51 -07:00
KubeKween
378011baf6 Merge pull request #1153 from daved/fix/1142-restore_log
Clarify conditional nature of restore in log
2019-02-11 09:22:25 -08:00
Daved
b2b1ee44ea Clarify restore log when object unchanged
Signed-off-by: Daved <daved@codemodus.com>
2019-02-11 09:12:07 -08:00
Steve Kriss
4583aa7078 Merge pull request #826 from nrb/fix-691
Wait for namespace to terminate before restoring
2019-02-07 11:07:25 -07:00
Steve Kriss
b15970d3ef Merge pull request #1198 from dvhart/source-archive-docs
Document build from release archive limitations
2019-02-07 11:00:35 -07:00
Darren Hart
9df3947745 Document build from release archive limitations
Due to the assumption of building from a git repository inherent in the
Makefile targets, update the documentation to limit source code archive
builds to the `go build` commands.

Note that it may be possible to update hack/build.sh to cope with
building outside a git repository, but there are a number of questions
to answer regarding how to populate the buildinfo info, and that is a
larger discussion than ensuring we can build the binary from the sources
in the source code archive.

Signed-off-by: Darren Hart <dvhart@vmware.com>
2019-02-07 09:27:01 -08:00
Steve Kriss
2364393b7c Merge pull request #1196 from dvhart/source-archive-docs
Document building from GitHub Release Source code archive
2019-02-07 07:55:14 -07:00
Darren Hart
ee2b352489 Document build from release archive and fix ToC link
Update the documentation to include minimal instructions for building
the velero binary from the GitHub Release "Source code" archive.

Correct the Download link in the Table of Contents for
build-from-scratch.md.

Signed-off-by: Darren Hart <dvhart@vmware.com>
2019-02-06 18:08:38 -08:00
Nolan Brubaker
890202f2e4 Wait for PV/namespace to delete before restore
If a PV already exists, wait for it, it's associated PVC, and associated
namespace to be deleted before attempting to restore it.

If a namespace already exists, wait for it to be deleted before
attempting to restore it.

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-02-06 15:43:50 -05:00
Nolan Brubaker
3c7737c8b1 Merge pull request #1166 from skriss/tweak-server-log-version
velero server: log version and git SHA at startup
2019-02-06 15:28:51 -05:00
Nolan Brubaker
ca8e951ac6 Merge pull request #1194 from skriss/fix-changelogs
add/fix changelogs for recent PRs
2019-02-06 14:50:33 -05:00
Nolan Brubaker
52ecc45ec8 Merge pull request #1167 from skriss/logging-and-misc-cleanup
Logging and misc cleanup
2019-02-06 14:45:08 -05:00
Steve Kriss
8ee406b4bd add/fix changelogs for recent PRs
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-06 12:42:29 -07:00
Nolan Brubaker
46e87661c0 Merge pull request #1171 from skriss/restic-stats
use restic stats instead of check to check repo existence
2019-02-06 14:28:07 -05:00
Steve Kriss
723cda2697 use restic stats instead of check to check repo existence
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-06 12:14:11 -07:00
Nolan Brubaker
5f0ff026b0 Merge pull request #1156 from skriss/restic-v0.9.4
upgrade to restic v0.9.4 and replace --hostname with --host
2019-02-06 14:03:44 -05:00
Steve Kriss
0a810ced54 Merge pull request #1187 from nrb/issue-template-namespace-fix
Use current info in bug template
2019-02-05 14:28:27 -07:00
Nolan Brubaker
c1a817b4e9 Use current info in bug template
The binary, deployment, and namespace have yet to change for most users,
so make sure the bug template has the correct information when filing.

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-02-05 16:11:56 -05:00
Steve Kriss
478d12b4ff upgrade to restic v0.9.4 and replace --hostname with --host
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-05 10:15:04 -07:00
Steve Kriss
328bc361be velero server: log version and git SHA at startup
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-05 10:12:06 -07:00
Steve Kriss
7913ae1867 remove extraneous use of meta.Accessor
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-05 10:09:57 -07:00
Steve Kriss
c0a55e136b logging tweaks for clarity
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-05 10:08:33 -07:00
Steve Kriss
3054a38bd6 Merge pull request #1186 from nrb/issue-template-command
Update templates to use current command
2019-02-05 09:20:31 -07:00
Nolan Brubaker
381149cedf Update templates to use current command
Currently, the executable binary in the wild is `ark`, so leave it in
our github issue templates

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-02-05 11:12:33 -05:00
Steve Kriss
db9dacae54 Merge pull request #1185 from ncdc/move-velero-image
Move Velero image to docs/img
2019-02-05 08:56:24 -07:00
Andy Goldstein
77327db062 Move Velero image to docs/img
Signed-off-by: Andy Goldstein <goldsteina@vmware.com>
2019-02-05 10:48:16 -05:00
Andy Goldstein
1675943f44 Merge pull request #1184 from nrb/rename-ark-to-velero
Rename Ark to Velero!!!
2019-02-05 10:41:20 -05:00
Nolan Brubaker
43714caaec Rename Ark to Velero!!!
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-02-04 17:35:22 -05:00
Andy Goldstein
bbc6caf7fe Merge pull request #1180 from skriss/fix-version-mode
change mode on metadata/version to 0755
2019-02-01 10:17:13 -05:00
Steve Kriss
25299513c1 change mode on metadata/version to 0755
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-01-31 16:27:13 -07:00
Andy Goldstein
e61d3c6ca0 Merge pull request #1174 from The-smooth-operator/kube2iam_docs
extend AWS NoCredentialsProviders troubleshooting docs with kube2iam …
2019-01-28 14:56:09 -05:00
The-smooth-operator
c56e3e5af3 extend AWS NoCredentialsProviders troubleshooting docs with kube2iam case
Signed-off-by: The-smooth-operator <alberto.delbarrio.albelda@gmail.com>
2019-01-28 12:34:53 +01:00
Andy Goldstein
78cb813210 Merge pull request #1163 from apoplawski/documentation-add-info-on-protoc
Added protoc-gen-go version info
2019-01-24 12:18:43 -05:00
Andy Goldstein
f90b8f9473 Merge pull request #1116 from skriss/status-crd
add server version to `ark version` output
2019-01-23 15:01:22 -05:00
Steve Kriss
8a58b217be show server version in ark version output using ServerStatusRequest CRD
Signed-off-by: Steve Kriss <steve@heptio.com>
2019-01-23 12:51:13 -07:00
Andy Goldstein
5847dcabba Merge pull request #1117 from wwitzel3/issue-134
Add backup-version file in backup tarball
2019-01-22 09:01:34 -08:00
Artur Poplawski
ad5146b9b1 added protoc-gen-go version info
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-01-22 15:46:01 +01:00
Nolan Brubaker
7e4fca428d Merge pull request #1155 from skriss/v0.10.1-changelog
v0.10.1 changelog
2019-01-10 15:42:24 -05:00
Steve Kriss
7c2a6caa5a v0.10.1 changelog
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-01-10 13:10:39 -07:00
Wayne Witzel III
d08c2e1b9c Add backup-version file in backup tarball
Signed-off-by: Wayne Witzel III <wwitzel3@vmware.com>
2019-01-09 16:36:32 -05:00
Steve Kriss
96fcf1661a Merge pull request #1140 from ncdc/make-test-what
Support make test WHAT=.....
2019-01-04 10:14:06 -07:00
Andy Goldstein
6cf3db6244 Support make test WHAT=.....
Signed-off-by: Andy Goldstein <goldsteina@vmware.com>
2019-01-03 15:27:41 -05:00
Andy Goldstein
fd8bf14bb6 Merge pull request #1090 from dobozysaurus/issue-502
Added GOFLAGS support
2019-01-03 15:20:26 -05:00
Andy Goldstein
ca107423f0 Merge pull request #1098 from Bradamant3/small-reorg
reorganize get started for simplicity, clarity
2019-01-03 15:02:31 -05:00
Andy Goldstein
7384cf1115 Merge pull request #1131 from hex108/doc
Add note about kubeconfig in doc get-started.md
2019-01-03 15:00:13 -05:00
Steve Kriss
3be3ec434b Merge pull request #1139 from ncdc/remove-year-from-boilerplate
Remove YEAR from generated boilerplate comment
2019-01-03 10:36:40 -07:00
Andy Goldstein
e38e2fc5a1 Remove YEAR from generated boilerplate comment
Signed-off-by: Andy Goldstein <goldsteina@vmware.com>
2019-01-03 12:22:19 -05:00
Jun Gong
702d0f76c2 Add debugging-install link in doc get-started.md
Signed-off-by: Jun Gong <jungong@tencent.com>
2019-01-03 09:19:42 +08:00
Andy Goldstein
2ed241b0b7 Merge pull request #1124 from skriss/ark-version-changes
ark version changes
2018-12-19 16:24:07 -05:00
Nolan Brubaker
ff0ac68157 Merge pull request #1127 from skriss/fix-quickstart-links
update links to point to get-started.md
2018-12-10 12:46:40 -05:00
Nolan Brubaker
c34e3b9127 Merge pull request #988 from carlisia/c-crd-msg
Improve directions when location CRDs not deployed
2018-12-07 16:45:15 -05:00
Steve Kriss
d69e819122 update links to point to get-started.md
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-12-07 14:14:52 -07:00
Carlisia
1906c33eb2 Improve directions when location CRDs not deployed
Signed-off-by: Carlisia <carlisia@grokkingtech.io>
2018-12-07 10:41:40 -08:00
Steve Kriss
32dd33e211 changelog
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-12-07 09:59:03 -07:00
Steve Kriss
246d75811a version cmd: move tree state into git sha line
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-12-07 09:59:03 -07:00
Steve Kriss
ac317a87ff show full git SHA in ark version output
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-12-07 09:59:03 -07:00
Andy Goldstein
59ca9a3974 Merge pull request #1120 from jwhitcraft/schedule-delete-fix
Fix output of Schedule Delete
2018-12-06 15:38:31 -05:00
Jon Whitcraft
f983f4fb21 Fix output of Schedule Delete
It should be `\n` and not `/n/` when doing the printf on a schedule delete.

Signed-off-by: Jon Whitcraft <jwhitcraft@mac.com>
2018-12-06 15:33:14 -05:00
Wayne Witzel III
f1deff8ffc Merge pull request #1114 from skriss/goreleaser-updates
makefile updates for goreleaser
2018-12-06 14:50:53 -05:00
Steve Kriss
6a60a55ba5 rename 'make goreleaser' to 'make release', remove obsolete targets
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-12-06 11:06:24 -07:00
Steve Kriss
5b529d2da0 Merge pull request #1115 from wwitzel3/issue-1112
Move changelog entries to their own files
2018-12-06 11:02:59 -07:00
Steve Kriss
cc47b65830 Merge pull request #1118 from acbramley/master
Fix minio setup job command
2018-12-06 11:01:20 -07:00
Adam Bramley
90babe0ed3 Fix minio setup job command
Signed-off-by: Adam Bramley <adam.bramley@previousnext.com.au>
2018-12-06 16:05:28 +11:00
Wayne Witzel III
1b7a64a812 Add changelog make target helper
Signed-off-by: Wayne Witzel III <wayne@riotousliving.com>
2018-12-05 13:32:02 -05:00
Wayne Witzel III
1da5702c0f Move changelog entries to their own files
Signed-off-by: Wayne Witzel III <wayne@riotousliving.com>
2018-12-05 11:00:11 -05:00
Wayne Witzel III
5464b3dce8 Merge pull request #234 from ncdc/pprof
Add pprof support to ark server
2018-12-05 10:30:43 -05:00
Andy Goldstein
aa9d96f3b7 Add pprof support to ark server
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-12-05 10:13:39 -05:00
Steve Kriss
8955199e37 Merge pull request #998 from bashofmann/add-aws-s3-v1-signer
Allow to use AWS Signature v1 for creating signed AWS urls
2018-12-04 14:15:04 -07:00
Bastian Hofmann
e13806e0b8 Allow to use AWS Signature v1 for creating signed AWS urls
Some aws implementations, for example the quobyte object storage, do not
support the v4 signing algorithm, but only v1.
This makes it possible to configure the signatureVersion.

The algorithm implementation was ported from d6c1be296e/botocore/auth.py (L860-L862)
which is used by the aws CLI client.

This fixes https://github.com/heptio/ark/issues/811.

Signed-off-by: Bastian Hofmann <bashofmann@gmail.com>
2018-12-04 18:32:41 +01:00
Steve Kriss
555f73c3ea Merge pull request #1048 from ncdc/remove-default-token-from-all-service-accounts
Remove default token from all service accounts
2018-12-04 10:01:50 -07:00
Andy Goldstein
62d8c642d2 Remove default token from all service accounts
Instead of only removing the default token from a service account when
it already exists in the cluster, always remove it. If the service
account already exists, continue to do the merging logic.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-12-04 11:41:18 -05:00
Nolan Brubaker
a4a09f09a2 Merge pull request #955 from wwitzel3/issue-765
add multizone/regional support to gcp
2018-12-04 11:38:25 -05:00
Wayne Witzel III
312c6f5c3d Merge pull request #1107 from skriss/fix-bsl-config-docs
fix indendation of BSL config in docs
2018-12-04 10:39:40 -05:00
Wayne Witzel III
b92b35d42b add multizone/region support to gcp
Signed-off-by: Wayne Witzel III <wayne@riotousliving.com>
2018-12-04 10:24:55 -05:00
Wayne Witzel III
cdd499dc27 update vendoring
Signed-off-by: Wayne Witzel III <wayne@riotousliving.com>
2018-12-04 10:23:49 -05:00
Wayne Witzel III
6b910e621a Merge pull request #1108 from wwitzel3/devel-changelog
Update current development changelog
2018-12-03 22:32:48 -05:00
Wayne Witzel III
7dd62f8374 Update current development changelog
Signed-off-by: Wayne Witzel III <wayne@riotousliving.com>
2018-12-03 17:23:38 -05:00
Nolan Brubaker
0dd1c4b086 Merge pull request #1105 from skriss/api-versions-docs
document Ark's behavior re: API versions
2018-12-03 16:40:56 -05:00
Nolan Brubaker
51652e6a8c Merge pull request #1106 from skriss/fix-broken-link
add back missing link ref
2018-12-03 16:39:40 -05:00
Steve Kriss
bdf2615eb0 fix indendation of BSL config in docs
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-12-03 14:34:27 -07:00
Nolan Brubaker
ae4bffe30b Merge pull request #1063 from wwitzel3/changelog
adjust changelog layout and update contributing details.
2018-12-03 16:16:33 -05:00
Steve Kriss
f7fe949aa7 add back missing link ref
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-12-03 14:05:10 -07:00
Steve Kriss
d28f445c5a document Ark's behavior re: API versions
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-12-03 13:49:05 -07:00
Wayne Witzel III
7bdd7f8c87 Fixes for CHANGELOG from review
Signed-off-by: Wayne Witzel III <wayne@riotousliving.com>
2018-12-03 13:26:03 -05:00
Jennifer Rondeau
4c5f352a73 Merge pull request #1099 from skriss/fix-broken-links
fix/standardize links to api-types pages
2018-12-03 09:01:28 -05:00
Steve Kriss
e6ef2ba9e8 fix/standardize links to api-types pages
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-11-30 10:02:38 -07:00
JENNIFER RONDEAU
b8835d7880 reorganize get started for simplicity, clarity
Signed-off-by: JENNIFER RONDEAU <jrondeau@heptio.com>
2018-11-30 09:45:14 -05:00
Mike Dobozy
a002ae6315 Added GOFLAGS support
Signed-off-by: Mike Dobozy <dobozysaurus@Mikes-Air.fios-router.home>
2018-11-27 17:08:45 -05:00
Andy Goldstein
09042a9015 Merge pull request #1074 from mwieczorek/del-priority
Delete spec.priority in pod restore action
2018-11-26 14:05:51 -05:00
Michal Wieczorek
43cd2ca36f Delete spec.priority in pod restore action
Signed-off-by: Michal Wieczorek <wieczorek-michal@wp.pl>
2018-11-22 09:54:49 +01:00
Andy Goldstein
71214fa640 Merge pull request #1065 from omerlh/brew_ref
Added brew reference
2018-11-21 13:36:45 -05:00
omerlh
0d6d146bc1 added brew ref
Signed-off-by: omerlh <omerl@soluto.com>
2018-11-21 20:31:38 +02:00
Andy Goldstein
d85872dfb2 Merge pull request #1069 from gliptak/patch-1
Update to go 1.11
2018-11-21 08:39:06 -05:00
Gábor Lipták
daf1a75515 Bring Go current in Travis
Signed-off-by: Gábor Lipták <gliptak@gmail.com>
2018-11-21 08:31:14 -05:00
Steve Kriss
d27e4f7f05 Merge pull request #1054 from cbeneke/master
Initialize empty schedule metrics on server init
2018-11-20 09:30:45 -07:00
Steve Kriss
858171e812 Merge pull request #1066 from danielcb/fix-documentation-link
Change documentation link to a numbered link
2018-11-19 09:29:06 -07:00
Daniel Bross
ce69ff59e0 Change documentation link to a numbered link
Signed-off-by: Daniel Bross <daniel.c.bross@gmail.com>
2018-11-19 09:31:19 +01:00
Wayne Witzel III
64fd4c7b73 Updating CONTRIBUTING.md to include CHANGELOG.md section
Signed-off-by: Wayne Witzel III <wayne@riotousliving.com>
2018-11-17 13:01:14 -05:00
Wayne Witzel III
6b94f68201 adjust changelog layout
Signed-off-by: Wayne Witzel III <wayne@riotousliving.com>
2018-11-16 16:00:35 -05:00
Steve Kriss
f4820bd892 Merge pull request #1062 from danielcb/fix-documentation-link
Fix link to upgrade documentation in readme
2018-11-16 10:22:33 -07:00
Daniel Bross
7029d627c7 Fix link to upgrade documentation in readme
Signed-off-by: Daniel Bross <daniel.c.bross@gmail.com>
2018-11-16 08:58:10 +01:00
Nolan Brubaker
0fd7872ef4 Merge pull request #1057 from skriss/v0.10-ga-changelog
update changelog for v0.10.0 GA release
2018-11-14 17:45:02 -05:00
Steve Kriss
38c212ecf8 update changelog for v0.10.0 GA release
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-11-14 15:22:07 -07:00
Steve Kriss
411d62fe91 Merge pull request #1006 from ncdc/add-s3-public-url
Support a separate URL base for pre-signed URLs
2018-11-14 15:12:46 -07:00
Nolan Brubaker
fde5a4d1e2 Merge pull request #1045 from skriss/goreleaser-image-tags
package version-specific example YAML with each release
2018-11-14 17:11:07 -05:00
Steve Kriss
b9de44ffbd update docs to reference config/ dir within release tarballs
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-11-14 14:58:02 -07:00
Steve Kriss
eace0255de goreleaser: update example image tags to match version being released
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-11-14 14:54:41 -07:00
Steve Kriss
cbef9da721 Merge pull request #1023 from Bradamant3/docs-misc-issues
add rbac content and a candidate for more versioning information
2018-11-14 14:51:37 -07:00
JENNIFER RONDEAU
cff0215906 add rbac content, rework get-started for NodePort and publicUrl, add versioning information
Signed-off-by: JENNIFER RONDEAU <jrondeau@heptio.com>
2018-11-14 16:07:20 -05:00
Steve Kriss
75566c6c20 Merge pull request #1038 from Bradamant3/issue-819
add draft content for docs issue 819
2018-11-14 10:57:47 -07:00
JENNIFER RONDEAU
fa14255e53 add content for docs issue 819
Signed-off-by: JENNIFER RONDEAU <jrondeau@heptio.com>
2018-11-14 12:50:55 -05:00
KubeKween
25590a8351 Merge pull request #1050 from skriss/explain-locations
add doc explaining locations
2018-11-14 08:03:01 -08:00
Steve Kriss
22959071bc add doc explaining locations
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-11-14 08:57:23 -07:00
Christian Beneke
90c5ed0850 Initialize empty schedule metrics on server init
When backups are run manually (outside of a schedule) the metrics
will be counted for ark_*{schedule=""}. To prevent partial NaN
metrics they will be initialised on server init.

Signed-off-by: Christian Beneke <c.beneke@syseleven.de>
2018-11-14 15:31:26 +01:00
Steve Kriss
2781e4e8de Merge pull request #956 from ffd2subroutine/qps-burst-configurable
Added qps and burst to server's client
2018-11-09 12:41:41 -07:00
Darko Radisic
e5556fe608 Added qps and burst to server's client
Signed-off-by: Darko Radisic <ffd2subroutine@users.noreply.github.com>
2018-11-09 20:16:24 +01:00
Andy Goldstein
9ae861c9e2 Support a separate URL base for pre-signed URLs
This allows the Ark server to use one URL for the majority of
communications with S3 (or compatible) object storage, and a different
URL base for pre-signed URLs (for streaming logs, etc. to clients).

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-11-08 14:43:57 -05:00
Steve Kriss
449cac5806 Merge pull request #1032 from mwieczorek/plugins
Move clearing up of metadata before plugin's actions
2018-11-08 12:00:33 -07:00
Steve Kriss
5d039e4b23 Merge pull request #1044 from jrnt30/patch-1
Update storage-layout-reorg-v0.10.md
2018-11-08 11:52:31 -07:00
Wayne Witzel III
366ca748d4 Merge pull request #1042 from skriss/v0.9.11-changelog
v0.9.11 changelog
2018-11-08 11:59:39 -05:00
Steve Kriss
6ff98784fe v0.9.11 changelog
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-11-08 09:39:02 -07:00
Justin Nauman
698420b613 Update storage-layout-reorg-v0.10.md
Minor link fix.

Signed-off-by: Justin Nauman justin.r.nauman@gmail.com
2018-11-08 10:33:50 -06:00
Steve Kriss
caa990a272 Merge pull request #1040 from ncdc/fix-pv-not-found-check
Fix check for non-found PV
2018-11-08 09:19:15 -07:00
Andy Goldstein
3788014552 Fix check for non-found PV
We were checking for nil, but were getting back an empty
*unstructured.Unstructured{} instead, along with a NotFound error.
Change the logic to check for the NotFound error instead of a nil
object.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-11-08 10:56:14 -05:00
Steve Kriss
40e33020d8 Merge pull request #1022 from shubheksha/fix/945-restore-controller-remove-checking-backup-storage-directly
Remove code that checks backup storage directly from restore controller
2018-11-06 15:53:13 -08:00
KubeKween
becd075000 Merge pull request #1034 from skriss/tweak-logging
lower some noisy logs to debug level
2018-11-05 05:40:38 -08:00
Steve Kriss
eb59b5c593 Merge pull request #1019 from Bradamant3/0.10-beta2-docs
add troubleshooting for loadbalancer restores
2018-11-02 16:08:04 -06:00
Steve Kriss
6c9e1f187f lower some noisy logs to debug level
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-11-02 15:55:47 -06:00
JENNIFER RONDEAU
318fd8a83f add troubleshooting for loadbalancer restores
Signed-off-by: JENNIFER RONDEAU <jrondeau@heptio.com>
2018-11-02 15:29:00 -04:00
Shubheksha Jalan
defb8aa856 remove code that checks directly for a backup from restore controller
Signed-off-by: Shubheksha Jalan <jshubheksha@gmail.com>
2018-11-02 23:35:04 +05:30
Michal Wieczorek
7abe115674 Move clearing up of metadata before plugin's actions
Signed-off-by: Michal Wieczorek <wieczorek-michal@wp.pl>
2018-11-02 09:56:33 +01:00
Steve Kriss
96ad3ec7b4 Merge pull request #1030 from wwitzel3/master
Add v0.9.10 changelog
2018-11-01 15:32:30 -06:00
Wayne Witzel III
6b70d9225d Add v0.9.10 changelog
Signed-off-by: Wayne Witzel III <wayne@riotousliving.com>
2018-11-01 17:27:14 -04:00
Wayne Witzel III
76982d3d02 Merge pull request #1020 from skriss/goreleaser-fixes
fix goreleaser bugs
2018-11-01 11:28:48 -04:00
Steve Kriss
7d497e6f2f Merge pull request #1025 from nrb/doc-1024
Document upgrading plugins in the deployment
2018-10-31 08:24:14 -06:00
Nolan Brubaker
ec013e6ffd Document upgrading plugins in the deployment
Fixes #1024

Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-10-30 16:11:19 -04:00
Andy Goldstein
cb0e6f4773 Merge pull request #999 from bashofmann/fix-backup-file-deletion-order
AWS: Ensure that the order returned by ListObjects is consistent
2018-10-30 15:46:33 -04:00
Bastian Hofmann
8bbfc538f1 AWS: Ensure that the order returned by ListObjects is consistent
When a backup is deleted, the delete method uses ListObjects to get a list of
files it needs to delete in s3. Different s3 implementations may return
the object lists in different, even non-deterministic orders, which can
result in the deletion not working because ark tries to delete a non empty folder
before it tries to delete the files in the folder.

Signed-off-by: Bastian Hofmann <bashofmann@gmail.com>
2018-10-30 20:38:47 +01:00
Steve Kriss
c3c2ea2805 Merge pull request #985 from shubheksha/fix/977-add-prom-metrics-volume-snapshots
Add prometheus metrics for successful and attempted volume snapshots per backup
2018-10-30 13:25:00 -06:00
Shubheksha Jalan
4239e61f47 add prometheus metrics for successful and attempted volume snapshots per backup
rename variables to reflect the metric name

fix comments for exported methods

explicitly record per schedule per schedule metric values

initialize metrics and change variable name to match with that of metric

add metric for recording failed volume snapshots

use singular variable instead of plural

remove extra field for failed snapshots, calculate using existing fields

initialize failure metric and rename methods

Signed-off-by: Shubheksha Jalan <jshubheksha@gmail.com>
2018-10-31 00:47:05 +05:30
Steve Kriss
9165d514a3 Merge pull request #1002 from nrb/fix-609
Verify PV doesn't exist before creating new volume
2018-10-30 13:04:15 -06:00
Nolan Brubaker
6231aaa875 Verify PV doesn't exist before creating new volume
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-10-30 13:57:00 -04:00
Steve Kriss
681f7043a8 Merge pull request #996 from nrb/silence-builder-git-advice
Silence git detached HEAD advice in build container
2018-10-30 09:33:46 -06:00
Steve Kriss
d6162e943b fix goreleaser bugs
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-30 09:00:11 -06:00
Steve Kriss
7c62ed2981 Merge pull request #1015 from Bradamant3/add-warning
add 0.10 breaking changes warning to readme in master
2018-10-29 22:16:02 -06:00
Steve Kriss
0f7f084fb9 Merge pull request #1010 from greggubarev/patch-1
Add correct link and change role
2018-10-29 22:14:35 -06:00
Gregory Gubarev
a15df2761c Add correct link and change role
Add correct link and change role from role/heptio-ark to role/<HEPTIO_ARK_ROLE_NAME>

Signed-off-by: Gregory Gubarev <g.gubarev63@gmail.com>
2018-10-29 22:48:22 +04:00
JENNIFER RONDEAU
46bed015f5 add 0.10 breaking changes warning to readme in master
Signed-off-by: JENNIFER RONDEAU <jrondeau@heptio.com>
2018-10-29 13:46:31 -04:00
Steve Kriss
beb22f953b Merge pull request #1008 from Bradamant3/0.10-doc-994
add content for issue 994
2018-10-29 11:11:33 -06:00
JENNIFER RONDEAU
e3a7d6a20d add content for issue 994
Signed-off-by: JENNIFER RONDEAU <jrondeau@heptio.com>
2018-10-29 13:03:38 -04:00
Steve Kriss
40882d7ee7 Merge pull request #1004 from Bradamant3/0.10-doc-updates
address docs issue #978
2018-10-29 10:27:17 -06:00
JENNIFER RONDEAU
400911e96b address docs issue #978
Signed-off-by: JENNIFER RONDEAU <jrondeau@heptio.com>
2018-10-29 11:28:27 -04:00
Nolan Brubaker
52574b9c0a Merge pull request #1005 from Bradamant3/0.10-doc-updates-page
0.10 doc updates page
2018-10-29 09:22:23 -04:00
Nolan Brubaker
f1cb85134c Merge pull request #1000 from skriss/goreleaser
goreleaser scripts for building/creating a release on a workstation
2018-10-29 09:21:10 -04:00
Wayne Witzel III
ce41dd7225 Merge pull request #1009 from skriss/vsl-defaulting
don't require a default provider VSL if there's only 1
2018-10-26 15:28:10 -04:00
Steve Kriss
b818cc2769 don't require a default provider VSL if there's only 1
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-26 12:45:40 -06:00
Nolan Brubaker
51379b0150 Merge pull request #1003 from skriss/v0.10-changelog
v0.10 changelog
2018-10-26 13:41:56 -04:00
Steve Kriss
9063808606 v0.10 changelog
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-26 11:37:31 -06:00
JENNIFER RONDEAU
6e2166c49c add docs page on versions and upgrading
Signed-off-by: JENNIFER RONDEAU <jrondeau@heptio.com>
2018-10-26 13:03:20 -04:00
Steve Kriss
18b434cb24 goreleaser scripts for building/creating a release on a workstation
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-25 13:51:09 -06:00
Andy Goldstein
39d9155267 Merge pull request #963 from kmova/patch-1
update restic prerequisite with min k8s version
2018-10-25 13:18:03 -04:00
Kiran Mova
bb65d67a13 update restic prerequisite with min k8s version
Restic DaemonSet pods require shared mounts with mountPropagation
feature enabled on the Kubernetes Cluster.  Refer #669

Signed-off-by: kmova <kiran.mova@openebs.io>
2018-10-25 16:58:02 +00:00
Nolan Brubaker
b5a2ccd510 Silence git detached HEAD advice in build container
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-10-24 22:57:50 -04:00
Nolan Brubaker
74cb6a2150 Merge pull request #986 from skriss/fix-empty-bsls
sync controller: fill in missing .spec.storageLocation
2018-10-24 18:38:00 -04:00
Nolan Brubaker
0152885bb2 Merge pull request #984 from skriss/upgrade-docs
instructions for upgrading to v0.10
2018-10-24 18:36:51 -04:00
Steve Kriss
677491410b instructions for upgrading to v0.10
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-24 15:12:25 -06:00
Steve Kriss
21a2a2e1f5 Merge pull request #992 from nrb/v0.9.9-changelog
Add v0.9.9 changelog
2018-10-24 09:02:42 -06:00
Nolan Brubaker
04aedbb5ac Add v0.9.9 changelog
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-10-24 10:57:12 -04:00
KubeKween
22704d283f Merge pull request #983 from skriss/fix-restores
fix bug preventing PV snapshots from v0.10 backups from restoring
2018-10-23 21:56:21 -07:00
Steve Kriss
516422c2c4 sync controller: fill in missing .spec.storageLocation
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-23 16:26:07 -06:00
Steve Kriss
195e6aaf00 fix bug preventing PV snapshots from v0.10 backups from restoring
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-23 12:44:05 -06:00
KubeKween
9cda7eae55 Merge pull request #981 from ncdc/goimports-local
Make goimports consistent by pinning version and using -local flag
2018-10-23 10:22:18 -07:00
Andy Goldstein
bca585162f Run 'make update' to update formatting
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-10-23 13:08:42 -04:00
Andy Goldstein
573ce7d0e7 Update formatting script
- Pin to a specific revision of goimports
- Use -local flag with goimports to keep ark imports separated
- Correct shellcheck errors

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-10-23 13:01:07 -04:00
Nolan Brubaker
6cf3519c3a Merge pull request #974 from skriss/backup-describer
backup describer: show snapshot summary by default, details optionally
2018-10-23 12:58:54 -04:00
Nolan Brubaker
6591b5a09c Merge pull request #975 from skriss/rm-pvproviderexists
remove pvProviderExists param from NewRestoreController
2018-10-23 12:58:17 -04:00
KubeKween
7c4ac05ae5 Merge pull request #972 from skriss/support-pre-v0.10-snaps
Support pre v0.10 snaps
2018-10-23 09:08:52 -07:00
Steve Kriss
90d9be59d3 support restoring/deleting legacy backups with .status.volumeBackups
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-23 09:55:40 -06:00
Nolan Brubaker
a7e524db33 Merge pull request #976 from skriss/azure-doc-fix
fix broken link
2018-10-23 11:06:50 -04:00
Steve Kriss
f3a57b5b8a Merge pull request #971 from shubheksha/fix/594-restore-storageclasses-before-pv-pvc
Restore storageclasses before pvs and pvcs
2018-10-23 08:14:42 -06:00
KubeKween
b66c6b1105 Merge pull request #970 from u5surf/issue-967
create a struct for multiple return of same type in restore_contoroll…
2018-10-23 06:55:25 -07:00
u5surf
ef19497205 rename variables #967
Signed-off-by: u5surf <u5.horie@gmail.com>
2018-10-23 08:53:35 +09:00
Steve Kriss
6d4e702cda fix broken link
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-22 14:24:25 -06:00
Shubheksha Jalan
596eea1b8c restore storageclasses before pvs and pvcs
Signed-off-by: Shubheksha Jalan <jshubheksha@gmail.com>
2018-10-22 21:15:08 +02:00
Steve Kriss
f014cab1fe backup describer: show snapshot summary by default, details optionally
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-22 12:08:37 -06:00
Steve Kriss
8acc66d02f remove pvProviderExists param from NewRestoreController
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-22 11:47:51 -06:00
Steve Kriss
6ef155ddff Merge pull request #969 from ManavpreetSingh/master
Corrected grammatical  error
2018-10-20 12:50:23 -06:00
u5surf
57ce590fae create a struct for multiple return of same type in restore_contoroller #967
Signed-off-by: u5surf <u5.horie@gmail.com>
2018-10-20 20:45:26 +09:00
ManavpreetSingh
028fafb6cf Corrected grammatical error
Signed-off-by: ManavpreetSingh <manavpreeetsingh@gmail.com>
2018-10-20 15:42:34 +05:30
Andy Goldstein
d0937a3433 Merge pull request #960 from Atul9/return-arguments
#959 Update restoreController runRestore function to specify return arguments
2018-10-19 13:03:30 -04:00
Atul Bhosale
db856affcb Specify return arguments
Update restoreController runRestore function to specify return arguments

Signed-off-by: Atul Bhosale <atul1bhosale@gmail.com>
2018-10-19 21:41:58 +05:30
Andy Goldstein
56da761e68 Merge pull request #962 from domenicrosati/drosati/#424-crds-priority
Add CRDs to list of prioritized resources
2018-10-19 09:55:42 -04:00
Domenic Rosati
9952dfb0ad Address #424: Add CRDs to list of prioritized resources
Signed-off-by: Domenic Rosati <domenicrosati@gmail.com>
2018-10-18 22:42:37 -03:00
Steve Kriss
fe19863089 Merge pull request #954 from nrb/v0.9.8-changelog-master
Update changelog for v0.9.8
2018-10-18 09:42:19 -06:00
Nolan Brubaker
e897153328 Update changelog for v0.9.8
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-10-18 11:36:12 -04:00
Wayne Witzel III
7f1553306a Merge pull request #947 from skriss/restic-v0.9.3
upgrade to restic v0.9.3
2018-10-18 11:21:31 -04:00
Wayne Witzel III
b3b065a9fb Merge pull request #949 from skriss/remove-config
remove Config CRD
2018-10-18 10:47:23 -04:00
Wayne Witzel III
77d05ec1c3 Merge pull request #951 from skriss/fix-950
fix bugs in GetBackupVolumeSnapshots and add test
2018-10-18 10:05:08 -04:00
Steve Kriss
cf2c27141b fix bugs in GetBackupVolumeSnapshots and add test
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-17 15:10:42 -06:00
Steve Kriss
ec124673fa remove all references to Config from docs/examples
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-17 14:00:38 -06:00
Steve Kriss
c36131a024 remove Config-related code
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-17 14:00:38 -06:00
KubeKween
17b3a3b073 Merge pull request #948 from heptio/snapshot-locations
Add VolumeSnapshotLocations support
2018-10-17 12:54:54 -07:00
Wayne Witzel III
406b50a71b update restore process using snapshot locations
Signed-off-by: Wayne Witzel III <wayne@riotousliving.com>
2018-10-17 13:40:42 -06:00
Steve Kriss
268080ad09 avoid panics if can't get block store during deletion
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-17 13:40:42 -06:00
Steve Kriss
4a03370f1d update backup deletion controller for snapshot locations
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-17 13:40:42 -06:00
Steve Kriss
38c72b8cc2 include snapshot locations in created schedule's backup spec
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-17 13:40:41 -06:00
Steve Kriss
0ec2de55c0 azure: update blockstore to allow storing snaps in different resource group
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-17 13:39:51 -06:00
Steve Kriss
35bb533c2d close gzip writer before uploading volumesnapshots file
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-17 13:39:50 -06:00
Steve Kriss
da9ed38c63 store volume snapshot info as JSON in backup storage
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-17 13:39:49 -06:00
Steve Kriss
e24248e07a add --volume-snapshot-locations flag to ark backup create
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-17 13:36:51 -06:00
Steve Kriss
df07b7dc9f update backup code to work with volume snapshot locations
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-17 13:36:50 -06:00
Wayne Witzel III
4af89fa863 add unit test for getDefaultVolumeSnapshotLocations
Signed-off-by: Wayne Witzel III <wayne@riotousliving.com>
2018-10-17 13:35:52 -06:00
Wayne Witzel III
02f50b9c84 add default-volume-snapshot-locations to server cmd
Signed-off-by: Wayne Witzel III <wayne@riotousliving.com>
2018-10-17 13:35:50 -06:00
Carlisia
1aa712d236 Default and validate VolumeSnapshotLocations
Signed-off-by: Carlisia <carlisia@grokkingtech.io>
2018-10-17 13:33:22 -06:00
Wayne Witzel III
bbf769850e add create CLI command for snapshot locations
Signed-off-by: Wayne Witzel III <wayne@riotousliving.com>
2018-10-17 13:33:22 -06:00
Wayne Witzel III
aeb221eafe Add printer for snapshot locations
Signed-off-by: Wayne Witzel III <wayne@riotousliving.com>
2018-10-17 13:33:22 -06:00
Wayne Witzel III
ffc612ac13 Add volume snapshot CLI get command
Signed-off-by: Wayne Witzel III <wayne@riotousliving.com>
2018-10-17 13:33:22 -06:00
Carlisia
f20342aab9 Add VolumeLocation and Snapshot.
Signed-off-by: Carlisia <carlisia@grokkingtech.io>
2018-10-17 13:33:22 -06:00
Steve Kriss
7172db8a1e upgrade to restic v0.9.3
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-17 13:28:01 -06:00
Nolan Brubaker
e5a8fab9e0 Merge pull request #942 from captjt/master
Support --include-cluster-resources when creating schedule
2018-10-16 15:57:39 -04:00
captjt
ebc379ac02 Add --include-cluster-resources options when creating schedule
Signed-off-by: captjt <jtaylor007.jt@gmail.com>
2018-10-16 15:52:18 -04:00
Steve Kriss
6243a354b8 Merge pull request #935 from radlinskii/master
Remove broken references to unexisting docs.
2018-10-15 12:30:55 -06:00
radlinskii
99adc4fa55 Remove broken references to docs that are not existing
Signed-off-by: radlinskii <radlinskiignacy@gmail.com>
2018-10-15 19:53:38 +02:00
KubeKween
0e7f442f00 Merge pull request #930 from skriss/fix-898
don't require a default backup storage location to exist
2018-10-12 12:34:44 -07:00
Wayne Witzel III
37031d5e7c Merge pull request #920 from skriss/fix-225
only try to backup PVC's linked PV if PVC phase is Bound
2018-10-12 14:10:18 -04:00
Wayne Witzel III
480f1942b7 Merge pull request #927 from skriss/fix-925
pod restore action: check initContainers exist before processing
2018-10-12 14:09:35 -04:00
Steve Kriss
01980f0611 Merge pull request #933 from runyontr/master
Fixed relative link for image
2018-10-12 09:02:43 -06:00
Thomas Runyon
474efde6ba Fixed relative link for image
Signed-off-by: Thomas Runyon <runyontr@gmail.com>
2018-10-12 06:24:52 -04:00
Steve Kriss
4173515435 don't require a default backup storage location to exist
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-11 14:43:27 -06:00
Andy Goldstein
fe51be6713 Merge pull request #926 from shubheksha/fix/329-remove-get-project-gcp
Remove logic to get a gcp project
2018-10-11 15:45:40 -04:00
Steve Kriss
38e86ceff5 pod restore action: check initContainers exist before processing
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-11 13:44:02 -06:00
Shubheksha Jalan
611bc92695 remove logic to get a gcp project
Signed-off-by: Shubheksha Jalan <jshubheksha@gmail.com>
2018-10-11 21:23:30 +02:00
Steve Kriss
63dc6c1d9a only try to backup PVC's linked PV if PVC phase is Bound
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-10 13:34:33 -06:00
KubeKween
d7dfffa373 Merge pull request #918 from skriss/v0.9.8-beta.1-changelog
CHANGELOG entry for v0.9.8-beta.1
2018-10-10 09:03:59 -07:00
Steve Kriss
7575ff22ca CHANGELOG entry for v0.9.8-beta.1
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-10 09:57:20 -06:00
KubeKween
d579784692 Merge pull request #910 from james-powis/fix_restic_restore_service_user_token
Drop volumes matching name ServiceAccountName-token-
2018-10-09 11:32:23 -07:00
James Powis
30369c2ad5 Drop volumeMounts from initContainers if SAToken
Signed-off-by: James Powis <powisj@gmail.com>
2018-10-05 16:00:58 -06:00
Nolan Brubaker
7c3f4ddd74 Merge pull request #911 from skriss/874-followup
templatize error message in DeleteOptions
2018-10-05 16:06:51 -04:00
Steve Kriss
0612c5de70 templatize error message in DeleteOptions
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-05 13:24:30 -06:00
Steve Kriss
1da3278ad6 Merge pull request #874 from shubheksha/fix/748-ark-schedule-bulk-deletion
Add support for bulk deletion to `ark schedule delete`
2018-10-05 13:21:40 -06:00
Shubheksha Jalan
66bcbc058c add support for bulk deletion to ark schedule delete
refactor and move DeleteOptions struct and methods

unexport fields not used outside the package in DeleteOptions struct

refactor BindFlags() to work with name of command

fix constructor

Signed-off-by: Shubheksha Jalan <jshubheksha@gmail.com>
2018-10-05 19:45:18 +02:00
KubeKween
18c51fbd4b Merge pull request #888 from skriss/restic-multi-loc
support multiple backup locations for restic
2018-10-05 10:15:34 -07:00
Steve Kriss
3af43b492f add azure-specific code to support multi-location restic
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-05 09:20:56 -06:00
Steve Kriss
d009163b67 update restic to support multiple backup storage locations
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-05 09:10:35 -06:00
Wayne Witzel III
257917767f Merge pull request #907 from skriss/v0.9.7-changelog-upd
add node port fix to v0.9.7 changelog
2018-10-04 14:39:31 -04:00
Steve Kriss
6c398fc42a add node port fix to v0.9.7 changelog
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-04 12:25:50 -06:00
Steve Kriss
b31c6e1a36 Merge pull request #905 from wwitzel3/master
Update CHANGELOG.md for v0.9.7
2018-10-04 11:11:09 -06:00
Wayne Witzel III
a5834b852d Update CHANGELOG.md for v0.9.7
Signed-off-by: Wayne Witzel III <wayne@riotousliving.com>
2018-10-04 13:06:39 -04:00
Wayne Witzel III
a0604d6d1a Merge pull request #902 from scottslowe/fix-readme-csp-link
Fix broken storage providers link
2018-10-04 10:28:48 -04:00
Wayne Witzel III
9873e648d1 Merge pull request #903 from hummelo/patch-1
Change link for the support matrix
2018-10-04 10:19:50 -04:00
Oliver Hummel
f4c99c7774 Change link for the support matrix
The support-matrix.md has been moved to the docs folder, hence the link in the readme didn't work anymore.

Signed-off-by: Oliver Hummel <oliver.hummel@sap.com>
2018-10-04 10:56:50 +02:00
Scott Lowe
91e45d5689 Fix broken storage providers link
Fix a broken link in README.md pointing to the list of compatible storage providers.

Signed-off-by: Scott Lowe <scott.lowe@scottlowe.org>
2018-10-03 20:14:50 -06:00
KubeKween
f7a8091645 Merge pull request #901 from skriss/fix-example-bsls
fix backup storage location example YAMLs
2018-10-03 08:51:46 -07:00
Steve Kriss
ed0eb865ec fix backup storage location example YAMLs
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-03 09:39:18 -06:00
Wayne Witzel III
1d90d02a99 Merge pull request #900 from skriss/restic-restore-ns-mapping
bug: fix restic restores when using namespace mappings
2018-10-03 10:59:13 -04:00
KubeKween
cb43ff91ef Merge pull request #825 from skriss/sync-controller
sync controller improvements
2018-10-03 07:46:55 -07:00
Steve Kriss
0c88eefc0d bug: fix restic restores when using namespace mappings
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-03 08:09:55 -06:00
Steve Kriss
eb709b8f70 only sync a backup location if it's changed since last sync
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-03 08:05:06 -06:00
Steve Kriss
82ab2d73ac Merge pull request #894 from marctc/fix_backup_list_date
Change CreationTimestamp to StartTimestamp in backup list
2018-10-02 11:04:04 -06:00
Nolan Brubaker
65209cd0f3 Merge pull request #890 from skriss/update-azure-docs
clarify Azure resource group usage in docs
2018-10-02 12:35:47 -04:00
Andy Goldstein
190d032551 Merge pull request #837 from mwieczorek/patch-1
Enable restoring resources with ownerReference set
2018-10-02 10:57:18 -04:00
Marc Tudurí
ae4bf3d5f8 Change CreationTimestamp by StartTimestamp in backup list
Signed-off-by: Marc Tudurí <marctc@gmail.com>
2018-10-02 15:17:58 +02:00
Michal Wieczorek
0f1c5c283f Enable restoring resources with ownerReference set
Signed-off-by: Michal Wieczorek <wieczorek-michal@wp.pl>
2018-10-02 12:04:51 +02:00
KubeKween
94b8fae15a Merge pull request #891 from skriss/fix-restore-logs
remove restore log helper for accurate line #'s
2018-10-01 21:02:17 -07:00
Steve Kriss
729a688b36 remove restore log helper for accurate line #'s
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-09-30 14:45:32 -06:00
Steve Kriss
af3af1b520 clarify Azure resource group usage in docs
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-09-30 14:16:36 -06:00
Steve Kriss
3542f39f5f Merge pull request #889 from ffd2subroutine/minor-code-cleanup
Minor code cleanup
2018-09-30 13:45:45 -06:00
ffd2subroutine
9fdf85130a Minor code cleanup
Signed-off-by: ffd2subroutine <ffd2subroutine@users.noreply.github.com>
2018-09-30 20:43:11 +02:00
Wayne Witzel III
a57acec43d Merge pull request #876 from skriss/restic-share-bucket
Move restic repos into the main Ark bucket, under restic/
2018-09-28 12:12:45 -04:00
Steve Kriss
c5e3f0eecb Merge pull request #885 from nrb/support-formatting
Fix formatting for live site
2018-09-27 21:04:46 -06:00
Nolan Brubaker
2073e15a69 Fix formatting for live site
A blank line is necessary before starting a table with Jekyll. Fix it
here so when new versions are cut they render to HTML corectly.

Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-09-27 18:35:14 -04:00
Nolan Brubaker
2e9a83f4c0 Merge pull request #880 from skriss/on-prem-docs
Improve documentation for on-premises usage
2018-09-27 17:53:42 -04:00
JENNIFER RONDEAU
0fc3e8d852 add documentation on running Ark on-premises
Signed-off-by: JENNIFER RONDEAU <jrondeau@heptio.com>
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-09-27 15:45:12 -06:00
Nolan Brubaker
ed2bca83bd Merge pull request #869 from shubheksha/fix/786-fix-error-ExternalName-service-restore
Fix error when restoring ExternalName services
2018-09-25 16:33:36 -04:00
Nolan Brubaker
a6fa7af095 Merge pull request #853 from skriss/storage-reorg
Reorganize how data is stored in a backup storage location
2018-09-25 16:15:30 -04:00
Steve Kriss
e46e89cb61 have restic share main Ark bucket
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-09-25 13:12:22 -06:00
Steve Kriss
42b54586cd refactor to make valid dirs part of an object store layout
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-09-25 13:12:22 -06:00
Steve Kriss
8bc7e4f6aa store backups & restores in backups/, restores/ subdirs in obj storage
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-09-25 09:56:41 -06:00
Steve Kriss
889b220a5a Merge pull request #865 from shubheksha/fix/749-ark-restore-bulk-deletion
Add support for bulk deletion to `ark restore delete`
2018-09-25 09:19:31 -06:00
Shubheksha Jalan
e3232b7eb6 add support for bulk deletion to ark restore delete
refactor util methods into a common package

move utility methods into cli package instead of common

rename util.go to common.go

Signed-off-by: Shubheksha Jalan <jshubheksha@gmail.com>
2018-09-25 20:37:20 +05:30
Shubheksha Jalan
e3222a9e3f move code dealing with node ports into a separate function
Signed-off-by: Shubheksha Jalan <jshubheksha@gmail.com>
2018-09-25 18:08:57 +05:30
Shubheksha Jalan
d95b18bad8 ignore spec.ports not being there for services of type ExternalName
Signed-off-by: Shubheksha Jalan <jshubheksha@gmail.com>
2018-09-25 01:35:13 +05:30
Shubheksha Jalan
907a9fbdd8 fix error during restore when spec.ports are not found
Signed-off-by: Shubheksha Jalan <jshubheksha@gmail.com>
2018-09-25 01:02:47 +05:30
Andy Goldstein
a28327b47e Merge pull request #868 from shubheksha/fix/798-remove-generated-cli-docs
Remove cli reference docs generation
2018-09-24 15:13:07 -04:00
Shubheksha Jalan
17be71e1ff remove deps used for docs gen
Signed-off-by: Shubheksha Jalan <jshubheksha@gmail.com>
2018-09-25 00:29:28 +05:30
Shubheksha Jalan
20635106e8 remove script for generating docs
Signed-off-by: Shubheksha Jalan <jshubheksha@gmail.com>
2018-09-25 00:15:50 +05:30
Shubheksha Jalan
6fd9ea9d5f remove cli reference docs and related scripts
Signed-off-by: Shubheksha Jalan <jshubheksha@gmail.com>
2018-09-25 00:02:32 +05:30
KubeKween
368787c184 Merge pull request #859 from nrb/busybox-pause
Fix infinite sleep in fsfreeze container
2018-09-23 10:06:56 -07:00
Nolan Brubaker
4323e287c9 Merge pull request #860 from skriss/v0.9.6-changelog
update CHANGELOG for v0.9.6
2018-09-21 12:00:19 -04:00
Steve Kriss
a793cbb62b update CHANGELOG for v0.9.6
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-09-21 09:47:44 -06:00
Nolan Brubaker
4833607abd Fix infinite sleep in fsfreeze container
busybox's sleep command doesn't support the `infinity` value, so update
it to be an infinite loop.

Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-09-21 11:41:01 -04:00
Steve Kriss
5161890738 Merge pull request #852 from nrb/alpine-fix
Bump alpine image for security fix
2018-09-21 09:39:19 -06:00
Steve Kriss
3a60853340 Merge pull request #843 from james-powis/master
Discard all SA Token volumes from pod restore
2018-09-19 13:31:15 -06:00
James Powis
a5cb2ce4b7 Change from regex matching default-token to prefix SA-token-
Signed-off-by: James Powis <powisj@gmail.com>
2018-09-19 13:06:10 -06:00
Nolan Brubaker
80bc3ded14 Bump alpine image for security fix
This change includes the fix at
6484ed9849

Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-09-18 12:18:05 -04:00
Steve Kriss
afb8102a44 Merge pull request #849 from disrani-px/px_support_links
Add links for Portworx plugin support
2018-09-17 12:04:58 -06:00
Dinesh Israni
7668bfd495 Add links for Portworx plugin support
Signed-off-by: Dinesh Israni <disrani@portworx.com>
2018-09-17 10:55:24 -07:00
Nolan Brubaker
5cc58ed305 Merge pull request #848 from skriss/v0.9.5-changelog
v0.9.5 changelog entry
2018-09-17 12:27:35 -04:00
Steve Kriss
84f01df828 v0.9.5 changelog entry
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-09-17 10:03:38 -06:00
Nolan Brubaker
b5e4f85b8c Merge pull request #834 from skriss/fix-restic-restores
get a new metadata accessor after calling backup item actions
2018-09-12 17:13:16 -04:00
Steve Kriss
1dda7b91cc Merge pull request #842 from disrani-px/patch-1
Fix Portworx name in doc
2018-09-12 15:07:24 -06:00
Dinesh Israni
468006e619 Fix Portworx name in doc
Signed-off-by: Dinesh Israni <disrani@portworx.com>
2018-09-12 13:33:31 -07:00
Steve Kriss
3eb1160301 Merge pull request #835 from nrb/fix-833
Make fsfreeze image building consistent
2018-09-12 09:48:34 -06:00
Nolan Brubaker
e6b44539a5 Make fsfreeze image building consistent
Due to the version of docker used to build images, the Dockerfile used
with -f must be in the same directory that's used for the context. Copy
the Dockerfile into the _output directory and make the custom targets
more closely match the standard ones.

Fixes #833

Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-09-12 01:15:54 -04:00
Steve Kriss
fcd27a13da get a new metadata accessor after calling backup item actions
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-09-10 16:19:38 -06:00
Carlisia
69e2f51fbe Merge pull request #801 from ljakimczuk/master
Claim ownership of new AWS volumes by Kubernetes cluster restoring the backup
2018-09-10 14:03:06 -07:00
Lukasz Jakimczuk
ffef86e38d Adding support for the AWS_CLUSTER_NAME env variable allowing to claim volumes ownership
Signed-off-by: Lukasz Jakimczuk <ljakimczuk@gmail.com>

Moving check for environment variable outside the loop

Signed-off-by: Lukasz Jakimczuk <ljakimczuk@gmail.com>

Insert a note about AWS_CLUSTER_NAME in the aws-config doc

Signed-off-by: Lukasz Jakimczuk <ljakimczuk@gmail.com>

Improving implementation and documentation

Signed-off-by: Lukasz Jakimczuk <ljakimczuk@gmail.com>

Changing instructions, adding unit test for getTagsForCluster and removing duplicated Lookup

Signed-off-by: Lukasz Jakimczuk <ljakimczuk@gmail.com>

Commit after update

Signed-off-by: Lukasz Jakimczuk <ljakimczuk@gmail.com>

Correcting bad formatting in aws-config.md

Signed-off-by: Lukasz Jakimczuk <ljakimczuk@gmail.com>
2018-09-10 22:34:33 +02:00
Steve Kriss
a6dbfe822f Merge pull request #832 from nrb/doc-plugin-naming
Document single binary plugins
2018-09-10 10:02:43 -06:00
Nolan Brubaker
cda3dff8e3 Document single binary plugins
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-09-07 17:35:13 -04:00
Steve Kriss
7c36d80ee2 Merge pull request #829 from nrb/rm-roadmap
Remove ROADMAP.md, update ZenHub link to Ark board
2018-09-07 14:01:38 -06:00
Nolan Brubaker
f049e0787b Remove ROADMAP.md, update ZenHub link to Ark board
ROADMAP.md has fallen out of date, and is superceded by ZenHub.

Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-09-07 15:47:48 -04:00
Nolan Brubaker
c9a9dd4508 Merge pull request #824 from skriss/generic-controllers
convert all controllers to use genericController, logContext -> log
2018-09-07 14:20:22 -04:00
Steve Kriss
086d0667de Merge pull request #823 from nrb/sig-error-docs
Document SignatureDoesNotMatch error and triaging
2018-09-07 09:51:12 -06:00
Steve Kriss
94617b302d convert all controllers to use genericController, logContext -> log
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-09-07 09:38:58 -06:00
Nolan Brubaker
779cb42854 Document SignatureDoesNotMatch error and triaging
Fixes #714

Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-09-07 11:24:59 -04:00
Carlisia
44a75cee7b Merge pull request #820 from skriss/azure-restic-fix
set azure restic env vars based on default backup location's config
2018-09-06 13:01:45 -07:00
Carlisia
92283a52d6 Merge pull request #800 from skriss/prefixes-final
Enable Ark to store backups/etc. under a prefix within an object storage bucket
2018-09-06 10:10:56 -07:00
Steve Kriss
7d8813a96c move ObjectStore mock into pkg/cloudprovider/mocks
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-09-06 10:53:58 -06:00
Steve Kriss
f0edf7335f add a BackupStore to pkg/persistence that supports prefixes
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-09-06 10:53:58 -06:00
Steve Kriss
af64069d65 create pkg/persistence and move relevant code from pkg/cloudprovider into it
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-09-06 09:05:40 -06:00
Steve Kriss
29d75d72e2 move object and block store interfaces to their own files
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-09-06 09:05:40 -06:00
Steve Kriss
bc516112da Merge pull request #815 from waynz0r/schedule-backup-labels
Set schedule labels to subsequent backups
2018-09-06 07:47:24 -07:00
Zsolt Varga
211aa7b7fd Set schedule labels to subsequent backups
Signed-off-by: Zsolt Varga <zsolt.varga@console.hu>
2018-09-06 10:06:18 +02:00
Nolan Brubaker
5ccc27aaed Merge pull request #795 from wwitzel3/hooks-with-pv
Update Pre/Post hooks example.
2018-09-05 16:46:24 -04:00
Steve Kriss
d34994cb5f set azure restic env vars based on default backup location's config
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-09-05 14:31:42 -06:00
Steve Kriss
ae373bdbfb Merge pull request #818 from nrb/v0.9.4-changelog-master
Update CHANGELOG for v0.9.4
2018-09-05 09:20:56 -07:00
Nolan Brubaker
889f0af5b8 Update CHANGELOG for v0.9.4
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-09-05 12:13:15 -04:00
Wayne Witzel III
a8c42ab245 fix GH md link
Signed-off-by: Wayne Witzel III <wayne@riotousliving.com>
2018-08-29 16:15:35 -04:00
Steve Kriss
283a1349bd Merge pull request #792 from nrb/pflag-update
Update pflag version
2018-08-28 14:08:32 -07:00
Nolan Brubaker
a50367f148 Regenerate CLI docs
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-08-28 16:57:52 -04:00
Nolan Brubaker
7bc27bbbfd Pin cobra version
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-08-28 16:56:00 -04:00
Nolan Brubaker
e94277ac4d Update pflag version
Fixes #767

Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-08-28 16:54:02 -04:00
Steve Kriss
7aadc39cd6 Merge pull request #799 from heptio/backup-locations
Replace config.backupStorageProvider with backup storage locations
2018-08-28 13:42:41 -07:00
Steve Kriss
df69b274a0 azure: update documentation and examples
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-28 13:19:21 -07:00
Steve Kriss
cb321db21f azure: refactor to not use helpers/ pkg, validate all env/config inputs
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-28 13:19:21 -07:00
Steve Kriss
9d7ea7483c azure: support different RGs/storage accounts per backup location
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-28 13:19:21 -07:00
Steve Kriss
cd4e9f5336 azure: fix for breaking change in blob.GetSASURI
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-28 13:19:21 -07:00
Steve Kriss
a440029c2f bump Azure SDK version and include storage mgmt package
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-28 13:19:21 -07:00
Steve Kriss
b31e25bf6e server: remove unused code, replace deprecated func
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-28 13:19:21 -07:00
Steve Kriss
729d733986 controllers: take a newPluginManager func in constructors
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-28 13:19:21 -07:00
Nolan Brubaker
6445dbf1c7 Update examples and docs for backup locations
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-08-28 13:19:21 -07:00
Steve Kriss
133dc185ca backup sync: process the default location first
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-28 13:19:21 -07:00
Steve Kriss
7a1e6d16cc generic controller: allow controllers with only a resync func
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-28 13:19:21 -07:00
Steve Kriss
6f7bfe545d remove Config CRD's BackupStorageProvider & other obsolete code
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-28 13:19:21 -07:00
Steve Kriss
bd4d97b9e4 move server's defaultBackupLocation into config struct
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-28 13:19:21 -07:00
Steve Kriss
0e94fa37f9 update sync controller for backup locations
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-28 13:19:21 -07:00
Carlisia
2750aa71b9 Use backup storage location during restore
Closes #740

Signed-off-by: Carlisia <carlisia@grokkingtech.io>
2018-08-28 13:19:21 -07:00
Steve Kriss
20f89fbcef use the default backup storage location for restic
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-28 13:19:21 -07:00
Nolan Brubaker
833a6307a9 Add storage location to backup get/describe
Fixes #775

Also conforms ark imports to https://github.com/heptio/ark/issues/494

Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-08-28 13:19:21 -07:00
Steve Kriss
cf7c8587f0 download request: fix setting of log level for plugin manager
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-28 13:19:21 -07:00
Steve Kriss
3234124afe backup deletion: fix setting of log level in plugin manager
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-28 13:19:20 -07:00
Steve Kriss
74043ab428 download request controller: fix bug in determining expiration
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-28 13:19:20 -07:00
Steve Kriss
7007f198e1 refactor download request controller test and add test cases
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-28 13:19:20 -07:00
Steve Kriss
8f5346150c download request controller: use backup location for object store
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-28 13:19:20 -07:00
Steve Kriss
bab08ed1a6 backup deletion controller: use backup location for object store
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-28 13:19:20 -07:00
Nolan Brubaker
c6f488f75f Use backup location in the backup controller
Fixes #739

Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-08-28 13:19:20 -07:00
Steve Kriss
06b5af449f add create and get CLI commands for backup locations
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-28 13:19:19 -07:00
Steve Kriss
adbcd3703b add --default-backup-storage-location flag to server cmd
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-28 13:14:51 -07:00
Nolan Brubaker
2a34772ed5 Add --storage-location argument to create commands
Closes #738

Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-08-28 13:14:51 -07:00
Nolan Brubaker
56f1617049 Correct metadata for BackupStorageLocationList
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-08-28 13:14:51 -07:00
Nolan Brubaker
345c3c39b1 Generate clients for BackupStorageLocation
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-08-28 13:14:51 -07:00
Nolan Brubaker
a25eb03290 Add BackupStorageLocation API type
This commit only provides the data model for further work. It does not
implement any logic around locations, nor does it remove anything from
the Config API type.

Closes #736
Closes #732

Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-08-28 13:14:51 -07:00
Wayne Witzel III
575c4ddc6d apply annotations on single line, no restore mode
Signed-off-by: Wayne Witzel III <wayne@riotousliving.com>
2018-08-27 15:07:49 -04:00
Wayne Witzel III
030ea6c0ad minor word updates and command wrapping
Signed-off-by: Wayne Witzel III <wayne@riotousliving.com>
2018-08-27 14:00:20 -04:00
Wayne Witzel III
d32f8dbb6c Update hooks/fsfreeze example
Signed-off-by: Wayne Witzel III <wayne@riotousliving.com>
2018-08-27 09:58:24 -04:00
Nolan Brubaker
adc29a2db0 Merge pull request #774 from metadave/dp_report_bug
add an ark bug command
2018-08-24 16:17:21 -04:00
Dave Parfitt
342a1c6437 add an ark bug command
Signed-off-by: Dave Parfitt <diparfitt@gmail.com>
2018-08-24 13:10:56 -04:00
Steve Kriss
8a5d6f9111 Merge pull request #781 from nrb/fix-777
Fix map merging logic
2018-08-22 11:29:02 -07:00
Steve Kriss
79c45133f7 Merge pull request #783 from nrb/add-do
Add DigitalOcean to S3-compatible backup providers
2018-08-22 09:32:55 -07:00
Nolan Brubaker
9c11ba900c Add DigitalOcean to S3-compatible backup providers
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-08-22 12:20:04 -04:00
Nolan Brubaker
ea50ebf2b5 Fix map merging logic
Fixes #777

Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-08-21 15:30:30 -04:00
Steve Kriss
ec61bc8654 Merge pull request #723 from nrb/support-matrix
Document supported object and volume providers
2018-08-17 12:44:52 -07:00
Nolan Brubaker
7edbb91cfa Document supported object and volume providers
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-08-17 15:35:09 -04:00
Carlisia
d29c96387e Merge pull request #757 from carlisia/c-538-config-m
Switch Config CRD elements to server flags
2018-08-16 09:02:48 -07:00
Carlisia
9508e4a20e Switch Config CRD elements to server flags
Signed-off-by: Carlisia <carlisia@grokkingtech.io>
2018-08-16 08:51:46 -07:00
Steve Kriss
7200a89e39 Merge pull request #759 from nrb/0.9.3-changelog
Add v0.9.3 changelog entry
2018-08-10 08:47:43 -07:00
Nolan Brubaker
33ee4a8721 Add v0.9.3 changelog entry
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-08-10 10:56:00 -04:00
Carlisia
23d570ec04 Merge pull request #711 from skriss/make-local
Bring back 'make local'
2018-08-09 12:26:53 -07:00
Nolan Brubaker
65cd5c602f Merge pull request #754 from skriss/namespace-restore-label
update how we label restored objects
2018-08-09 15:17:50 -04:00
Steve Kriss
95b2b90006 add backup name label to restored objects
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-08 16:51:33 -07:00
Steve Kriss
0c3ac67b6d start using a namespaced label on restored objects, deprecate old label
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-08 16:34:39 -07:00
Andy Goldstein
6e53aa0350 Bring back 'make local'
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-08 15:55:46 -07:00
Nolan Brubaker
17d984d4b4 Merge pull request #745 from skriss/bulk-deletion
add bulk deletion support to ark backup delete
2018-08-08 14:40:51 -04:00
Steve Kriss
5acccaa739 add bulk deletion support to ark backup delete
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-08 10:28:40 -07:00
Steve Kriss
1f7a4a1665 Merge pull request #712 from timoreimann/preserve-node-ports-when-specified-in-annotation
Preserve node ports during restore when annotations hold specification.
2018-08-07 09:17:27 -07:00
Timo Reimann
3aa241a74c Preserve node ports during restore when annotations hold specification.
This is to better reflect the intent of the user when node ports are
specified explicitly (as opposed to being assigned by Kubernetes). The
`last-applied-configuration` annotation added by `kubectl apply` is one
such indicator we are now leveraging.

We still default to omitting the node ports when the annotation is
missing.

Signed-off-by: Timo Reimann <ttr314@googlemail.com>
2018-08-07 07:47:17 +02:00
Steve Kriss
27003af62a Merge pull request #304 from ncdc/wait
Add --wait support to ark backup create
2018-08-03 10:57:20 -07:00
Andy Goldstein
c5f5862c9c Add --wait support to ark backup create
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-08-03 10:42:42 -07:00
Steve Kriss
c6ef76d2b3 Merge pull request #719 from nrb/prereq-faq
Document CRD not found errors
2018-08-02 16:03:09 -07:00
Steve Kriss
8ac285cf52 Merge pull request #718 from carlisia/delete-unused-II
Extend doc about synchronization
2018-08-02 16:01:20 -07:00
Nolan Brubaker
eb6f742b5d Document CRD not found errors
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-08-02 16:41:28 -04:00
Carlisia
fb4d507c8a Extend doc about synchronization
Signed-off-by: Carlisia <carlisia@grokkingtech.io>
2018-08-02 13:35:20 -07:00
Nolan Brubaker
de553a2fc1 Merge pull request #716 from carlisia/c-wait-restore
Add --wait support to `ark restore create`
2018-08-02 15:37:55 -04:00
Carlisia
e7bb592602 Add --wait support to ark restore create
Signed-off-by: Carlisia <carlisia@grokkingtech.io>
2018-07-31 17:20:03 -07:00
Carlisia
6f061db9a2 Merge pull request #715 from skriss/remove-snapshot-service
remove SnapshotService, replace with direct BlockStore usage
2018-07-31 13:50:22 -07:00
Steve Kriss
2e875521eb Merge pull request #708 from carlisia/c-705-keep-in-progress
Only delete unused backup if they are complete
2018-07-31 09:18:47 -07:00
Carlisia
8ce513acbd Only delete unused backup if they are complete
Fixes #705

Signed-off-by: Carlisia <carlisia@grokkingtech.io>
2018-07-31 09:12:12 -07:00
Steve Kriss
1c26fbde32 remove SnapshotService, replace with direct BlockStore usage
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-31 08:58:11 -07:00
Nolan Brubaker
430ec2451a Merge pull request #710 from skriss/resumable-plugins-rebased
Resumable plugins rebased
2018-07-31 11:57:11 -04:00
Andy Goldstein
130512187a Refactor plugin management
Refactor plugin management:
- support multiple plugins per executable
- support restarting a plugin process in the event it terminates
- simplify plugin lifecycle management by using separate managers for
  each scope (server vs backup vs restore)

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-07-31 08:34:57 -07:00
Steve Kriss
131afb571e Merge pull request #607 from nrb/restore-metrics
Restore metrics
2018-07-27 12:25:56 -07:00
Nolan Brubaker
74dbf38793 Add restore failed phase and metrics
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-07-27 14:32:11 -04:00
Nolan Brubaker
652069b5e6 Merge pull request #709 from skriss/bump-testify
update testify to latest released version
2018-07-26 20:14:03 -04:00
Steve Kriss
8789ae5cb1 update testify to latest released version
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-26 16:24:30 -07:00
Steve Kriss
10c98caade Merge pull request #701 from nrb/restore-doc
Add schedule command info to quickstart
2018-07-26 14:58:21 -07:00
Nolan Brubaker
fe9d61a9a7 Add schedule command info to quickstart
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
Co-authord-by: Giancarlo Rubio <gianrubio@gmail.com>
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-07-26 17:51:52 -04:00
Nolan Brubaker
0d2efaf991 Merge pull request #706 from skriss/v0.9.2-changelog
update changelog for v0.9.2
2018-07-26 17:05:52 -04:00
Steve Kriss
7e2bec46b8 update changelog for v0.9.2
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-26 13:59:27 -07:00
Carlisia
4f3c890e82 Merge pull request #704 from skriss/fix-backupitem-action-calls
fix bug preventing backup item action item updates from saving
2018-07-26 11:26:03 -07:00
Steve Kriss
ca5656c279 fix bug preventing backup item action item updates from saving
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-26 10:38:17 -07:00
Nolan Brubaker
82f1cd87dc Merge pull request #680 from carlisia/c-delete-from-etcd
Delete backups from etcd if they're not in storage
2018-07-25 18:25:52 -04:00
Carlisia
d2e629f5a8 Delete backups from etcd if they're not in storage
This fixes #309.

Signed-off-by: Carlisia <carlisia@grokkingtech.io>

Co-authored-by: Steve Kriss <steve@heptio.com>
2018-07-25 14:53:50 -07:00
Nolan Brubaker
7cebfe2df0 Add restore attempt and success/failure counters
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-07-25 11:22:43 -04:00
Steve Kriss
39c03008be Merge pull request #700 from heptio/zenhub-fix
Fix ZenHub link on Readme.md
2018-07-25 06:12:23 -07:00
Ross Kukulinski
625ba48117 Fix ZenHub link on Readme.md
Signed-off-by: Ross Kukulinski <ross@kukulinski.com>
2018-07-24 23:28:24 -04:00
Jorge O. Castro
d177d94945 Merge pull request #696 from heptio/zenhub
Add contributor docs for our ZenHub usage
2018-07-24 18:34:25 -07:00
Carlisia
3b4276a0e4 Merge pull request #699 from thesandlord/master
Simplify GCP instructions
2018-07-24 15:40:39 -07:00
Sandeep Dinesh
dcae6eb0a2 Update gcp-config.md
Automated setting environment variables using gcloud commands instead of copy/paste

Signed-off-by: Sandeep Dinesh <sandeepdinesh@google.com>
2018-07-24 15:00:06 -07:00
Steve Kriss
daa61c5f71 Merge pull request #697 from metadave/dp_check_s3_url
check s3URL scheme upon AWS ObjectStore Init()
2018-07-24 11:06:55 -07:00
Dave Parfitt
06d6665abb check s3URL scheme upon AWS ObjectStore Init()
Signed-off-by: Dave Parfitt <diparfitt@gmail.com>
2018-07-24 14:01:05 -04:00
Ross Kukulinski
cc359f6ecb Add contributor docs for our ZenHub usage
Signed-off-by: Ross Kukulinski <ross@kukulinski.com>
2018-07-23 16:18:32 -04:00
Nolan Brubaker
b0af81e780 Merge pull request #689 from lemaral/init-schedule-metrics
Init schedule Prometheus metrics
2018-07-23 16:16:26 -04:00
Carlisia
08e7c54cb6 Merge pull request #693 from skriss/v0.9.1-changelog
update CHANGELOG.md for v0.9.1
2018-07-23 13:04:20 -07:00
Nolan Brubaker
4aea49dbc6 Merge pull request #694 from skriss/fix-backup-log
cleanup service account action log statement
2018-07-23 15:58:58 -04:00
Steve Kriss
f62045623c cleanup service account action log statement
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-23 12:10:30 -07:00
Steve Kriss
74d59498d7 update CHANGELOG.md for v0.9.1
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-23 12:06:05 -07:00
Steve Kriss
e063b7983a Merge pull request #682 from nrb/support-rbac-1.7
Support for rbac v1beta1 on kubernetes v1.7.5+
2018-07-23 12:00:50 -07:00
Nolan Brubaker
dd1e150511 Add RBAC support for 1.7 clusters
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-07-23 14:19:03 -04:00
Carlisia
c47a364ab3 Merge pull request #687 from skriss/fix-delete-issues
fix delete issues
2018-07-23 10:40:14 -07:00
Alex Lemaresquier
450fa72fbb Initialize schedule Prometheus metrics to have them created beforehand (see https://prometheus.io/docs/practices/instrumentation/#avoid-missing-metrics)
Signed-off-by: Alex Lemaresquier <alex+github@lemaresquier.org>
2018-07-20 23:30:24 +02:00
Steve Kriss
cbcb9c7d79 Merge pull request #692 from metadave/dp_clarify_aws_bucket_docs
Clarify that object storage should per-cluster
2018-07-20 13:35:32 -07:00
Dave Parfitt
39c4267ace Clarify that object storage should per-cluster
Signed-off-by: Dave Parfitt <diparfitt@gmail.com>
2018-07-20 16:22:16 -04:00
Nolan Brubaker
64f0d6dffd Merge pull request #690 from skriss/fix-tag-latest
fix tagging latest by using make's ifeq
2018-07-20 15:04:49 -04:00
Steve Kriss
78cbdf95f3 delete old deletion requests for backup when processing a new one
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-20 11:42:42 -07:00
Steve Kriss
85a61b8e8d return nil error if 404 encountered when deleting snapshots
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-20 11:42:34 -07:00
Steve Kriss
a2a7dbda09 fix tagging latest by using make's ifeq
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-20 11:36:09 -07:00
Nolan Brubaker
7a964ae2ca Merge pull request #683 from skriss/fail-fast-if-missing-crds
exit server if not all Ark CRDs exist at startup
2018-07-19 16:50:34 -04:00
Steve Kriss
1df9a8a38d exit server if not all Ark CRDs exist at startup
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-18 14:30:42 -07:00
Nolan Brubaker
e11634bfbc Merge pull request #676 from skriss/dont-create-namespace
require namespace for backups/etc. to exist at server startup
2018-07-17 14:26:04 -04:00
Steve Kriss
5329a4d67d Merge pull request #677 from nrb/issue-template-commands
Add commands for context to the bug template
2018-07-17 09:03:19 -07:00
Steve Kriss
13f893f1f9 Merge pull request #634 from marpaia/k8s-1.11
Update Kubernetes and Client-Go for 1.11.0 / 8.0.0
2018-07-17 08:55:47 -07:00
Nolan Brubaker
b4a52e45cf Add commands for context to the bug template
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-07-17 10:48:59 -04:00
Steve Kriss
f5d975b06d Merge pull request #678 from nrb/basic-troubleshooting
Add some basic troubleshooting commands
2018-07-16 20:18:36 -07:00
Mike Arpaia
3efe677007 Update Ark library code to work with Kubernetes 1.11
Signed-off-by: Mike Arpaia <mike@arpaia.co>
2018-07-16 20:46:20 -06:00
Nolan Brubaker
7e8c8c69b9 Add some basic troubleshooting commands
These commands are intended to be general, and give users some context
for where they can look to get more information about Ark's behaviors.

Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-07-13 17:34:39 -04:00
Steve Kriss
d195512062 require namespace for backups/etc. to exist at server startup
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-13 13:50:12 -07:00
Nolan Brubaker
1e2b141e5d Merge pull request #443 from skriss/restore-from-schedule
Add --from-schedule flag to `ark restore create`
2018-07-11 13:50:08 -04:00
Steve Kriss
683f7afc0d switch to using .status.startTimestamp for sorting backups
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-11 10:35:55 -07:00
Steve Kriss
4e74e77738 Merge pull request #667 from nrb/keep-completiontimestamp
Record backup completion time before uploading
2018-07-11 10:29:51 -07:00
Nolan Brubaker
b71a37dbfc Record backup completion time before uploading
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-07-11 13:21:29 -04:00
Steve Kriss
9ca76226e2 Merge pull request #670 from nrb/issue-templates
Add example ark version command to issue templates
2018-07-11 09:27:28 -07:00
Nolan Brubaker
217084cdcc Add example ark version command to issue templates
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-07-11 11:02:55 -04:00
Nolan Brubaker
f4f602cdf9 Merge pull request #647 from jhamilton1/jhamilton1-new-templates
New templates
2018-07-11 10:57:16 -04:00
Carlisia
29b0774022 Merge pull request #661 from carlisia/docs/run-locally
Document how to run the Ark server locally
2018-07-10 16:43:11 -07:00
Carlisia Pinto
040788bb06 Add minor improvements and aws example<Plug>delimitMateCR
Signed-off-by: Carlisia Pinto <carlisia@grokkingtech.io>
2018-07-10 15:02:01 -07:00
Nolan Brubaker
09afeb6d3e Merge pull request #646 from skriss/remove-redundant-filesystem
replace pkg/restore's osFileSystem with pkg/util/filesystem's
2018-07-10 17:57:39 -04:00
Nolan Brubaker
fae00a7622 Merge pull request #659 from carlisia/cc-backupsync
Skip backup sync if it already exists on Kubernetes
2018-07-10 12:50:20 -04:00
Carlisia Pinto
5b89f7b6db Skip backup sync if it already exists in k8s
Signed-off-by: Carlisia Pinto <carlisia@grokkingtech.io>
2018-07-09 21:55:24 -07:00
Steve Kriss
c6050845a0 restore controller: switch to 'c' for receiver name
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-09 15:07:38 -07:00
Steve Kriss
706ae07d0d enable a schedule to be provided as the source for a restore
- ScheduleName is added as an API field to the Restore object
- Restore controller validates that exactly one of BackupName
  or ScheduleName has been provided
- If ScheduleName is provided, Restore controller populates
  BackupName with the name of the most recent successful backup
  created from the schedule
- --from-schedule flag is added to `ark restore create` CLI cmd

Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-09 15:07:38 -07:00
Nolan Brubaker
f349f85b05 Merge pull request #658 from Bradamant3/update-slack
fix up Slack link in troubleshooting on master branch
2018-07-09 17:22:00 -04:00
JENNIFER RONDEAU
aea68414cf fix up Slack link in troubleshooting on master branch
Signed-off-by: JENNIFER RONDEAU <jrondeau@heptio.com>
2018-07-09 12:58:29 -04:00
Andy Goldstein
bb8e2e9131 Document how to run the Ark server locally
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-07-06 16:04:14 -07:00
Steve Kriss
1a71437d59 Merge pull request #655 from nrb/remove-ns-debugging-docs
Remove outdated namespace deletion content
2018-07-06 14:43:54 -07:00
Nolan Brubaker
dc84e591bb Remove outdated namespace deletion content
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-07-06 17:29:02 -04:00
Nolan Brubaker
c66a139ff9 Merge pull request #650 from Bradamant3/fix-doc-paths
fix paths
2018-07-06 12:32:10 -04:00
Nolan Brubaker
9c41e3fabb Merge pull request #649 from skriss/fix-tag-latest
use posix-compliant conditional for checking TAG_LATEST
2018-07-06 12:31:38 -04:00
JENNIFER RONDEAU
23abbc9a47 fix paths
Signed-off-by: JENNIFER RONDEAU <jrondeau@heptio.com>
2018-07-06 12:27:49 -04:00
Steve Kriss
f042653886 use posix-compliant conditional for checking TAG_LATEST
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-06 09:23:16 -07:00
Andy Goldstein
efae9792db Merge pull request #642 from skriss/v0.9.0-changelog
update changelog for v0.9.0, v0.8.2, v0.8.3
2018-07-06 11:52:20 -04:00
Andy Goldstein
8327536b59 Merge pull request #643 from skriss/restic-docs-updates-v0.9.0
update restic docs for v0.9.0 GA release
2018-07-06 11:48:28 -04:00
Steve Kriss
a2c1fece33 update restic docs for v0.9.0 GA release
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-06 08:28:11 -07:00
Steve Kriss
8e7a2eed77 update changelog for v0.9.0, v0.8.2, v0.8.3
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-06 08:25:13 -07:00
Andy Goldstein
562a719382 Merge pull request #639 from Bradamant3/docs-reorg
Docs reorg
2018-07-06 11:18:41 -04:00
JENNIFER RONDEAU
cfdcd65f41 reorganize and edit docs for upcoming release
Signed-off-by: JENNIFER RONDEAU <jrondeau@heptio.com>
2018-07-06 10:53:01 -04:00
Jesse
cf336d8019 Added new templates
Signed-off-by: Jesse <jesse.hamilton@heptio.com>
2018-07-06 07:31:13 -05:00
Steve Kriss
795dc26214 replace pkg/restore's osFileSystem with pkg/util/filesystem's
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-05 15:46:17 -07:00
Andy Goldstein
2999f158db Merge pull request #550 from skriss/restic-describers
Add pod volume backups/restores to ark backup/restore describe
2018-07-05 16:27:36 -04:00
Steve Kriss
1e08e81537 Merge pull request #645 from ncdc/fix-restic-test
Fix flakey restic tests
2018-07-05 13:27:22 -07:00
Andy Goldstein
8dd9cded1a Fix testing arbitrary map key order
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-07-05 16:22:46 -04:00
Steve Kriss
42f2891485 add pod volume backups/restores to ark backup/restore describe output
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-05 13:13:40 -07:00
Andy Goldstein
9db5e36b54 Fix test sorting function
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-07-05 16:08:05 -04:00
Andy Goldstein
a70456f5ee Merge pull request #628 from skriss/restic-units
pkg/restic unit tests
2018-07-05 15:01:04 -04:00
JENNIFER RONDEAU
3646fcce46 add docs site build to gitignore
Signed-off-by: JENNIFER RONDEAU <jrondeau@heptio.com>
2018-07-05 14:57:15 -04:00
Steve Kriss
c18decc89b pkg/restic unit tests
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-05 11:44:17 -07:00
Andy Goldstein
5ce92adff0 Merge pull request #636 from skriss/restic-set-hostname
set --hostname flag for restic backups
2018-07-03 16:49:15 -04:00
Steve Kriss
547625c333 set --hostname flag for restic backups
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-02 10:52:32 -07:00
Mike Arpaia
eabef08561 Update generated Ark code based on the 1.11 k8s.io/code-generator script
Signed-off-by: Mike Arpaia <mike@arpaia.co>
2018-07-02 09:24:19 -06:00
Mike Arpaia
f5eac0b434 Update vendored library code for Kubernetes 1.11
Signed-off-by: Mike Arpaia <mike@arpaia.co>
2018-07-02 09:24:19 -06:00
Steve Kriss
32907931e1 Merge pull request #633 from hamidzr/master
fixed minor typos
2018-06-29 14:28:56 -07:00
Hamid Zare
244994d316 fixed typos/capitalization
Signed-off-by: Hamid Zare <dellydela@gmail.com>
2018-06-29 16:23:33 -05:00
Nolan Brubaker
39bb3963ee Merge pull request #631 from skriss/restic-refactor-get-snapshot-id
use pkg/util/exec for running get snapshot id cmd
2018-06-29 17:03:46 -04:00
Steve Kriss
ae4aad0890 use pkg/util/exec for running get snapshot id cmd
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-06-29 12:06:31 -07:00
Andy Goldstein
1857257265 Merge pull request #621 from skriss/update-restic-docs
update restic doc
2018-06-29 14:04:22 -04:00
Andy Goldstein
eb19228d16 Merge pull request #626 from ncdc/add-backups-restores-to-non-restorable-resources
Don't restore backups or restores
2018-06-29 09:53:19 -04:00
Steve Kriss
afc9e9cde1 update restic documentation
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-06-28 15:35:12 -07:00
Andy Goldstein
fe286ff564 Don't restore backups or restores
Add backups and restores the list of non restorable resources. Backups,
if applicable, are synced from object storage by the backup sync
controller. Restores are specific to a cluster and don't have value
moving across clusters.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-06-28 16:58:09 -04:00
Andy Goldstein
1cc99ffa60 Merge pull request #625 from skriss/faq-bucket-per-cluster
add FAQ about using a bucket per cluster
2018-06-28 16:53:02 -04:00
Steve Kriss
31b8ff92df add FAQ about using a bucket per cluster
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-06-28 13:40:02 -07:00
Andy Goldstein
eaeb9d677e Merge pull request #608 from skriss/no-pv-snapshot-if-restic-backup
don't snapshot volumes that have been backed up with restic
2018-06-28 13:27:30 -04:00
Steve Kriss
11c176c490 don't snapshot volumes that have been backed up with restic
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-06-28 10:19:34 -07:00
Andy Goldstein
539de6d361 Merge pull request #564 from nrb/backup-timing
Record backup start and completion times, add timing metrics
2018-06-28 11:37:39 -04:00
Nolan Brubaker
96b72acb2d Record backup start and completion times
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-06-28 11:18:14 -04:00
Andy Goldstein
fa470170cf Merge pull request #610 from skriss/restic-skip-invalid-volumes
log and skip backups for non-existent & hostPath volumes
2018-06-28 10:49:33 -04:00
Nolan Brubaker
75a9879774 Merge pull request #620 from ncdc/gitignore
Ignore more files
2018-06-28 10:44:45 -04:00
Nolan Brubaker
a5722262d1 Merge pull request #619 from ncdc/skip-mirror-pods
Stop restoring mirror pods
2018-06-28 10:43:44 -04:00
Andy Goldstein
dd7bdf05f3 Ignore more files
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-06-28 10:11:23 -04:00
Andy Goldstein
255a991c6e Stop restoring mirror pods
Mirror pods are pods created from static manifest files on a node.
They're mirrored to the apiserver so they're visible when querying the
apiserver for a list of pods, but it's not possible to send a pod
containing the mirror pod annotation to the apiserver and have it be
created successfully. Instead of trying to do this, log a message that
we're skipping restoring the pod because it's a mirror pod.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-06-28 10:06:55 -04:00
Steve Kriss
781b7cd1aa log and skip backups for non-existent & hostPath volumes
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-06-27 14:37:36 -07:00
Andy Goldstein
51298f84cc Merge pull request #606 from skriss/restic-auto-manage-repos
Automatically manage restic repos
2018-06-27 17:01:27 -04:00
Steve Kriss
22e8f23e2c replace ark restic repo init cmd with automatic initialization of repos
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-06-27 13:50:37 -07:00
Andy Goldstein
e015238e6d Merge pull request #570 from skriss/restic-controller-improvements
Restic controller improvements
2018-06-27 16:44:00 -04:00
Steve Kriss
a697ad164e refine what gets enqueued in PVB/PVR controllers, and log better
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-06-27 13:31:11 -07:00
Nolan Brubaker
29ac0b4a6c Merge pull request #613 from ncdc/ignore-reclaim-policy-delete-pvs-without-snapshots
Skip reclaim policy Delete PVs without snapshots
2018-06-26 16:52:01 -04:00
Andy Goldstein
ee5afe148c Merge pull request #566 from runyontr/master
Minio should support read-only file systems
2018-06-26 13:43:02 -04:00
Andy Goldstein
7c283e5de8 Skip reclaim policy Delete PVs without snapshots
If a PV has a reclaim policy of Delete and we didn't create a snapshot
of it, don't restore the PV, as doing so would create a PV whose
underlying volume is incorrect.

Also "reset" any PVCs bound to the PV so they'll be dynamically
provisioned when restored.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-06-26 10:40:49 -04:00
Andy Goldstein
5e28f322cf Merge pull request #580 from nikhita/add-omitempty-tags
Add omitempty tags to optional API fields
2018-06-25 10:32:22 -04:00
Nikhita Raghunath
0da5f1ccca Add omitempty tag to optional API fields
Signed-off-by: Nikhita Raghunath <nikitaraghunath@gmail.com>
2018-06-25 16:40:43 +05:30
Nolan Brubaker
6426706390 Merge pull request #571 from skriss/restic-aws-region
restic: if S3, get bucket's region up-front
2018-06-22 16:59:32 -04:00
Andy Goldstein
636b09a548 Merge pull request #569 from skriss/fix-mount-propagation
restic: use HostToContainer mount propagation for host-pods volume
2018-06-22 06:23:30 -04:00
Steve Kriss
5ad21854f7 restic: if S3, get bucket's region up-front
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-06-21 17:20:53 -07:00
Steve Kriss
57c5485501 restic: use HostToContainer mount prop. for host-pods volume
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-06-21 16:32:44 -07:00
Thomas Runyon
e4856d17ca Merge branch 'master' of github.com:heptio/ark
Signed-off-by: Thomas Runyon <runyontr@gmail.com>
2018-06-21 16:50:49 -04:00
Thomas Runyon
fb0696d0c3 Deploy minio to suppport read only file systems
Signed-off-by: Thomas Runyon <runyontr@gmail.com>
2018-06-21 16:46:45 -04:00
Andy Goldstein
13344076c2 Merge pull request #563 from skriss/restic-cache-dir
add a /scratch emptyDir to ark pods to use for restic cache
2018-06-20 14:59:04 -04:00
Steve Kriss
25d3597c9a add a /scratch emptyDir to ark pods to use for restic cache
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-06-20 11:48:09 -07:00
Nolan Brubaker
4a7457ecfe Merge pull request #557 from skriss/move-repo-id-source
Use ResticRepository's resticIdentifier field as the source of truth for repo IDs
2018-06-20 13:50:21 -04:00
Steve Kriss
f2072e5868 use repo identifier from ResticRepo CR when backing up/restoring
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-06-20 10:42:53 -07:00
Andy Goldstein
8306566216 Merge pull request #532 from skriss/restic-repo-crd
add ResticRepository CRD and move repo-level actions to a controller
2018-06-20 13:42:32 -04:00
Steve Kriss
a927906e52 add --maintenance-frequency flag to ark restic repo init
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-06-20 09:21:43 -07:00
Steve Kriss
6e9e653f76 add restic repo getter and reorg restic cmds
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-06-20 09:21:43 -07:00
Steve Kriss
3481618324 move runCommand to pkg/util/exec and use in restic repo mgr
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-06-20 09:21:43 -07:00
Steve Kriss
65ed8da4b7 add ResticRepository CRD and move repo-level actions to a controller
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-06-20 09:21:43 -07:00
Andy Goldstein
f1e82a2fe3 Merge pull request #561 from skriss/enable-local-restic
move restic binary into /usr/bin so it's in PATH
2018-06-19 14:59:24 -04:00
Steve Kriss
de12ca4882 move restic binary into /usr/bin so it's in PATH
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-06-19 11:31:27 -07:00
Steve Kriss
01b5828ee7 Merge pull request #403 from nrb/merge-serviceaccount-secrets
Merge serviceaccounts on restore
2018-06-15 09:46:26 -07:00
Nolan Brubaker
e7d00cf5fd Add merge support for serviceaccounts
All properties from a backup will be merged into the ServiceAccount
except for the default token secret.

Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-06-15 12:40:59 -04:00
Steve Kriss
2dfa7a1a72 Merge pull request #553 from ncdc/log-to-stdout
Log to stdout instead of stderr
2018-06-15 08:58:08 -07:00
Andy Goldstein
845c9cfa61 Merge pull request #555 from skriss/simplify-restores
get rid of restore staging dir by backing up/restoring within volume dir
2018-06-14 17:15:35 -04:00
Steve Kriss
6fb11b8087 get rid of restore staging dir by backing up/restoring within volume dir
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-06-14 13:49:27 -07:00
Andy Goldstein
cc9140b3cc Log to stdout instead of stderr
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-06-14 14:02:12 -04:00
Andy Goldstein
7be81fe60e Merge pull request #546 from skriss/rm-old-donefiles
remove existing .ark dir and contents during restic restores
2018-06-14 11:12:31 -04:00
Andy Goldstein
bc20398119 Merge pull request #551 from ashish-amarnath/update-metrics-examples
Expose metrics server port from container
2018-06-14 07:36:46 -04:00
Ashish Amarnath
05e86ee734 expose container ports in example deployment and pkg/install tooling
Signed-off-by: Ashish Amarnath <ashish.amarnath@gmail.com>
2018-06-13 19:22:09 -07:00
Steve Kriss
dc273e3bed remove existing .ark dir and contents during restic restores
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-06-13 16:52:06 -07:00
Nolan Brubaker
11c3837f9b Merge pull request #548 from skriss/update-restic-docs
remove references to a specific ark version for using restic
2018-06-13 17:10:02 -04:00
Steve Kriss
5d7969f4b9 remove references to a specific ark version for using restic
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-06-13 14:04:55 -07:00
Andy Goldstein
9245e9d5dc Merge pull request #547 from skriss/restic-rsync
use rsync to copy restored data from staging dir to volume dir
2018-06-13 16:56:42 -04:00
Steve Kriss
f7a42f378f use rsync to copy restored data from staging dir to volume dir
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-06-13 13:41:55 -07:00
Andy Goldstein
d1e3688468 Merge pull request #531 from ashish-amarnath/add-backup-metrics
Add metrics package to publish metrics
2018-06-13 16:33:30 -04:00
Ashish Amarnath
83658e891e Add a metrics package to add and expose metrics
* add a metrics package to handle metric registration and publishing
* add a metricsAddress field to the server struct
* make metrics a part of the server
* start a metrics endpoint as part of starting the controllers
* instrument backup_controller to report metrics
* update cli-reference docs
* update example deployments with prometheus annotations
* update 'pkg/install' tooling with prometheus annotations

Signed-off-by: Ashish Amarnath <ashish.amarnath@gmail.com>
2018-06-13 13:17:08 -07:00
Andy Goldstein
3db7c038a5 Merge pull request #545 from skriss/update-restic-instructions
update restic setup instructions
2018-06-12 15:23:50 -04:00
Steve Kriss
6236085327 update restic setup instructions
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-06-12 11:59:53 -07:00
Andy Goldstein
6da32a4955 Merge pull request #544 from ae-v/master
fix typo and whitespace chars in docs
2018-06-12 09:34:26 -04:00
Andre Veelken
0e0ac10388 fix typo and whitespace chars in docs
Signed-off-by: Andre Veelken
2018-06-12 15:17:28 +02:00
Steve Kriss
bd0b874631 Merge pull request #542 from ncdc/makefile-tag-latest-bool
Add TAG_LATEST support to Makefile
2018-06-11 12:51:17 -07:00
Andy Goldstein
a522a96789 Add TAG_LATEST support to Makefile
Only tag an image as "latest" if TAG_LATEST is set to "true".

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-06-11 15:00:15 -04:00
Andy Goldstein
3177140db0 Merge pull request #541 from skriss/rename-init-container
rename restic-init-container to ark-restic-restore-helper
2018-06-11 13:57:14 -04:00
Steve Kriss
d7134b1df2 use Ark version as the tag for the restore-helper image in init container
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-06-11 10:46:10 -07:00
Steve Kriss
81520a9b86 rename restic-init-container to ark-restic-restore-helper
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-06-11 10:24:23 -07:00
Andy Goldstein
453b0a04f4 Merge pull request #540 from skriss/restic-v0.9.1
upgrade to restic v0.9.1
2018-06-11 13:16:17 -04:00
Andy Goldstein
459fe663ee Merge pull request #534 from skriss/rm-complete-restore-sh
replace complete-restore.sh with go code
2018-06-11 13:00:46 -04:00
Steve Kriss
50816ba23b upgrade to restic v0.9.1
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-06-11 09:59:29 -07:00
Steve Kriss
2c6fc5bd90 don't fail the restore if cleanup of the staging directory post-restore fails
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-06-11 09:48:26 -07:00
Steve Kriss
6897c2f901 move dotfiles from staging to volume dir on restore
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-06-11 09:31:03 -07:00
Steve Kriss
e354b1c130 replace complete-restore.sh with go code
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-06-11 09:31:03 -07:00
Andy Goldstein
e1cf244592 Merge pull request #537 from skriss/optimize-dockerfile
Dockerfile: move restic fetch before ark add so it can be cached
2018-06-11 12:28:26 -04:00
Andy Goldstein
d9924e0f3f Merge pull request #535 from skriss/rename-restic-daemonset
rename ark daemonset to ark restic server
2018-06-11 12:28:05 -04:00
Steve Kriss
c1f4e6d92d rename ark daemonset to ark restic server
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-06-11 09:12:49 -07:00
Steve Kriss
e7453ebc98 Dockerfile: move restic fetch before ark add so it can be cached
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-06-08 15:02:47 -07:00
Andy Goldstein
0396ca1dee Merge pull request #526 from yastij/ignore-resources-terminating
ignore terminating resources while doing a backup
2018-06-08 11:10:59 -04:00
Yassine TIJANI
17f6a14d37 ignore terminating resources while doing a backup
Signed-off-by: Yassine TIJANI <yasstij11@gmail.com>
2018-06-08 16:49:35 +02:00
Andy Goldstein
c0cf61912d Merge pull request #533 from skriss/fix-init-repo-key-data
ark restic init-repository: use key data if provided
2018-06-07 13:39:18 -04:00
Steve Kriss
67b40c7fc8 use fake filesystem to test key file flag for ark restic init-repo
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-06-07 10:29:59 -07:00
Steve Kriss
e2561f9073 ark restic init-repository: use key data if provided
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-06-07 10:06:15 -07:00
Andy Goldstein
e3d6902ede Merge pull request #530 from skriss/restic-quickstart-doc
restic quickstart doc for alpha testing
2018-06-06 15:33:43 -04:00
Steve Kriss
68020d0e4b restic quickstart doc for alpha testing
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-06-06 12:25:09 -07:00
Andy Goldstein
ed2d7b445c Merge pull request #508 from skriss/real-restic
restic integration with Ark
2018-06-06 13:24:56 -04:00
Steve Kriss
50d4084fac add restic integration for doing pod volume backups/restores
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-06-06 09:48:10 -07:00
Steve Kriss
c2c5b9040c add kube listers/informers to vendor/
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-06-04 14:52:35 -07:00
Wayne Witzel III
6f62749c1a Merge pull request #520 from ncdc/fix-backup-pv-action-when-volumeName-is-missing
BackupItemActionPlugin: handle nil updatedItem
2018-06-01 14:28:05 -04:00
Andy Goldstein
86b9cc6d15 BackupItemActionPlugin: handle nil updatedItem
Handle the case where a BackupItemAction may return nil for updatedItem,
meaning "no modifications to the item". The backupPVAction does this,
and we were panicking instead of accepting it.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-06-01 14:03:32 -04:00
Andy Goldstein
4e2a77d683 Merge pull request #518 from mattkelly/readme-selector-fix
Fix selector syntax in backup example
2018-05-29 10:10:34 -04:00
Matt Kelly
ca83f000ea Fix selector syntax in backup example
Signed-off-by: Matt Kelly <matt.kelly@containership.io>
2018-05-29 10:01:57 -04:00
Andy Goldstein
10d6dd006a Merge pull request #517 from c-knowles/bug/doc-default-resourcePriorities
Correct default restorePriorities docs
2018-05-26 08:47:00 -04:00
Chris Knowles
4065c0f194 Add limitRanges to default restorePriorities doc
Signed-off-by: Chris Knowles <c-knowles@users.noreply.github.com>
2018-05-26 20:23:23 +08:00
Chris Knowles
5643e8ebb5 Correct default restorePriorities
Changed in https://github.com/heptio/ark/pull/258

Signed-off-by: Chris Knowles <c-knowles@users.noreply.github.com>
2018-05-26 20:09:46 +08:00
Andy Goldstein
6dbde599bf Merge pull request #514 from carlpett/post-hooks-after-error
Run post-hooks even if backup actions fail
2018-05-23 13:37:28 -04:00
Calle Pettersson
b2ec87f05f Run post-hooks even if backup actions fail
Signed-off-by: Calle Pettersson <cpettsson@gmail.com>
2018-05-23 18:44:55 +02:00
Steve Kriss
fb33d93186 Merge pull request #512 from carlpett/additional-backup-error
Handle errors in additionalItemBackupper
2018-05-23 09:02:20 -07:00
Steve Kriss
170034787d Merge pull request #513 from ncdc/510-follow-ups
Fix copyright date, add happy path test case
2018-05-23 08:54:22 -07:00
Calle Pettersson
b92d086712 Add additional test
Signed-off-by: Calle Pettersson <cpettsson@gmail.com>
2018-05-23 17:28:51 +02:00
Andy Goldstein
18e2401e79 Merge pull request #455 from skriss/remove-aws-region
AWS: remove region requirement from config for backupStorageProvider
2018-05-23 11:02:57 -04:00
Andy Goldstein
849297e623 Fix copyright date, add happy path test case
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-05-23 09:59:32 -04:00
Andy Goldstein
92e9d307a5 Merge pull request #510 from nrb/failed-backup-upload-491
Fail backup if object store upload fails
2018-05-23 09:55:11 -04:00
Nolan Brubaker
09bbe072cd Check errors when closing GCP objects
Writing to GCP's object store is any async operation, so errors need to
be checked both on write and close calls, since errors like permission
violations aren't reported until a close.

Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-05-22 17:38:49 -04:00
Andy Goldstein
5ff582ec42 Merge pull request #501 from dhananjaysathe/downstream
Add documentation on how to use a selector negation
2018-05-22 17:24:42 -04:00
Steve Kriss
b029860b46 AWS: remove region requirement from config for backupStorageProvider
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-05-22 11:59:53 -07:00
Andy Goldstein
8ce2006814 Merge pull request #506 from marpaia/config-options
Add functional options for the Ark config install library
2018-05-22 14:19:45 -04:00
Calle Pettersson
24dfef6f15 Handle errors in additionalItemBackupper
Signed-off-by: Calle Pettersson <cpettsson@gmail.com>
2018-05-22 18:32:48 +02:00
Mike Arpaia
cb7bcea5c3 Add functional options for the Ark config install library
Signed-off-by: Mike Arpaia <mike@arpaia.co>
2018-05-22 09:21:12 -06:00
Andy Goldstein
aeb5f6d832 Merge pull request #437 from marpaia/install-api
Add library code to install required server components
2018-05-18 16:48:42 -04:00
Mike Arpaia
16f707aa11 Add library code to install required server components
This PR includes Go library code to assist with the installation of
required server-side components.

Signed-off-by: Mike Arpaia <mike@arpaia.co>
2018-05-18 14:43:06 -06:00
Andy Goldstein
2fde1f5fc1 Merge pull request #500 from nrb/fix-497
Exit when failing to update a backup's phase
2018-05-17 14:23:41 -04:00
Andy Goldstein
3a746a3f73 Merge pull request #496 from nrb/fix-477
Check restore Phase before downloading logs
2018-05-17 13:23:23 -04:00
Andy Goldstein
f288902e3e Merge pull request #490 from skriss/jsonpatch
Use JSON merge patches everywhere
2018-05-17 13:02:47 -04:00
Nolan Brubaker
7eac6675e8 Exit when failing to update a backup's phase
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-05-17 12:47:38 -04:00
Nolan Brubaker
f6761ddd00 Check restore Phase before downloading logs
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-05-17 12:20:55 -04:00
Dhananjay Sathe
e313d6200a Add documentation on how to use a selector negation
This will help users use the `--selector` flag to selectively exclude objects from being backed up by ark

workaround for #404 until dedicated flags are implemented

Signed-off-by: Dhananjay Sathe <dhanajaysathe@gmail.com>
2018-05-17 21:21:39 +05:30
Steve Kriss
5d74a92cf1 Merge pull request #484 from nrb/move-groupresources
Consolidate commonly used GroupResource objects
2018-05-15 14:02:29 -07:00
Nolan Brubaker
f936c55a37 Consolidate commonly used GroupResource objects
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-05-15 15:55:15 -04:00
Andy Goldstein
ad93135adb Merge pull request #483 from skriss/graceful-shutdown-on-sigs
shutdown gracefully on SIGINT/SIGTERM
2018-05-15 14:33:09 -04:00
Andy Goldstein
67263d2652 Merge pull request #486 from nrb/fix-475
Filter on resources that support get & delete
2018-05-15 10:58:56 -04:00
Nolan Brubaker
4fcd222777 Expand required resource verbs with get and delete
Some resources use GET for listing, which resulted in errors.

Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-05-15 10:55:03 -04:00
Steve Kriss
6d6f734bc9 use json merge patches
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-05-14 14:34:24 -07:00
Andy Goldstein
014c0e2c4c Merge pull request #485 from skriss/fix-cohab
use new cohabitatingResources map for each backup
2018-05-14 15:02:33 -04:00
Steve Kriss
1c950aa17b unit test to ensure new cohabitatingResources map for each backup
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-05-14 10:23:21 -07:00
Steve Kriss
ed7fbc9178 use new cohabitatingResources map for each backup
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-05-11 16:30:14 -07:00
Steve Kriss
20f56e9868 cleanup plugin subprocesses on server exit
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-05-11 09:48:46 -07:00
Andy Goldstein
5bfd4f64db Merge pull request #482 from skriss/add-cohab-resources
add replicasets and daemonsets to cohabitating resources
2018-05-11 10:02:10 -04:00
Steve Kriss
09c20b51e6 shutdown gracefully on SIGINT/SIGTERM
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-05-10 16:22:14 -07:00
Steve Kriss
fbb5ead4e9 add replicasets and daemonsets to cohabitating resources
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-05-10 14:15:01 -07:00
Andy Goldstein
9fc1711d45 Merge pull request #480 from skriss/fix-azure-setup
Azure: fix issues with setup instructions on macOS
2018-05-09 16:56:51 -04:00
Steve Kriss
c4d1e705d3 Azure: fix issues with setup instructions on macOS
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-05-09 12:56:19 -07:00
Andy Goldstein
43b1f9a19e Merge pull request #418 from skriss/refactor-patch-tests
use typed structs for decoding patch JSON in unit tests
2018-05-09 15:44:21 -04:00
Andy Goldstein
ea83ed32f5 Merge pull request #470 from skriss/backup-cluster-roles-and-bindings
backups: include clusterroles/bindings that reference serviceaccounts
2018-05-09 13:21:13 -04:00
Steve Kriss
041cfc2173 backups: include clusterroles/bindings that reference serviceaccounts
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-05-09 10:03:55 -07:00
Andy Goldstein
50a5550291 Merge pull request #478 from skriss/osx-build-perf-fix
when building on macOS, bind-mount volumes with delegated config
2018-05-09 10:36:14 -04:00
Andy Goldstein
ef5ac7fd05 Merge pull request #463 from nrb/fix-454
Don't restore completed pods or jobs
2018-05-09 09:59:34 -04:00
Andy Goldstein
3f3deda3d4 Merge pull request #479 from skriss/image-tagging-doc
add image-tagging policy doc
2018-05-09 09:15:38 -04:00
Steve Kriss
9e521aa757 add image-tagging policy doc
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-05-08 16:09:19 -07:00
Steve Kriss
a280e8cfd2 when building on macOS, bind-mount volumes with delegated config
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-05-07 16:00:03 -07:00
Andy Goldstein
c4bb6501ca Merge pull request #476 from skriss/dep-cleanup
Dep cleanup
2018-05-07 23:33:06 +02:00
Steve Kriss
9affb3c92a clean up/organize Gopkg.toml
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-05-07 10:02:59 -07:00
Steve Kriss
e81de2491f remove duplicate github.com/satori/go.uuid dependency
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-05-07 10:02:59 -07:00
Steve Kriss
51928e9177 use typed structs for decoding patch JSON in unit tests
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-05-07 09:22:20 -07:00
Andy Goldstein
5d8d221157 Merge pull request #472 from skriss/sync-ns-bug
when syncing backups, set their namespace to current cluster's Ark ns
2018-05-07 18:16:47 +02:00
Steve Kriss
6754955bcd when syncing backups, set their namespace to current cluster's Ark ns
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-05-07 09:12:51 -07:00
Andy Goldstein
fbda82ed63 Merge pull request #456 from skriss/go-1.10
upgrade to go 1.10 / alpine 3.7
2018-05-07 17:32:07 +02:00
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
Jennifer Rondeau
96b0808e3a Merge pull request #460 from skriss/debugging-docs
add installation troubleshooting doc with common issues
2018-04-27 09:26:56 -04:00
Andy Goldstein
e6624506cf Merge pull request #465 from castrojo/update-slack
Add a direct link to the slack channel
2018-04-26 15:16:10 -04:00
Jorge O. Castro
6d46b5f1eb Add a direct link to the slack channel
Signed-off-by: Jorge O. Castro <jorge.castro@gmail.com>
2018-04-26 15:00:14 -04:00
Steve Kriss
193fdb7026 add installation troubleshooting doc with common issues
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-04-25 11:22:55 -07:00
Andy Goldstein
b6316aff70 Merge pull request #458 from gianrubio/review-docs
Fix invalid file
2018-04-25 07:13:50 -04:00
Giancarlo Rubio
1f7d5c18f2 Fix invalid file
Signed-off-by: Giancarlo Rubio <gianrubio@gmail.com>
2018-04-25 13:07:40 +02:00
Steve Kriss
fd1c8294ce use the go 1.10 build cache
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-04-24 13:12:54 -07:00
Steve Kriss
2889db72ac update to go 1.10 & alpine 3.7
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-04-24 13:12:54 -07:00
Andy Goldstein
18d6b233da Merge pull request #453 from nrb/fix-444
Make empty excludes string more accurate
2018-04-24 14:53:33 -04:00
Andy Goldstein
c8989231eb Merge pull request #417 from skriss/upgrade-k8s-deps
Upgrade apimachinery, client-go, api, kubernetes dependencies
2018-04-24 14:53:11 -04:00
Nolan Brubaker
05cb059b1a Make empty excludes string more accurate
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-04-24 14:34:56 -04:00
Andy Goldstein
ff6e9dd2f3 Merge pull request #452 from mattmoyer/update-build-image
Switch to upstream Go build images.
2018-04-24 11:07:28 -04:00
Matt Moyer
deae0e6ae1 Switch to upstream Go build images.
These internal `gcr.io/heptio-images/golang` images are deprecated. It looks like `git` and `bash` are the only things the Ark build needed that aren't in the upstream `golang:1.9-alpine3.6` image.

Signed-off-by: Matt Moyer <moyer@heptio.com>
2018-04-24 09:53:23 -05:00
Steve Kriss
3dc093c24a regenerate code with updated generator
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-04-20 12:59:22 -07:00
Steve Kriss
c7b52bf1fe upgrade build image to v1.10 dependencies
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-04-20 12:59:22 -07:00
Steve Kriss
989169dcfe remove unused kubernetes/pkg/util/version dependency
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-04-20 12:59:22 -07:00
Steve Kriss
31645d163e remove Gopkg.toml override for blackfriday (not needed)
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-04-20 12:59:10 -07:00
Steve Kriss
97e52f2b3c add timeout arg to rest.NewRequest()
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-04-20 12:58:53 -07:00
Steve Kriss
961d7f2924 kubernetes/pkg/printers/ShortHumanDuration -> apimachinery/pkg/util/duration
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-04-20 12:58:53 -07:00
Steve Kriss
f87280d369 upgrade apimachinery, client-go, kubernetes, api deps
Update k8s.io/api to v1.10.0
Update k8s.io/apimachinery to v1.10.0
Update k8s.io/client-go to v7.0
Update k8s.io/kubernetes to v1.10

Signed-off-by: Steve Kriss <steve@heptio.com>
2018-04-20 12:58:20 -07:00
3502 changed files with 480166 additions and 110254 deletions

34
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,34 @@
---
name: Bug report
about: Tell us about a problem you are experiencing
---
**What steps did you take and what happened:**
[A clear and concise description of what the bug is, and what commands you ran.)
**What did you expect to happen:**
**The output of the following commands will help us better understand what's going on**:
(Pasting long output into a [GitHub gist](https://gist.github.com) or other pastebin is fine.)
* `kubectl logs deployment/velero -n velero`
* `velero backup describe <backupname>` or `kubectl get backup/<backupname> -n velero -o yaml`
* `velero backup logs <backupname>`
* `velero restore describe <restorename>` or `kubectl get restore/<restorename> -n velero -o yaml`
* `velero restore logs <restorename>`
**Anything else you would like to add:**
[Miscellaneous information that will assist in solving the issue.]
**Environment:**
- Velero version (use `velero version`):
- Kubernetes version (use `kubectl version`):
- Kubernetes installer & version:
- Cloud provider or hardware configuration:
- OS (e.g. from `/etc/os-release`):

View File

@@ -0,0 +1,25 @@
---
name: Feature enhancement request
about: Suggest an idea for this project
---
**Describe the problem/challenge you have**
[A description of the current limitation/problem/challenge that you are experiencing.]
**Describe the solution you'd like**
[A clear and concise description of what you want to happen.]
**Anything else you would like to add:**
[Miscellaneous information that will assist in solving the issue.]
**Environment:**
- Velero version (use `velero version`):
- Kubernetes version (use `kubectl version`):
- Kubernetes installer & version:
- Cloud provider or hardware configuration:
- OS (e.g. from `/etc/os-release`):

17
.gitignore vendored
View File

@@ -26,9 +26,24 @@ _testmain.go
debug
/ark
/velero
.idea/
.container-*
.vimrc
.go
.DS_Store
.push-*
.vscode
*.diff
# Jekyll compiled data
site/_site
site/.sass-cache
site/.jekyll
site/.jekyll-metadata
site/.bundle
site/vendor
.ruby-version
.vs

58
.goreleaser.yml Normal file
View File

@@ -0,0 +1,58 @@
# Copyright 2018 the Velero contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
dist: _output
builds:
- main: ./cmd/velero/main.go
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
goarch:
- amd64
- arm
- arm64
- ppc64le
ignore:
# don't build arm/arm64 for darwin or windows
- goos: darwin
goarch: arm
- goos: darwin
goarch: arm64
- goos: darwin
goarch: ppc64le
- goos: windows
goarch: arm
- goos: windows
goarch: arm64
- goos: windows
goarch: ppc64le
ldflags:
- -X "github.com/heptio/velero/pkg/buildinfo.Version={{ .Tag }}" -X "github.com/heptio/velero/pkg/buildinfo.GitSHA={{ .FullCommit }}" -X "github.com/heptio/velero/pkg/buildinfo.GitTreeState={{ .Env.GIT_TREE_STATE }}"
archives:
- name_template: "{{ .ProjectName }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}"
wrap_in_directory: true
files:
- LICENSE
- examples/**/*
checksum:
name_template: 'CHECKSUM'
release:
github:
owner: heptio
name: velero
draft: true
prerelease: auto

View File

@@ -1,11 +1,11 @@
language: go
go:
- 1.9.x
- 1.12.x
sudo: required
services:
- docker
script: make ci
script: hack/ci-check.sh

View File

@@ -1,197 +1,31 @@
# Changelog
## Current release:
* [CHANGELOG-1.1.md][11]
#### [v0.8.3](https://github.com/heptio/ark/releases/tag/v0.8.3) - 2018-06-29
## Development release:
* [Unreleased Changes][0]
##### Bug Fixes:
* Don't restore backup and restore resources to avoid possible data corruption (#622, @ncdc)
#### [v0.8.2](https://github.com/heptio/ark/releases/tag/v0.8.2) - 2018-06-01
##### Bug Fixes:
* Don't crash when a PVC is missing spec.volumeName (#520, @ncdc)
#### [v0.8.1](https://github.com/heptio/ark/releases/tag/v0.8.1) - 2018-04-23
##### Bug Fixes:
* Azure: allow pre-v0.8.0 backups with disk snapshots to be restored and deleted (#446 #449, @skriss)
#### [v0.8.0](https://github.com/heptio/ark/releases/tag/v0.8.0) - 2018-04-19
##### Highlights:
* Backup deletion has been completely revamped to make it simpler and less error-prone. As a user, you still use the `ark backup delete` command to request deletion of a backup and its associated cloud
resources; behind the scenes, we've switched to using a new `DeleteBackupRequest` Custom Resource and associated controller for processing deletion requests.
* We've reduced the number of required fields in the Ark config. For Azure, `location` is no longer required, and for GCP, `project` is not needed.
* Ark now copies tags from volumes to snapshots during backup, and from snapshots to new volumes during restore.
##### Breaking Changes:
* Ark has moved back to a single namespace (`heptio-ark` by default) as part of #383.
##### All New Features:
* Add global `--kubecontext` flag to Ark CLI (#296, @blakebarnett)
* Azure: support cross-resource group restores of volumes (#356 #378, @skriss)
* AWS/Azure/GCP: copy tags from volumes to snapshots, and from snapshots to volumes (#341, @skriss)
* Replace finalizer for backup deletion with `DeleteBackupRequest` custom resource & controller (#383 #431, @ncdc @nrb)
* Don't log warnings during restore if an identical object already exists in the cluster (#405, @nrb)
* Add bash & zsh completion support (#384, @containscafeine)
##### Bug Fixes / Other Changes:
* Error from the Ark CLI if attempting to restore a non-existent backup (#302, @ncdc)
* Enable running the Ark server locally for development purposes (#334, @ncdc)
* Add examples to `ark schedule create` documentation (#331, @lypht)
* GCP: Remove `project` requirement from Ark config (#345, @skriss)
* Add `--from-backup` flag to `ark restore create` and allow custom restore names (#342 #409, @skriss)
* Azure: remove `location` requirement from Ark config (#344, @skriss)
* Add documentation/examples for storing backups in IBM Cloud Object Storage (#321, @roytman)
* Reduce verbosity of hooks logging (#362, @skriss)
* AWS: Add minimal IAM policy to documentation (#363 #419, @hopkinsth)
* Don't restore events (#374, @sanketjpatel)
* Azure: reduce API polling interval from 60s to 5s (#359, @skriss)
* Switch from hostPath to emptyDir volume type for minio example (#386, @containscafeine)
* Add limit ranges as a prioritized resource for restores (#392, @containscafeine)
* AWS: Add documentation on using Ark with kube2iam (#402, @domderen)
* Azure: add node selector so Ark pod is scheduled on a linux node (#415, @ffd2subroutine)
* Error from the Ark CLI if attempting to get logs for a non-existent restore (#391, @containscafeine)
* GCP: Add minimal IAM policy to documentation (#429, @skriss @jody-frankowski)
##### Upgrading from v0.7.1:
Ark v0.7.1 moved the Ark server deployment into a separate namespace, `heptio-ark-server`. As of v0.8.0 we've
returned to a single namespace, `heptio-ark`, for all Ark-related resources. If you're currently running v0.7.1,
here are the steps you can take to upgrade:
1. Execute the steps from the **Credentials and configuration** section for your cloud:
* [AWS](https://heptio.github.io/ark/v0.8.0/aws-config#credentials-and-configuration)
* [Azure](https://heptio.github.io/ark/v0.8.0/azure-config#credentials-and-configuration)
* [GCP](https://heptio.github.io/ark/v0.8.0/gcp-config#credentials-and-configuration)
When you get to the secret creation step, if you don't have your `credentials-ark` file handy,
you can copy the existing secret from your `heptio-ark-server` namespace into the `heptio-ark` namespace:
```bash
kubectl get secret/cloud-credentials -n heptio-ark-server --export -o json | \
jq '.metadata.namespace="heptio-ark"' | \
kubectl apply -f -
```
2. You can now safely delete the `heptio-ark-server` namespace:
```bash
kubectl delete namespace heptio-ark-server
```
3. Execute the commands from the **Start the server** section for your cloud:
* [AWS](https://heptio.github.io/ark/v0.8.0/aws-config#start-the-server)
* [Azure](https://heptio.github.io/ark/v0.8.0/azure-config#start-the-server)
* [GCP](https://heptio.github.io/ark/v0.8.0/gcp-config#start-the-server)
## Older releases:
* [CHANGELOG-1.0.md][10]
* [CHANGELOG-0.11.md][9]
* [CHANGELOG-0.10.md][8]
* [CHANGELOG-0.9.md][7]
* [CHANGELOG-0.8.md][6]
* [CHANGELOG-0.7.md][5]
* [CHANGELOG-0.6.md][4]
* [CHANGELOG-0.5.md][3]
* [CHANGELOG-0.4.md][2]
* [CHANGELOG-0.3.md][1]
#### [v0.7.1](https://github.com/heptio/ark/releases/tag/v0.7.1) - 2018-02-22
Bug Fixes:
* Run the Ark server in its own namespace, separate from backups/schedules/restores/config (#322, @ncdc)
#### [v0.7.0](https://github.com/heptio/ark/releases/tag/v0.7.0) - 2018-02-15
New Features:
* Run the Ark server in any namespace (#272, @ncdc)
* Add ability to delete backups and their associated data (#252, @skriss)
* Support both pre and post backup hooks (#243, @ncdc)
Bug Fixes / Other Changes:
* Switch from Update() to Patch() when updating Ark resources (#241, @skriss)
* Don't fail the backup if a PVC is not bound to a PV (#256, @skriss)
* Restore serviceaccounts prior to workload controllers (#258, @ncdc)
* Stop removing annotations from PVs when restoring them (#263, @skriss)
* Update GCP client libraries (#249, @skriss)
* Clarify backup and restore creation messages (#270, @nrb)
* Update S3 bucket creation docs for us-east-1 (#285, @lypht)
#### [v0.6.0](https://github.com/heptio/ark/tree/v0.6.0) - 2017-11-30
Highlights:
* **Plugins** - We now support user-defined plugins that can extend Ark functionality to meet your custom backup/restore needs without needing to be compiled into the core binary. We support pluggable block and object stores as well as per-item backup and restore actions that can execute arbitrary logic, including modifying the items being backed up or restored. For more information see the [documentation](docs/plugins.md), which includes a reference to a fully-functional sample plugin repository. (#174 #188 #206 #213 #215 #217 #223 #226)
* **Describers** - The Ark CLI now includes `describe` commands for `backups`, `restores`, and `schedules` that provide human-friendly representations of the relevant API objects.
Breaking Changes:
* The config object format has changed. In order to upgrade to v0.6.0, the config object will have to be updated to match the new format. See the [examples](examples) and [documentation](docs/config-definition.md) for more information.
* The restore object format has changed. The `warnings` and `errors` fields are now ints containing the counts, while full warnings and errors are now stored in the object store instead of etcd. Restore objects created prior to v.0.6.0 should be deleted, or a new bucket used, and the old restore objects deleted from Kubernetes (`kubectl -n heptio-ark delete restore --all`).
All New Features:
* Add `ark plugin add` and `ark plugin remove` commands #217, @skriss
* Add plugin support for block/object stores, backup/restore item actions #174 #188 #206 #213 #215 #223 #226, @skriss @ncdc
* Improve Azure deployment instructions #216, @ncdc
* Change default TTL for backups to 30 days #204, @nrb
* Improve logging for backups and restores #199, @ncdc
* Add `ark backup describe`, `ark schedule describe` #196, @ncdc
* Add `ark restore describe` and move restore warnings/errors to object storage #173 #201 #202, @ncdc
* Upgrade to client-go v5.0.1, kubernetes v1.8.2 #157, @ncdc
* Add Travis CI support #165 #166, @ncdc
Bug Fixes:
* Fix log location hook prefix stripping #222, @ncdc
* When running `ark backup download`, remove file if there's an error #154, @ncdc
* Update documentation for AWS KMS Key alias support #163, @lli-hiya
* Remove clock from `volume_snapshot_action` #137, @athampy
#### [v0.5.1](https://github.com/heptio/ark/tree/v0.5.1) - 2017-11-06
Bug fixes:
* If a Service is headless, retain ClusterIP = None when backing up and restoring.
* Use the specifed --label-selector when listing backups, schedules, and restores.
* Restore namespace mapping functionality that was accidentally broken in 0.5.0.
* Always include namespaces in the backup, regardless of the --include-cluster-resources setting.
#### [v0.5.0](https://github.com/heptio/ark/tree/v0.5.0) - 2017-10-26
Breaking changes:
* The backup tar file format has changed. Backups created using previous versions of Ark cannot be restored using v0.5.0.
* When backing up one or more specific namespaces, cluster-scoped resources are no longer backed up by default, with the exception of PVs that are used within the target namespace(s). Cluster-scoped resources can still be included by explicitly specifying `--include-cluster-resources`.
New features:
* Add customized user-agent string for Ark CLI
* Switch from glog to logrus
* Exclude nodes from restoration
* Add a FAQ
* Record PV availability zone and use it when restoring volumes from snapshots
* Back up the PV associated with a PVC
* Add `--include-cluster-resources` flag to `ark backup create`
* Add `--include-cluster-resources` flag to `ark restore create`
* Properly support resource restore priorities across cluster-scoped and namespace-scoped resources
* Support `ark create ...` and `ark get ...`
* Make ark run as cluster-admin
* Add pod exec backup hooks
* Support cross-compilation & upgrade to go 1.9
Bug fixes:
* Make config change detection more robust
#### [v0.4.0](https://github.com/heptio/ark/tree/v0.4.0) - 2017-09-14
Breaking changes:
* Snapshotting and restoring volumes is now enabled by default
* The --namespaces flag for 'ark restore create' has been replaced by --include-namespaces and
--exclude-namespaces
New features:
* Support for S3 SSE with KMS
* Cloud provider configurations are validated at startup
* The persistentVolumeProvider is now optional
* Restore objects are garbage collected
* Each backup now has an associated log file, viewable via 'ark backup logs'
* Each restore now has an associated log file, viewable via 'ark restore logs'
* Add --include-resources/--exclude-resources for restores
Bug fixes:
* Only save/use iops for io1 volumes on AWS
* When restoring, try to retrieve the Backup directly from object storage if it's not found
* When syncing Backups from object storage to Kubernetes, don't return at the first error
encountered
* More closely match how kubectl performs kubeconfig resolution
* Increase default Azure API request timeout to 2 minutes
* Update Azure diskURI to match diskName
#### [v0.3.3](https://github.com/heptio/ark/tree/v0.3.3) - 2017-08-10
* Treat the first field in a schedule's cron expression as minutes, not seconds
#### [v0.3.2](https://github.com/heptio/ark/tree/v0.3.2) - 2017-08-07
* Add client-go auth provider plugins for Azure, GCP, OIDC
#### [v0.3.1](https://github.com/heptio/ark/tree/v0.3.1) - 2017-08-03
* Fix Makefile VERSION
#### [v0.3.0](https://github.com/heptio/ark/tree/v0.3.0) - 2017-08-03
* Initial Release
[11]: https://github.com/heptio/velero/blob/master/changelogs/CHANGELOG-1.1.md
[10]: https://github.com/heptio/velero/blob/master/changelogs/CHANGELOG-1.0.md
[9]: https://github.com/heptio/velero/blob/master/changelogs/CHANGELOG-0.11.md
[8]: https://github.com/heptio/velero/blob/master/changelogs/CHANGELOG-0.10.md
[7]: https://github.com/heptio/velero/blob/master/changelogs/CHANGELOG-0.9.md
[6]: https://github.com/heptio/velero/blob/master/changelogs/CHANGELOG-0.8.md
[5]: https://github.com/heptio/velero/blob/master/changelogs/CHANGELOG-0.7.md
[4]: https://github.com/heptio/velero/blob/master/changelogs/CHANGELOG-0.6.md
[3]: https://github.com/heptio/velero/blob/master/changelogs/CHANGELOG-0.5.md
[2]: https://github.com/heptio/velero/blob/master/changelogs/CHANGELOG-0.4.md
[1]: https://github.com/heptio/velero/blob/master/changelogs/CHANGELOG-0.3.md
[0]: https://github.com/heptio/velero/blob/master/changelogs/unreleased

View File

@@ -1,4 +1,4 @@
# Heptio Ark Community Code of Conduct
# Velero Community Code of Conduct
## Contributor Code of Conduct

View File

@@ -1,11 +1,23 @@
# Contributing
## CHANGELOG
Authors are expected to include a changelog file with their pull requests. The changelog file
should be a new file created in the `changelogs/unreleased` folder. The file should follow the
naming convention of `pr-username` and the contents of the file should be your text for the
changelog.
velero/changelogs/unreleased <- folder
000-username <- file
## DCO Sign off
All authors to the project retain copyright to their work. However, to ensure
that they are only submitting work that they have rights to, we are requiring
everyone to acknowledge this by signing their work.
Any copyright notices in this repo should specify the authors as "the Heptio Ark project contributors".
Any copyright notices in this repo should specify the authors as "the Velero contributors".
To sign your work, just add a line like this at the end of your commit message:

View File

@@ -1,4 +1,4 @@
# Copyright 2017 the Heptio Ark contributors.
# Copyright 2018, 2019 the Velero contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -12,18 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
---
apiVersion: ark.heptio.com/v1
kind: Config
metadata:
namespace: heptio-ark
name: default
persistentVolumeProvider:
name: gcp
backupStorageProvider:
name: gcp
bucket: <YOUR_BUCKET>
backupSyncPeriod: 30m
gcSyncPeriod: 30m
scheduleSyncPeriod: 1m
restoreOnlyMode: false
FROM ubuntu:bionic
LABEL maintainer="Steve Kriss <krisss@vmware.com>"
ENTRYPOINT ["/bin/bash", "-c", "while true; do sleep 10000; done"]

View File

@@ -1,4 +1,4 @@
# Copyright 2018 the Heptio Ark contributors.
# Copyright 2019 the Velero contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -12,20 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
---
apiVersion: ark.heptio.com/v1
kind: Config
metadata:
namespace: heptio-ark
name: default
backupStorageProvider:
name: aws
bucket: <YOUR_BUCKET>
config:
region: <YOUR_REGION>
s3ForcePathStyle: "true"
s3Url: <YOUR_URL_ACCESS_POINT>
backupSyncPeriod: 30m
gcSyncPeriod: 30m
scheduleSyncPeriod: 1m
---
FROM ubuntu:bionic
LABEL maintainer="Steve Kriss <krisss@vmware.com>"
ENTRYPOINT ["/bin/bash", "-c", "while true; do sleep 10000; done"]

33
Dockerfile-velero Normal file
View File

@@ -0,0 +1,33 @@
# Copyright 2017, 2019 the Velero contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM ubuntu:bionic
LABEL maintainer="Steve Kriss <krisss@vmware.com>"
RUN apt-get update && \
apt-get install -y --no-install-recommends ca-certificates wget bzip2 && \
wget --quiet https://github.com/restic/restic/releases/download/v0.9.4/restic_0.9.4_linux_amd64.bz2 && \
bunzip2 restic_0.9.4_linux_amd64.bz2 && \
mv restic_0.9.4_linux_amd64 /usr/bin/restic && \
chmod +x /usr/bin/restic && \
apt-get remove -y wget bzip2 && \
rm -rf /var/lib/apt/lists/*
ADD /bin/linux/amd64/velero /velero
USER nobody:nobody
ENTRYPOINT ["/velero"]

32
Dockerfile-velero-ppc64le Normal file
View File

@@ -0,0 +1,32 @@
# Copyright 2019 the Velero contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM ubuntu:bionic
LABEL maintainer="Steve Kriss <krisss@vmware.com>"
RUN apt-get update && \
apt-get install -y --no-install-recommends ca-certificates wget && \
wget --quiet https://oplab9.parqtec.unicamp.br/pub/ppc64el/restic/restic-0.9.4 && \
mv restic-0.9.4 /usr/bin/restic && \
chmod +x /usr/bin/restic && \
apt-get remove -y wget && \
rm -rf /var/lib/apt/lists/*
ADD /bin/linux/ppc64le/velero /velero
USER nobody:nobody
ENTRYPOINT ["/velero"]

View File

@@ -1,4 +1,4 @@
# Copyright 2017 the Heptio Ark contributors.
# Copyright 2018, 2019 the Velero contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -12,20 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
---
apiVersion: ark.heptio.com/v1
kind: Config
metadata:
namespace: heptio-ark
name: default
persistentVolumeProvider:
name: azure
config:
apiTimeout: <YOUR_TIMEOUT>
backupStorageProvider:
name: azure
bucket: <YOUR_BUCKET>
backupSyncPeriod: 30m
gcSyncPeriod: 30m
scheduleSyncPeriod: 1m
restoreOnlyMode: false
FROM ubuntu:bionic
LABEL maintainer="Steve Kriss <krisss@vmware.com>"
ADD /bin/linux/amd64/velero-restic-restore-helper .
USER nobody:nobody
ENTRYPOINT [ "/velero-restic-restore-helper" ]

View File

@@ -1,4 +1,4 @@
# Copyright 2017 the Heptio Ark contributors.
# Copyright 2019 the Velero contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -12,14 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM alpine:3.6
FROM ubuntu:bionic
MAINTAINER Andy Goldstein <andy@heptio.com>
LABEL maintainer="Steve Kriss <krisss@vmware.com>"
RUN apk add --no-cache ca-certificates
ADD /bin/linux/amd64/ark /ark
ADD /bin/linux/ppc64le/velero-restic-restore-helper .
USER nobody:nobody
ENTRYPOINT ["/ark"]
ENTRYPOINT [ "/velero-restic-restore-helper" ]

819
Gopkg.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -25,82 +25,110 @@
non-go = true
go-tests = true
[[constraint]]
name = "cloud.google.com/go"
version = "0.11.0"
#
# Kubernetes packages
#
[[constraint]]
name = "github.com/Azure/azure-sdk-for-go"
version = "~10.2.1-beta"
name = "k8s.io/kubernetes"
version = "~1.14"
[[constraint]]
name = "github.com/Azure/go-autorest"
version = "~8.1.x"
name = "k8s.io/client-go"
version = "kubernetes-1.14.0"
[[constraint]]
name = "k8s.io/apimachinery"
version = "kubernetes-1.14.0"
[[constraint]]
name = "k8s.io/api"
version = "kubernetes-1.14.0"
[[constraint]]
name = "k8s.io/apiextensions-apiserver"
version = "kubernetes-1.14.0"
# k8s.io/client-go kubernetes-1.14.0 uses v1.1.4
[[override]]
name = "github.com/json-iterator/go"
version = "=1.1.4"
#
# Cloud provider packages
#
[[constraint]]
name = "github.com/aws/aws-sdk-go"
version = "1.13.12"
[[constraint]]
branch = "master"
name = "github.com/golang/glog"
name = "github.com/Azure/azure-sdk-for-go"
version = "~21.4.0"
# k8s.io/client-go kubernetes-1.14.0 uses v11.1.2
[[constraint]]
name = "github.com/Azure/go-autorest"
version = "11.1.2"
[[constraint]]
name = "cloud.google.com/go"
version = "0.11.0"
[[constraint]]
name = "google.golang.org/api"
version = "~v0.3.2"
[[constraint]]
name = "golang.org/x/oauth2"
branch = "master"
#
# Third party packages
#
[[constraint]]
name = "github.com/robfig/cron"
revision = "df38d32658d8788cd446ba74db4bb5375c4b0cb3"
[[constraint]]
name = "github.com/satori/go.uuid"
version = "1.1.0"
version = "~1.2.0"
[[constraint]]
name = "github.com/satori/uuid"
version = "1.1.0"
[[constraint]]
branch = "master"
name = "github.com/spf13/afero"
branch = "master"
[[constraint]]
branch = "master"
name = "github.com/spf13/cobra"
version = "0.0.3"
[[constraint]]
name = "github.com/spf13/pflag"
version = "1.0.0"
version = "1.0.2"
[[constraint]]
name = "github.com/stretchr/testify"
branch = "master"
version = "~1.2.2"
[[constraint]]
branch = "master"
name = "golang.org/x/oauth2"
name = "github.com/hashicorp/go-plugin"
revision = "a1bc61569a26c0f65865932c0d55743b0567c494"
[[constraint]]
branch = "master"
name = "google.golang.org/api"
name = "github.com/golang/protobuf"
version = "~v1.3.1"
[[constraint]]
name = "k8s.io/kubernetes"
version = "~1.9"
name = "google.golang.org/grpc"
version = "~v1.19.0"
[[constraint]]
name = "k8s.io/client-go"
version = "~6.0"
name = "github.com/joho/godotenv"
version = "~v1.3.0"
[[constraint]]
name = "k8s.io/apimachinery"
version = "kubernetes-1.9.0"
[[constraint]]
name = "k8s.io/api"
version = "kubernetes-1.9.0"
name = "github.com/gobwas/glob"
version = "~v0.2.3"
[[override]]
name = "github.com/russross/blackfriday"
revision = "93622da34e54fb6529bfb7c57e710f37a8d9cbd8"
[[constraint]]
name = "golang.org/x/sys"
branch = "master"
name = "github.com/hashicorp/go-plugin"

171
Makefile
View File

@@ -1,6 +1,6 @@
# Copyright 2016 The Kubernetes Authors.
#
# Modifications Copyright 2017 the Heptio Ark contributors.
# Modifications Copyright 2017 the Velero contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -15,27 +15,30 @@
# limitations under the License.
# The binary to build (just the basename).
BIN := ark
BIN ?= velero
# This repo's root import path (under GOPATH).
PKG := github.com/heptio/ark
PKG := github.com/heptio/velero
# Where to push the docker image.
REGISTRY ?= gcr.io/heptio-images
# Which architecture to build - see $(ALL_ARCH) for options.
# if the 'local' rule is being run, detect the ARCH from 'go env'
# if it wasn't specified by the caller.
local : ARCH ?= $(shell go env GOOS)-$(shell go env GOARCH)
ARCH ?= linux-amd64
VERSION ?= master
TAG_LATEST ?= false
###
### These variables should not need tweaking.
###
SRC_DIRS := cmd pkg # directories which hold app source (not vendored)
CLI_PLATFORMS := linux-amd64 linux-arm linux-arm64 darwin-amd64 windows-amd64
CONTAINER_PLATFORMS := linux-amd64 linux-arm linux-arm64
CLI_PLATFORMS := linux-amd64 linux-arm linux-arm64 darwin-amd64 windows-amd64 linux-ppc64le
CONTAINER_PLATFORMS := linux-amd64 linux-arm linux-arm64 linux-ppc64le
platform_temp = $(subst -, ,$(ARCH))
GOOS = $(word 1, $(platform_temp))
@@ -44,7 +47,7 @@ GOARCH = $(word 2, $(platform_temp))
# TODO(ncdc): support multiple image architectures once gcr.io supports manifest lists
# Set default base image dynamically for each arch
ifeq ($(GOARCH),amd64)
DOCKERFILE ?= Dockerfile.alpine
DOCKERFILE ?= Dockerfile-$(BIN)
endif
#ifeq ($(GOARCH),arm)
# DOCKERFILE ?= Dockerfile.arm #armel/busybox
@@ -52,13 +55,18 @@ endif
#ifeq ($(GOARCH),arm64)
# DOCKERFILE ?= Dockerfile.arm64 #aarch64/busybox
#endif
ifeq ($(GOARCH),ppc64le)
DOCKERFILE ?= Dockerfile-$(BIN)-ppc64le
endif
IMAGE := $(REGISTRY)/$(BIN)
IMAGE = $(REGISTRY)/$(BIN)
# If you want to build all binaries, see the 'all-build' rule.
# If you want to build all containers, see the 'all-container' rule.
# If you want to build AND push all containers, see the 'all-push' rule.
all: build
all:
@$(MAKE) build
@$(MAKE) build BIN=velero-restic-restore-helper
build-%:
@$(MAKE) --no-print-directory ARCH=$* build
@@ -75,6 +83,15 @@ all-build: $(addprefix build-, $(CLI_PLATFORMS))
#all-push: $(addprefix push-, $(CONTAINER_PLATFORMS))
local: build-dirs
GOOS=$(GOOS) \
GOARCH=$(GOARCH) \
VERSION=$(VERSION) \
PKG=$(PKG) \
BIN=$(BIN) \
OUTPUT_DIR=$$(pwd)/_output/bin/$(GOOS)/$(GOARCH) \
./hack/build.sh
build: _output/bin/$(GOOS)/$(GOARCH)/$(BIN)
_output/bin/$(GOOS)/$(GOARCH)/$(BIN): build-dirs
@@ -90,42 +107,73 @@ _output/bin/$(GOOS)/$(GOARCH)/$(BIN): build-dirs
TTY := $(shell tty -s && echo "-t")
BUILDER_IMAGE := ark-builder
BUILDER_IMAGE := velero-builder
# Example: make shell CMD="date > datefile"
shell: build-dirs build-image
@# the volume bind-mount of $PWD/vendor/k8s.io/api is needed for code-gen to
@# function correctly (ref. https://github.com/kubernetes/kubernetes/pull/64567)
@docker run \
-e GOFLAGS \
-i $(TTY) \
--rm \
-u $$(id -u):$$(id -g) \
-v "$$(pwd)/.go/pkg:/go/pkg" \
-v "$$(pwd)/.go/std:/go/std" \
-v "$$(pwd):/go/src/$(PKG)" \
-v "$$(pwd)/_output/bin:/output" \
-v "$$(pwd)/.go/std/$(GOOS)/$(GOARCH):/usr/local/go/pkg/$(GOOS)_$(GOARCH)_static" \
-v "$$(pwd)/vendor/k8s.io/api:/go/src/k8s.io/api:delegated" \
-v "$$(pwd)/.go/pkg:/go/pkg:delegated" \
-v "$$(pwd)/.go/std:/go/std:delegated" \
-v "$$(pwd):/go/src/$(PKG):delegated" \
-v "$$(pwd)/_output/bin:/output:delegated" \
-v "$$(pwd)/.go/std/$(GOOS)/$(GOARCH):/usr/local/go/pkg/$(GOOS)_$(GOARCH)_static:delegated" \
-v "$$(pwd)/.go/go-build:/.cache/go-build:delegated" \
-w /go/src/$(PKG) \
$(BUILDER_IMAGE) \
/bin/sh $(CMD)
DOTFILE_IMAGE = $(subst :,_,$(subst /,_,$(IMAGE))-$(VERSION))
# Use a slightly customized build/push targets since we don't have a Go binary to build for the fsfreeze image
build-fsfreeze: BIN = fsfreeze-pause
build-fsfreeze:
@cp $(DOCKERFILE) _output/.dockerfile-$(BIN).alpine
@docker build --pull -t $(IMAGE):$(VERSION) -f _output/.dockerfile-$(BIN).alpine _output
@docker images -q $(IMAGE):$(VERSION) > .container-$(DOTFILE_IMAGE)
push-fsfreeze: BIN = fsfreeze-pause
push-fsfreeze:
@docker push $(IMAGE):$(VERSION)
ifeq ($(TAG_LATEST), true)
docker tag $(IMAGE):$(VERSION) $(IMAGE):latest
docker push $(IMAGE):latest
endif
@docker images -q $(REGISTRY)/fsfreeze-pause:$(VERSION) > .container-$(DOTFILE_IMAGE)
all-containers:
$(MAKE) container
$(MAKE) container BIN=velero-restic-restore-helper
$(MAKE) build-fsfreeze
container: verify test .container-$(DOTFILE_IMAGE) container-name
.container-$(DOTFILE_IMAGE): _output/bin/$(GOOS)/$(GOARCH)/$(BIN) $(DOCKERFILE)
@cp $(DOCKERFILE) _output/.dockerfile-$(GOOS)-$(GOARCH)
@docker build -t $(IMAGE):$(VERSION) -f _output/.dockerfile-$(GOOS)-$(GOARCH) _output
@cp $(DOCKERFILE) _output/.dockerfile-$(BIN)-$(GOOS)-$(GOARCH)
@docker build --pull -t $(IMAGE):$(VERSION) -f _output/.dockerfile-$(BIN)-$(GOOS)-$(GOARCH) _output
@docker images -q $(IMAGE):$(VERSION) > $@
container-name:
@echo "container: $(IMAGE):$(VERSION)"
all-push:
$(MAKE) push
$(MAKE) push BIN=velero-restic-restore-helper
$(MAKE) push-fsfreeze
push: .push-$(DOTFILE_IMAGE) push-name
.push-$(DOTFILE_IMAGE): .container-$(DOTFILE_IMAGE)
@docker push $(IMAGE):$(VERSION)
@if git describe --tags --exact-match >/dev/null 2>&1; \
then \
docker tag $(IMAGE):$(VERSION) $(IMAGE):latest; \
docker push $(IMAGE):latest; \
fi
ifeq ($(TAG_LATEST), true)
docker tag $(IMAGE):$(VERSION) $(IMAGE):latest
docker push $(IMAGE):latest
endif
@docker images -q $(IMAGE):$(VERSION) > $@
push-name:
@@ -134,7 +182,12 @@ push-name:
SKIP_TESTS ?=
test: build-dirs
ifneq ($(SKIP_TESTS), 1)
@$(MAKE) shell CMD="-c 'hack/test.sh $(SRC_DIRS)'"
@$(MAKE) shell CMD="-c 'hack/test.sh $(WHAT)'"
endif
test-local: build-dirs
ifneq ($(SKIP_TESTS), 1)
hack/test.sh $(WHAT)
endif
verify:
@@ -145,40 +198,56 @@ endif
update:
@$(MAKE) shell CMD="-c 'hack/update-all.sh'"
release: all-tar-bin checksum
checksum:
@cd _output/release; \
sha256sum *.tar.gz > CHECKSUM; \
cat CHECKSUM; \
sha256sum CHECKSUM
all-tar-bin: $(addprefix tar-bin-, $(CLI_PLATFORMS))
tar-bin-%:
$(MAKE) ARCH=$* VERSION=$(VERSION) tar-bin
GIT_DESCRIBE = $(shell git describe --tags --always --dirty)
tar-bin: build
mkdir -p _output/release
# We do the subshell & wildcard ls so we can pick up $(BIN).exe for windows
(cd _output/bin/$(GOOS)/$(GOARCH) && ls $(BIN)*) | \
tar \
-C _output/bin/$(GOOS)/$(GOARCH) \
--files-from=- \
-zcf _output/release/$(BIN)-$(GIT_DESCRIBE)-$(GOOS)-$(GOARCH).tar.gz
build-dirs:
@mkdir -p _output/bin/$(GOOS)/$(GOARCH)
@mkdir -p .go/src/$(PKG) .go/pkg .go/bin .go/std/$(GOOS)/$(GOARCH)
@mkdir -p .go/src/$(PKG) .go/pkg .go/bin .go/std/$(GOOS)/$(GOARCH) .go/go-build
build-image:
cd hack/build-image && docker build -t $(BUILDER_IMAGE) .
cd hack/build-image && docker build --pull -t $(BUILDER_IMAGE) .
clean:
rm -rf .container-* _output/.dockerfile-* .push-*
rm -rf .go _output
docker rmi $(BUILDER_IMAGE)
ci: build verify test
ci: all verify test
changelog:
hack/changelog.sh
release:
hack/goreleaser.sh
serve-docs:
docker run \
--rm \
-v "$$(pwd)/site:/srv/jekyll" \
-it -p 4000:4000 \
jekyll/jekyll \
jekyll serve --livereload --incremental
# gen-docs generates a new versioned docs directory under site/docs. It follows
# the following process:
# 1. Copies the contents of the most recently tagged docs directory into the new
# directory, to establish a useful baseline to diff against.
# 2. Adds all copied content from step 1 to git's staging area via 'git add'.
# 3. Replaces the contents of the new docs directory with the contents of the
# 'master' docs directory, updating any version-specific links (e.g. to a
# specific branch of the GitHub repository) to use the new version
# 4. Copies the previous version's ToC file and runs 'git add' to establish
# a useful baseline to diff against.
# 5. Replaces the content of the new ToC file with the master ToC.
# 6. Update site/_config.yml and site/_data/toc-mapping.yml to include entries
# for the new version.
#
# The unstaged changes in the working directory can now easily be diff'ed against the
# staged changes using 'git diff' to review all docs changes made since the previous
# tagged version. Once the unstaged changes are ready, they can be added to the
# staging area using 'git add' and then committed.
#
# To run gen-docs: "NEW_DOCS_VERSION=v1.1.0 make gen-docs"
#
# **NOTE**: there are additional manual steps required to finalize the process of generating
# a new versioned docs site. The full process is documented in site/README-JEKYLL.md.
gen-docs:
@hack/gen-docs.sh

218
README.md
View File

@@ -1,184 +1,52 @@
# Heptio Ark
**Maintainers:** [Heptio][0]
![100]
[![Build Status][1]][2]
## Overview
Ark gives you tools to back up and restore your Kubernetes cluster resources and persistent volumes. Ark lets you:
Velero (formerly Heptio Ark) gives you tools to back up and restore your Kubernetes cluster resources and persistent volumes. Velero lets you:
* Take backups of your cluster and restore in case of loss.
* Copy cluster resources across cloud providers. NOTE: Cloud volume migrations are not yet supported.
* Replicate your production environment for development and testing environments.
* Migrate cluster resources to other clusters.
* Replicate your production cluster to development and testing clusters.
Ark consists of:
Velero consists of:
* A server that runs on your cluster
* A command-line client that runs locally
You can run Velero in clusters on a cloud provider or on-premises. For detailed information, see [Compatible Storage Providers][99].
## Installation
We strongly recommend that you use an [official release][6] of Velero. The tarballs for each release contain the
`velero` command-line client. Follow the [installation instructions][28] to get started.
_The code and sample YAML files in the master branch of the Velero repository are under active development and are not guaranteed to be stable. Use them at your own risk!_
## More information
[The documentation][29] provides detailed information about building from source, architecture, extending Ark, and more.
[The documentation][29] provides a getting started guide, plus information about building from source, architecture, extending Velero, and more.
## Getting started
The following example sets up the Ark server and client, then backs up and restores a sample application.
For simplicity, the example uses Minio, an S3-compatible storage service that runs locally on your cluster. See [Set up Ark with your cloud provider][3] for how to run on a cloud provider.
### Prerequisites
* Access to a Kubernetes cluster, version 1.7 or later. Version 1.7.5 or later is required to run `ark backup delete`.
* A DNS server on the cluster
* `kubectl` installed
### Download
Clone or fork the Ark repository:
```
git clone git@github.com:heptio/ark.git
```
NOTE: Make sure to check out the appropriate version. We recommend that you check out the latest tagged version. The master branch is under active development and might not be stable.
### Set up server
1. Start the server and the local storage service. In the root directory of Ark, run:
```bash
kubectl apply -f examples/common/00-prereqs.yaml
kubectl apply -f examples/minio/
```
NOTE: If you get an error about Config creation, wait for a minute, then run the commands again.
1. Deploy the example nginx application:
```bash
kubectl apply -f examples/nginx-app/base.yaml
```
1. Check to see that both the Ark and nginx deployments are successfully created:
```
kubectl get deployments -l component=ark --namespace=heptio-ark
kubectl get deployments --namespace=nginx-example
```
### Install client
For this example, we recommend that you [download a pre-built release][26].
You can also [build from source][7].
Make sure that you install somewhere in your `$PATH`.
### Back up
1. Create a backup for any object that matches the `app=nginx` label selector:
```
ark backup create nginx-backup --selector app=nginx
```
1. Simulate a disaster:
```
kubectl delete namespace nginx-example
```
1. To check that the nginx deployment and service are gone, run:
```
kubectl get deployments --namespace=nginx-example
kubectl get services --namespace=nginx-example
kubectl get namespace/nginx-example
```
You should get no results.
NOTE: You might need to wait for a few minutes for the namespace to be fully cleaned up.
### Restore
1. Run:
```
ark restore create --from-backup nginx-backup
```
1. Run:
```
ark restore get
```
After the restore finishes, the output looks like the following:
```
NAME BACKUP STATUS WARNINGS ERRORS CREATED SELECTOR
nginx-backup-20170727200524 nginx-backup Completed 0 0 2017-07-27 20:05:24 +0000 UTC <none>
```
NOTE: The restore can take a few moments to finish. During this time, the `STATUS` column reads `InProgress`.
After a successful restore, the `STATUS` column is `Completed`, and `WARNINGS` and `ERRORS` are 0. All objects in the `nginx-example` namespacee should be just as they were before you deleted them.
If there are errors or warnings, you can look at them in detail:
```
ark restore describe <RESTORE_NAME>
```
For more information, see [the debugging information][18].
### Clean up
If you want to delete any backups you created, including data in object storage and persistent
volume snapshots, you can run:
```
ark backup delete BACKUP_NAME
```
This asks the Ark server to delete all backup data associated with `BACKUP_NAME`. You need to do
this for each backup you want to permanently delete. A future version of Ark will allow you to
delete multiple backups by name or label selector.
Once fully removed, the backup is no longer visible when you run:
```
ark backup get BACKUP_NAME
```
If you want to uninstall Ark but preserve the backup data in object storage and persistent volume
snapshots, it is safe to remove the `heptio-ark` namespace and everything else created for this
example:
```
kubectl delete -f examples/common/
kubectl delete -f examples/minio/
kubectl delete -f examples/nginx-app/base.yaml
```
Please use the version selector at the top of the site to ensure you are using the appropriate documentation for your version of Velero.
## Troubleshooting
If you encounter issues, review the [troubleshooting docs][30], [file an issue][4], or talk to us on the [Kubernetes Slack team][25] channel `#ark-dr`.
If you encounter issues, review the [troubleshooting docs][30], [file an issue][4], or talk to us on the [#velero channel][25] on the Kubernetes Slack server.
## Contributing
Thanks for taking the time to join our community and start contributing!
Feedback and discussion is available on [the mailing list][24].
Feedback and discussion are available on [the mailing list][24].
#### Before you start
### Before you start
* Please familiarize yourself with the [Code of Conduct][8] before contributing.
* See [CONTRIBUTING.md][5] for instructions on the developer certificate of origin that we require.
* Read how [we're using ZenHub][26] for project and roadmap planning
#### Pull requests
### Pull requests
* We welcome pull requests. Feel free to dig through the [issues][4] and jump in.
@@ -186,33 +54,27 @@ Feedback and discussion is available on [the mailing list][24].
See [the list of releases][6] to find out about feature changes.
[0]: https://github.com/heptio
[1]: https://travis-ci.org/heptio/ark.svg?branch=master
[2]: https://travis-ci.org/heptio/ark
[3]: /docs/cloud-common.md
[4]: https://github.com/heptio/ark/issues
[5]: https://github.com/heptio/ark/blob/master/CONTRIBUTING.md
[6]: https://github.com/heptio/ark/releases
[7]: /docs/build-from-scratch.md
[8]: https://github.com/heptio/ark/blob/master/CODE_OF_CONDUCT.md
[1]: https://travis-ci.org/heptio/velero.svg?branch=master
[2]: https://travis-ci.org/heptio/velero
[4]: https://github.com/heptio/velero/issues
[5]: https://github.com/heptio/velero/blob/master/CONTRIBUTING.md
[6]: https://github.com/heptio/velero/releases
[8]: https://github.com/heptio/velero/blob/master/CODE_OF_CONDUCT.md
[9]: https://kubernetes.io/docs/setup/
[10]: https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-with-homebrew-on-macos
[11]: https://kubernetes.io/docs/tasks/tools/install-kubectl/#tabset-1
[12]: https://github.com/kubernetes/kubernetes/blob/master/cluster/addons/dns/README.md
[13]: /docs/output-file-format.md
[14]: https://github.com/kubernetes/kubernetes
[15]: https://aws.amazon.com/
[16]: https://cloud.google.com/
[17]: https://azure.microsoft.com/
[18]: /docs/debugging-restores.md
[19]: /docs/img/backup-process.png
[20]: https://kubernetes.io/docs/concepts/api-extension/custom-resources/#customresourcedefinitions
[21]: https://kubernetes.io/docs/concepts/api-extension/custom-resources/#custom-controllers
[22]: https://github.com/coreos/etcd
[24]: http://j.hept.io/ark-list
[25]: http://slack.kubernetes.io/
[26]: https://github.com/heptio/ark/releases
[27]: /docs/hooks.md
[28]: /docs/plugins.md
[29]: https://heptio.github.io/ark/
[30]: /docs/troubleshooting.md
[24]: https://groups.google.com/forum/#!forum/projectvelero
[25]: https://kubernetes.slack.com/messages/velero
[26]: https://velero.io/docs/zenhub
[28]: https://velero.io/docs/install-overview
[29]: https://velero.io/docs/
[30]: https://velero.io/docs/troubleshooting
[99]: https://velero.io/docs/support-matrix
[100]: /site/docs/master/img/velero.png

View File

@@ -1,40 +0,0 @@
# Heptio Ark Roadmap
## Upcoming Versions
The following versions, dates, and features are approximate and are subject to change.
### v0.9.0 - ~ 2018-06-14
- Backup targets
- Snapshot & restore non-cloud volumes - [#19](https://github.com/heptio/ark/issues/19)
- Backup & restore across multiple regions and zones - [#103](https://github.com/heptio/ark/issues/103)
- Ability to clone PVs - [#192](https://github.com/heptio/ark/issues/192)
- Ark install command - [#52](https://github.com/heptio/ark/issues/52)
- Backup & restore progress reporting - [#20](https://github.com/heptio/ark/issues/20) [#21](https://github.com/heptio/ark/issues/21)
## Released Versions
### v0.8.0 - 2018-04-19
[See release notes](https://github.com/heptio/ark/blob/master/CHANGELOG.md#v080---2018-04-19).
### v0.7.0 - 2018-02-15
[See release notes](https://github.com/heptio/ark/blob/master/CHANGELOG.md#v070---2018-02-15).
### v0.6.0 - 2017-11-30
[See release notes](https://github.com/heptio/ark/blob/master/CHANGELOG.md#v060---2017-11-30).
### v0.5.0 - 2017-10-26
[See release notes](https://github.com/heptio/ark/blob/master/CHANGELOG.md#v050---2017-10-26).
### v0.4.0 - 2017-09-14
[See release notes](https://github.com/heptio/ark/blob/master/CHANGELOG.md#v040---2017-09-14).
### v0.3.0 - 2017-08-03
[See release notes](https://github.com/heptio/ark/blob/master/CHANGELOG.md#v030---2017-08-03).

View File

@@ -1,5 +1,5 @@
# Ark Support
# Velero Support
Thanks for trying out Ark! We welcome all feedback, please consider joining our mailing list:
Thanks for trying out Velero! We welcome all feedback, please consider joining our mailing list:
- [Mailing List](http://j.hept.io/ark-list)
- [Mailing List](https://groups.google.com/forum/#!forum/projectvelero)

View File

@@ -0,0 +1,261 @@
- [v0.10.2](#v0102)
- [v0.10.1](#v0101)
- [v0.10.0](#v0100)
## v0.10.2
#### 2019-02-28
### Download
- https://github.com/heptio/ark/releases/tag/v0.10.2
### Changes
* upgrade restic to v0.9.4 & replace --hostname flag with --host (#1156, @skriss)
* use 'restic stats' instead of 'restic check' to determine if repo exists (#1171, @skriss)
* Fix concurrency bug in code ensuring restic repository exists (#1235, @skriss)
## v0.10.1
#### 2019-01-10
### Download
- https://github.com/heptio/ark/releases/tag/v0.10.1
### Changes
* Fix minio setup job command (#1118, @acbramley)
* Add debugging-install link in doc get-started.md (#1131, @hex108)
* `ark version`: show full git SHA & combine git tree state indicator with git SHA line (#1124, @skriss)
* Delete spec.priority in pod restore action (#879, @mwieczorek)
* Allow to use AWS Signature v1 for creating signed AWS urls (#811, @bashofmann)
* add multizone/regional support to gcp (#765, @wwitzel3)
* Fixed the newline output when deleting a schedule. (#1120, @jwhitcraft)
* Remove obsolete make targets and rename 'make goreleaser' to 'make release' (#1114, @skriss)
* Update to go 1.11 (#1069, @gliptak)
* Update CHANGELOGs (#1063, @wwitzel3)
* Initialize empty schedule metrics on server init (#1054, @cbeneke)
* Added brew reference (#1051, @omerlh)
* Remove default token from all service accounts (#1048, @ncdc)
* Add pprof support to the Ark server (#234, @ncdc)
## v0.10.0
#### 2018-11-15
### Download
- https://github.com/heptio/ark/releases/tag/v0.10.0
### Highlights
- We've introduced two new custom resource definitions, `BackupStorageLocation` and `VolumeSnapshotLocation`, that replace the `Config` CRD from
previous versions. As part of this, you may now configure more than one possible location for where backups and snapshots are stored, and when you
create a `Backup` you can select the location where you'd like that particular backup to be stored. See the [Locations documentation][2] for an overview
of this feature.
- Ark's plugin system has been significantly refactored to improve robustness and ease of development. Plugin processes are now automatically restarted
if they unexpectedly terminate. Additionally, plugin binaries can now contain more than one plugin implementation (e.g. and object store *and* a block store,
or many backup item actions).
- The sync process, which ensures that Backup custom resources exist for each backup in object storage, has been revamped to run much more frequently (once
per minute rather than once per hour), to use significantly fewer cloud provider API calls, and to not generate spurious Kubernetes API errors.
- Ark can now be configured to store all data under a prefix within an object storage bucket. This means that you no longer need a separate bucket per Ark
instance; you can now have all of your clusters' Ark backups go into a single bucket, with each cluster having its own prefix/subdirectory
within that bucket.
- Restic backup data is now automatically stored within the same bucket/prefix as the rest of the Ark data. A separate bucket is no longer required (or allowed).
- Ark resources (backups, restores, schedules) can now be bulk-deleted through the `ark` CLI, using the `--all` or `--selector` flags, or by specifying
multiple resource names as arguments to the `delete` commands.
- The `ark` CLI now supports waiting for backups and restores to complete with the `--wait` flag for `ark backup create` and `ark restore create`
- Restores can be created directly from the most recent backup for a schedule, using `ark restore create --from-schedule SCHEDULE_NAME`
### Breaking Changes
Heptio Ark v0.10 contains a number of breaking changes. Upgrading will require some additional steps beyond just updating your client binary and your
container image tag. We've provided a [detailed set of instructions][1] to help you with the upgrade process. **Please read and follow these instructions
carefully to ensure a successful upgrade!**
- The `Config` CRD has been replaced by `BackupStorageLocation` and `VolumeSnapshotLocation` CRDs.
- The interface for external plugins (object/block stores, backup/restore item actions) has changed. If you have authored any custom plugins, they'll
need to be updated for v0.10.
- The [`ObjectStore.ListCommonPrefixes`](https://github.com/heptio/ark/blob/master/pkg/cloudprovider/object_store.go#L50) signature has changed to add a `prefix` parameter.
- Registering plugins has changed. Create a new plugin server with the `NewServer` function, and register plugins with the appropriate functions. See the [`Server`](https://github.com/heptio/ark/blob/master/pkg/plugin/server.go#L37) interface for details.
- The organization of Ark data in object storage has changed. Existing data will need to be moved around to conform to the new layout.
### All Changes
- [b9de44ff](https://github.com/heptio/ark/commit/b9de44ff) update docs to reference config/ dir within release tarballs
- [eace0255](https://github.com/heptio/ark/commit/eace0255) goreleaser: update example image tags to match version being released
- [cff02159](https://github.com/heptio/ark/commit/cff02159) add rbac content, rework get-started for NodePort and publicUrl, add versioning information
- [fa14255e](https://github.com/heptio/ark/commit/fa14255e) add content for docs issue 819
- [22959071](https://github.com/heptio/ark/commit/22959071) add doc explaining locations
- [e5556fe6](https://github.com/heptio/ark/commit/e5556fe6) Added qps and burst to server's client
- [9ae861c9](https://github.com/heptio/ark/commit/9ae861c9) Support a separate URL base for pre-signed URLs
- [698420b6](https://github.com/heptio/ark/commit/698420b6) Update storage-layout-reorg-v0.10.md
- [6c9e1f18](https://github.com/heptio/ark/commit/6c9e1f18) lower some noisy logs to debug level
- [318fd8a8](https://github.com/heptio/ark/commit/318fd8a8) add troubleshooting for loadbalancer restores
- [defb8aa8](https://github.com/heptio/ark/commit/defb8aa8) remove code that checks directly for a backup from restore controller
- [7abe1156](https://github.com/heptio/ark/commit/7abe1156) Move clearing up of metadata before plugin's actions
- [ec013e6f](https://github.com/heptio/ark/commit/ec013e6f) Document upgrading plugins in the deployment
- [d6162e94](https://github.com/heptio/ark/commit/d6162e94) fix goreleaser bugs
- [a15df276](https://github.com/heptio/ark/commit/a15df276) Add correct link and change role
- [46bed015](https://github.com/heptio/ark/commit/46bed015) add 0.10 breaking changes warning to readme in master
- [e3a7d6a2](https://github.com/heptio/ark/commit/e3a7d6a2) add content for issue 994
- [400911e9](https://github.com/heptio/ark/commit/400911e9) address docs issue #978
- [b818cc27](https://github.com/heptio/ark/commit/b818cc27) don't require a default provider VSL if there's only 1
- [90638086](https://github.com/heptio/ark/commit/90638086) v0.10 changelog
- [6e2166c4](https://github.com/heptio/ark/commit/6e2166c4) add docs page on versions and upgrading
- [18b434cb](https://github.com/heptio/ark/commit/18b434cb) goreleaser scripts for building/creating a release on a workstation
- [bb65d67a](https://github.com/heptio/ark/commit/bb65d67a) update restic prerequisite with min k8s version
- [b5a2ccd5](https://github.com/heptio/ark/commit/b5a2ccd5) Silence git detached HEAD advice in build container
- [67749141](https://github.com/heptio/ark/commit/67749141) instructions for upgrading to v0.10
- [516422c2](https://github.com/heptio/ark/commit/516422c2) sync controller: fill in missing .spec.storageLocation
- [195e6aaf](https://github.com/heptio/ark/commit/195e6aaf) fix bug preventing PV snapshots from v0.10 backups from restoring
- [bca58516](https://github.com/heptio/ark/commit/bca58516) Run 'make update' to update formatting
- [573ce7d0](https://github.com/heptio/ark/commit/573ce7d0) Update formatting script
- [90d9be59](https://github.com/heptio/ark/commit/90d9be59) support restoring/deleting legacy backups with .status.volumeBackups
- [ef194972](https://github.com/heptio/ark/commit/ef194972) rename variables #967
- [6d4e702c](https://github.com/heptio/ark/commit/6d4e702c) fix broken link
- [596eea1b](https://github.com/heptio/ark/commit/596eea1b) restore storageclasses before pvs and pvcs
- [f014cab1](https://github.com/heptio/ark/commit/f014cab1) backup describer: show snapshot summary by default, details optionally
- [8acc66d0](https://github.com/heptio/ark/commit/8acc66d0) remove pvProviderExists param from NewRestoreController
- [57ce590f](https://github.com/heptio/ark/commit/57ce590f) create a struct for multiple return of same type in restore_contoroller #967
- [028fafb6](https://github.com/heptio/ark/commit/028fafb6) Corrected grammatical error
- [db856aff](https://github.com/heptio/ark/commit/db856aff) Specify return arguments
- [9952dfb0](https://github.com/heptio/ark/commit/9952dfb0) Address #424: Add CRDs to list of prioritized resources
- [cf2c2714](https://github.com/heptio/ark/commit/cf2c2714) fix bugs in GetBackupVolumeSnapshots and add test
- [ec124673](https://github.com/heptio/ark/commit/ec124673) remove all references to Config from docs/examples
- [c36131a0](https://github.com/heptio/ark/commit/c36131a0) remove Config-related code
- [406b50a7](https://github.com/heptio/ark/commit/406b50a7) update restore process using snapshot locations
- [268080ad](https://github.com/heptio/ark/commit/268080ad) avoid panics if can't get block store during deletion
- [4a03370f](https://github.com/heptio/ark/commit/4a03370f) update backup deletion controller for snapshot locations
- [38c72b8c](https://github.com/heptio/ark/commit/38c72b8c) include snapshot locations in created schedule's backup spec
- [0ec2de55](https://github.com/heptio/ark/commit/0ec2de55) azure: update blockstore to allow storing snaps in different resource group
- [35bb533c](https://github.com/heptio/ark/commit/35bb533c) close gzip writer before uploading volumesnapshots file
- [da9ed38c](https://github.com/heptio/ark/commit/da9ed38c) store volume snapshot info as JSON in backup storage
- [e24248e0](https://github.com/heptio/ark/commit/e24248e0) add --volume-snapshot-locations flag to ark backup create
- [df07b7dc](https://github.com/heptio/ark/commit/df07b7dc) update backup code to work with volume snapshot locations
- [4af89fa8](https://github.com/heptio/ark/commit/4af89fa8) add unit test for getDefaultVolumeSnapshotLocations
- [02f50b9c](https://github.com/heptio/ark/commit/02f50b9c) add default-volume-snapshot-locations to server cmd
- [1aa712d2](https://github.com/heptio/ark/commit/1aa712d2) Default and validate VolumeSnapshotLocations
- [bbf76985](https://github.com/heptio/ark/commit/bbf76985) add create CLI command for snapshot locations
- [aeb221ea](https://github.com/heptio/ark/commit/aeb221ea) Add printer for snapshot locations
- [ffc612ac](https://github.com/heptio/ark/commit/ffc612ac) Add volume snapshot CLI get command
- [f20342aa](https://github.com/heptio/ark/commit/f20342aa) Add VolumeLocation and Snapshot.
- [7172db8a](https://github.com/heptio/ark/commit/7172db8a) upgrade to restic v0.9.3
- [99adc4fa](https://github.com/heptio/ark/commit/99adc4fa) Remove broken references to docs that are not existing
- [474efde6](https://github.com/heptio/ark/commit/474efde6) Fixed relative link for image
- [41735154](https://github.com/heptio/ark/commit/41735154) don't require a default backup storage location to exist
- [0612c5de](https://github.com/heptio/ark/commit/0612c5de) templatize error message in DeleteOptions
- [66bcbc05](https://github.com/heptio/ark/commit/66bcbc05) add support for bulk deletion to ark schedule delete
- [3af43b49](https://github.com/heptio/ark/commit/3af43b49) add azure-specific code to support multi-location restic
- [d009163b](https://github.com/heptio/ark/commit/d009163b) update restic to support multiple backup storage locations
- [f4c99c77](https://github.com/heptio/ark/commit/f4c99c77) Change link for the support matrix
- [91e45d56](https://github.com/heptio/ark/commit/91e45d56) Fix broken storage providers link
- [ed0eb865](https://github.com/heptio/ark/commit/ed0eb865) fix backup storage location example YAMLs
- [eb709b8f](https://github.com/heptio/ark/commit/eb709b8f) only sync a backup location if it's changed since last sync
- [af3af1b5](https://github.com/heptio/ark/commit/af3af1b5) clarify Azure resource group usage in docs
- [9fdf8513](https://github.com/heptio/ark/commit/9fdf8513) Minor code cleanup
- [2073e15a](https://github.com/heptio/ark/commit/2073e15a) Fix formatting for live site
- [0fc3e8d8](https://github.com/heptio/ark/commit/0fc3e8d8) add documentation on running Ark on-premises
- [e46e89cb](https://github.com/heptio/ark/commit/e46e89cb) have restic share main Ark bucket
- [42b54586](https://github.com/heptio/ark/commit/42b54586) refactor to make valid dirs part of an object store layout
- [8bc7e4f6](https://github.com/heptio/ark/commit/8bc7e4f6) store backups & restores in backups/, restores/ subdirs in obj storage
- [e3232b7e](https://github.com/heptio/ark/commit/e3232b7e) add support for bulk deletion to ark restore delete
- [17be71e1](https://github.com/heptio/ark/commit/17be71e1) remove deps used for docs gen
- [20635106](https://github.com/heptio/ark/commit/20635106) remove script for generating docs
- [6fd9ea9d](https://github.com/heptio/ark/commit/6fd9ea9d) remove cli reference docs and related scripts
- [4833607a](https://github.com/heptio/ark/commit/4833607a) Fix infinite sleep in fsfreeze container
- [7668bfd4](https://github.com/heptio/ark/commit/7668bfd4) Add links for Portworx plugin support
- [468006e6](https://github.com/heptio/ark/commit/468006e6) Fix Portworx name in doc
- [e6b44539](https://github.com/heptio/ark/commit/e6b44539) Make fsfreeze image building consistent
- [fcd27a13](https://github.com/heptio/ark/commit/fcd27a13) get a new metadata accessor after calling backup item actions
- [ffef86e3](https://github.com/heptio/ark/commit/ffef86e3) Adding support for the AWS_CLUSTER_NAME env variable allowing to claim volumes ownership
- [cda3dff8](https://github.com/heptio/ark/commit/cda3dff8) Document single binary plugins
- [f049e078](https://github.com/heptio/ark/commit/f049e078) Remove ROADMAP.md, update ZenHub link to Ark board
- [94617b30](https://github.com/heptio/ark/commit/94617b30) convert all controllers to use genericController, logContext -> log
- [779cb428](https://github.com/heptio/ark/commit/779cb428) Document SignatureDoesNotMatch error and triaging
- [7d8813a9](https://github.com/heptio/ark/commit/7d8813a9) move ObjectStore mock into pkg/cloudprovider/mocks
- [f0edf733](https://github.com/heptio/ark/commit/f0edf733) add a BackupStore to pkg/persistence that supports prefixes
- [af64069d](https://github.com/heptio/ark/commit/af64069d) create pkg/persistence and move relevant code from pkg/cloudprovider into it
- [29d75d72](https://github.com/heptio/ark/commit/29d75d72) move object and block store interfaces to their own files
- [211aa7b7](https://github.com/heptio/ark/commit/211aa7b7) Set schedule labels to subsequent backups
- [d34994cb](https://github.com/heptio/ark/commit/d34994cb) set azure restic env vars based on default backup location's config
- [a50367f1](https://github.com/heptio/ark/commit/a50367f1) Regenerate CLI docs
- [7bc27bbb](https://github.com/heptio/ark/commit/7bc27bbb) Pin cobra version
- [e94277ac](https://github.com/heptio/ark/commit/e94277ac) Update pflag version
- [df69b274](https://github.com/heptio/ark/commit/df69b274) azure: update documentation and examples
- [cb321db2](https://github.com/heptio/ark/commit/cb321db2) azure: refactor to not use helpers/ pkg, validate all env/config inputs
- [9d7ea748](https://github.com/heptio/ark/commit/9d7ea748) azure: support different RGs/storage accounts per backup location
- [cd4e9f53](https://github.com/heptio/ark/commit/cd4e9f53) azure: fix for breaking change in blob.GetSASURI
- [a440029c](https://github.com/heptio/ark/commit/a440029c) bump Azure SDK version and include storage mgmt package
- [b31e25bf](https://github.com/heptio/ark/commit/b31e25bf) server: remove unused code, replace deprecated func
- [729d7339](https://github.com/heptio/ark/commit/729d7339) controllers: take a newPluginManager func in constructors
- [6445dbf1](https://github.com/heptio/ark/commit/6445dbf1) Update examples and docs for backup locations
- [133dc185](https://github.com/heptio/ark/commit/133dc185) backup sync: process the default location first
- [7a1e6d16](https://github.com/heptio/ark/commit/7a1e6d16) generic controller: allow controllers with only a resync func
- [6f7bfe54](https://github.com/heptio/ark/commit/6f7bfe54) remove Config CRD's BackupStorageProvider & other obsolete code
- [bd4d97b9](https://github.com/heptio/ark/commit/bd4d97b9) move server's defaultBackupLocation into config struct
- [0e94fa37](https://github.com/heptio/ark/commit/0e94fa37) update sync controller for backup locations
- [2750aa71](https://github.com/heptio/ark/commit/2750aa71) Use backup storage location during restore
- [20f89fbc](https://github.com/heptio/ark/commit/20f89fbc) use the default backup storage location for restic
- [833a6307](https://github.com/heptio/ark/commit/833a6307) Add storage location to backup get/describe
- [cf7c8587](https://github.com/heptio/ark/commit/cf7c8587) download request: fix setting of log level for plugin manager
- [3234124a](https://github.com/heptio/ark/commit/3234124a) backup deletion: fix setting of log level in plugin manager
- [74043ab4](https://github.com/heptio/ark/commit/74043ab4) download request controller: fix bug in determining expiration
- [7007f198](https://github.com/heptio/ark/commit/7007f198) refactor download request controller test and add test cases
- [8f534615](https://github.com/heptio/ark/commit/8f534615) download request controller: use backup location for object store
- [bab08ed1](https://github.com/heptio/ark/commit/bab08ed1) backup deletion controller: use backup location for object store
- [c6f488f7](https://github.com/heptio/ark/commit/c6f488f7) Use backup location in the backup controller
- [06b5af44](https://github.com/heptio/ark/commit/06b5af44) add create and get CLI commands for backup locations
- [adbcd370](https://github.com/heptio/ark/commit/adbcd370) add --default-backup-storage-location flag to server cmd
- [2a34772e](https://github.com/heptio/ark/commit/2a34772e) Add --storage-location argument to create commands
- [56f16170](https://github.com/heptio/ark/commit/56f16170) Correct metadata for BackupStorageLocationList
- [345c3c39](https://github.com/heptio/ark/commit/345c3c39) Generate clients for BackupStorageLocation
- [a25eb032](https://github.com/heptio/ark/commit/a25eb032) Add BackupStorageLocation API type
- [575c4ddc](https://github.com/heptio/ark/commit/575c4ddc) apply annotations on single line, no restore mode
- [030ea6c0](https://github.com/heptio/ark/commit/030ea6c0) minor word updates and command wrapping
- [d32f8dbb](https://github.com/heptio/ark/commit/d32f8dbb) Update hooks/fsfreeze example
- [342a1c64](https://github.com/heptio/ark/commit/342a1c64) add an ark bug command
- [9c11ba90](https://github.com/heptio/ark/commit/9c11ba90) Add DigitalOcean to S3-compatible backup providers
- [ea50ebf2](https://github.com/heptio/ark/commit/ea50ebf2) Fix map merging logic
- [9508e4a2](https://github.com/heptio/ark/commit/9508e4a2) Switch Config CRD elements to server flags
- [0c3ac67b](https://github.com/heptio/ark/commit/0c3ac67b) start using a namespaced label on restored objects, deprecate old label
- [6e53aa03](https://github.com/heptio/ark/commit/6e53aa03) Bring back 'make local'
- [5acccaa7](https://github.com/heptio/ark/commit/5acccaa7) add bulk deletion support to ark backup delete
- [3aa241a7](https://github.com/heptio/ark/commit/3aa241a7) Preserve node ports during restore when annotations hold specification.
- [c5f5862c](https://github.com/heptio/ark/commit/c5f5862c) Add --wait support to ark backup create
- [eb6f742b](https://github.com/heptio/ark/commit/eb6f742b) Document CRD not found errors
- [fb4d507c](https://github.com/heptio/ark/commit/fb4d507c) Extend doc about synchronization
- [e7bb5926](https://github.com/heptio/ark/commit/e7bb5926) Add --wait support to `ark restore create`
- [8ce513ac](https://github.com/heptio/ark/commit/8ce513ac) Only delete unused backup if they are complete
- [1c26fbde](https://github.com/heptio/ark/commit/1c26fbde) remove SnapshotService, replace with direct BlockStore usage
- [13051218](https://github.com/heptio/ark/commit/13051218) Refactor plugin management
- [74dbf387](https://github.com/heptio/ark/commit/74dbf387) Add restore failed phase and metrics
- [8789ae5c](https://github.com/heptio/ark/commit/8789ae5c) update testify to latest released version
- [fe9d61a9](https://github.com/heptio/ark/commit/fe9d61a9) Add schedule command info to quickstart
- [ca5656c2](https://github.com/heptio/ark/commit/ca5656c2) fix bug preventing backup item action item updates from saving
- [d2e629f5](https://github.com/heptio/ark/commit/d2e629f5) Delete backups from etcd if they're not in storage
- [625ba481](https://github.com/heptio/ark/commit/625ba481) Fix ZenHub link on Readme.md
- [dcae6eb0](https://github.com/heptio/ark/commit/dcae6eb0) Update gcp-config.md
- [06d6665a](https://github.com/heptio/ark/commit/06d6665a) check s3URL scheme upon AWS ObjectStore Init()
- [cc359f6e](https://github.com/heptio/ark/commit/cc359f6e) Add contributor docs for our ZenHub usage
- [f6204562](https://github.com/heptio/ark/commit/f6204562) cleanup service account action log statement
- [450fa72f](https://github.com/heptio/ark/commit/450fa72f) Initialize schedule Prometheus metrics to have them created beforehand (see https://prometheus.io/docs/practices/instrumentation/#avoid-missing-metrics)
- [39c4267a](https://github.com/heptio/ark/commit/39c4267a) Clarify that object storage should per-cluster
- [78cbdf95](https://github.com/heptio/ark/commit/78cbdf95) delete old deletion requests for backup when processing a new one
- [85a61b8e](https://github.com/heptio/ark/commit/85a61b8e) return nil error if 404 encountered when deleting snapshots
- [a2a7dbda](https://github.com/heptio/ark/commit/a2a7dbda) fix tagging latest by using make's ifeq
- [b4a52e45](https://github.com/heptio/ark/commit/b4a52e45) Add commands for context to the bug template
- [3efe6770](https://github.com/heptio/ark/commit/3efe6770) Update Ark library code to work with Kubernetes 1.11
- [7e8c8c69](https://github.com/heptio/ark/commit/7e8c8c69) Add some basic troubleshooting commands
- [d1955120](https://github.com/heptio/ark/commit/d1955120) require namespace for backups/etc. to exist at server startup
- [683f7afc](https://github.com/heptio/ark/commit/683f7afc) switch to using .status.startTimestamp for sorting backups
- [b71a37db](https://github.com/heptio/ark/commit/b71a37db) Record backup completion time before uploading
- [217084cd](https://github.com/heptio/ark/commit/217084cd) Add example ark version command to issue templates
- [040788bb](https://github.com/heptio/ark/commit/040788bb) Add minor improvements and aws example<Plug>delimitMateCR
- [5b89f7b6](https://github.com/heptio/ark/commit/5b89f7b6) Skip backup sync if it already exists in k8s
- [c6050845](https://github.com/heptio/ark/commit/c6050845) restore controller: switch to 'c' for receiver name
- [706ae07d](https://github.com/heptio/ark/commit/706ae07d) enable a schedule to be provided as the source for a restore
- [aea68414](https://github.com/heptio/ark/commit/aea68414) fix up Slack link in troubleshooting on master branch
- [bb8e2e91](https://github.com/heptio/ark/commit/bb8e2e91) Document how to run the Ark server locally
- [dc84e591](https://github.com/heptio/ark/commit/dc84e591) Remove outdated namespace deletion content
- [23abbc9a](https://github.com/heptio/ark/commit/23abbc9a) fix paths
- [f0426538](https://github.com/heptio/ark/commit/f0426538) use posix-compliant conditional for checking TAG_LATEST
- [cf336d80](https://github.com/heptio/ark/commit/cf336d80) Added new templates
- [795dc262](https://github.com/heptio/ark/commit/795dc262) replace pkg/restore's osFileSystem with pkg/util/filesystem's
- [eabef085](https://github.com/heptio/ark/commit/eabef085) Update generated Ark code based on the 1.11 k8s.io/code-generator script
- [f5eac0b4](https://github.com/heptio/ark/commit/f5eac0b4) Update vendored library code for Kubernetes 1.11
[1]: https://heptio.github.io/velero/v0.10.0/upgrading-to-v0.10
[2]: locations.md

View File

@@ -0,0 +1,32 @@
## v0.11.1
#### 2019-05-17
### Download
- https://github.com/heptio/velero/releases/tag/v0.11.1
### Highlights
* Added the `velero migrate-backups` command to migrate legacy Ark backup metadata to the current Velero format in object storage. This command needs to be run in preparation for upgrading to v1.0, **if** you have backups that were originally created prior to v0.11 (i.e. when the project was named Ark).
## v0.11.0
#### 2019-02-28
### Download
- https://github.com/heptio/velero/releases/tag/v0.11.0
### Highlights
* Heptio Ark is now Velero! This release is the first one to use the new name. For details on the changes and how to migrate to v0.11, see the [migration instructions][1]. **Please follow the instructions to ensure a successful upgrade to v0.11.**
* Restic has been upgraded to v0.9.4, which brings significantly faster restores thanks to a new multi-threaded restorer.
* Velero now waits for terminating namespaces and persistent volumes to delete before attempting to restore them, rather than trying and failing to restore them while they're being deleted.
### All Changes
* Fix concurrency bug in code ensuring restic repository exists (#1235, @skriss)
* Wait for PVs and namespaces to delete before attempting to restore them. (#826, @nrb)
* Set the zones for GCP regional disks on restore. This requires the `compute.zones.get` permission on the GCP serviceaccount in order to work correctly. (#1200, @nrb)
* Renamed Heptio Ark to Velero. Changed internal imports, environment variables, and binary name. (#1184, @nrb)
* use 'restic stats' instead of 'restic check' to determine if repo exists (#1171, @skriss)
* upgrade restic to v0.9.4 & replace --hostname flag with --host (#1156, @skriss)
* Clarify restore log when object unchanged (#1153, @daved)
* Add backup-version file in backup tarball. (#1117, @wwitzel3)
* add ServerStatusRequest CRD and show server version in `ark version` output (#1116, @skriss)
[1]: https://heptio.github.io/velero/v0.11.0/migrating-to-velero

View File

@@ -0,0 +1,39 @@
- [v0.3.3](#v033)
- [v0.3.2](#v032)
- [v0.3.1](#v031)
- [v0.3.0](#v030)
## v0.3.3
#### 2017-08-10
### Download
- https://github.com/heptio/ark/tree/v0.3.3
### Bug Fixes
* Treat the first field in a schedule's cron expression as minutes, not seconds
## v0.3.2
#### 2017-08-07
### Download
- https://github.com/heptio/ark/tree/v0.3.2
### New Features
* Add client-go auth provider plugins for Azure, GCP, OIDC
## v0.3.1
#### 2017-08-03
### Download
- https://github.com/heptio/ark/tree/v0.3.1
### Bug Fixes
* Fix Makefile VERSION
## v0.3.0
#### 2017-08-03
### Download
- https://github.com/heptio/ark/tree/v0.3.0
### All New Features
* Initial Release

View File

@@ -0,0 +1,29 @@
- [v0.4.0](#v040)
## v0.4.0
#### 2017-09-14
### Download
- https://github.com/heptio/ark/tree/v0.4.0
### Breaking changes
* Snapshotting and restoring volumes is now enabled by default
* The --namespaces flag for 'ark restore create' has been replaced by --include-namespaces and
--exclude-namespaces
### New features
* Support for S3 SSE with KMS
* Cloud provider configurations are validated at startup
* The persistentVolumeProvider is now optional
* Restore objects are garbage collected
* Each backup now has an associated log file, viewable via 'ark backup logs'
* Each restore now has an associated log file, viewable via 'ark restore logs'
* Add --include-resources/--exclude-resources for restores
### Bug fixes
* Only save/use iops for io1 volumes on AWS
* When restoring, try to retrieve the Backup directly from object storage if it's not found
* When syncing Backups from object storage to Kubernetes, don't return at the first error
encountered
* More closely match how kubectl performs kubeconfig resolution
* Increase default Azure API request timeout to 2 minutes
* Update Azure diskURI to match diskName

View File

@@ -0,0 +1,41 @@
- [v0.5.1](#v051)
- [v0.5.0](#v050)
## v0.5.1
#### 2017-11-06
### Download
- https://github.com/heptio/ark/tree/v0.5.1
### Bug fixes
* If a Service is headless, retain ClusterIP = None when backing up and restoring.
* Use the specifed --label-selector when listing backups, schedules, and restores.
* Restore namespace mapping functionality that was accidentally broken in 0.5.0.
* Always include namespaces in the backup, regardless of the --include-cluster-resources setting.
## v0.5.0
#### 2017-10-26
### Download
- https://github.com/heptio/ark/tree/v0.5.0
### Breaking changes
* The backup tar file format has changed. Backups created using previous versions of Ark cannot be restored using v0.5.0.
* When backing up one or more specific namespaces, cluster-scoped resources are no longer backed up by default, with the exception of PVs that are used within the target namespace(s). Cluster-scoped resources can still be included by explicitly specifying `--include-cluster-resources`.
### New features
* Add customized user-agent string for Ark CLI
* Switch from glog to logrus
* Exclude nodes from restoration
* Add a FAQ
* Record PV availability zone and use it when restoring volumes from snapshots
* Back up the PV associated with a PVC
* Add `--include-cluster-resources` flag to `ark backup create`
* Add `--include-cluster-resources` flag to `ark restore create`
* Properly support resource restore priorities across cluster-scoped and namespace-scoped resources
* Support `ark create ...` and `ark get ...`
* Make ark run as cluster-admin
* Add pod exec backup hooks
* Support cross-compilation & upgrade to go 1.9
### Bug fixes
* Make config change detection more robust

View File

@@ -0,0 +1,31 @@
- [v0.6.0](#v060)
## v0.6.0
#### 2017-11-30
### Download
- https://github.com/heptio/ark/tree/v0.6.0
### Highlights
* **Plugins** - We now support user-defined plugins that can extend Ark functionality to meet your custom backup/restore needs without needing to be compiled into the core binary. We support pluggable block and object stores as well as per-item backup and restore actions that can execute arbitrary logic, including modifying the items being backed up or restored. For more information see the [documentation](docs/plugins.md), which includes a reference to a fully-functional sample plugin repository. (#174 #188 #206 #213 #215 #217 #223 #226)
* **Describers** - The Ark CLI now includes `describe` commands for `backups`, `restores`, and `schedules` that provide human-friendly representations of the relevant API objects.
### Breaking Changes
* The config object format has changed. In order to upgrade to v0.6.0, the config object will have to be updated to match the new format. See the [examples](examples) and [documentation](docs/config-definition.md) for more information.
* The restore object format has changed. The `warnings` and `errors` fields are now ints containing the counts, while full warnings and errors are now stored in the object store instead of etcd. Restore objects created prior to v.0.6.0 should be deleted, or a new bucket used, and the old restore objects deleted from Kubernetes (`kubectl -n heptio-ark delete restore --all`).
### All New Features
* Add `ark plugin add` and `ark plugin remove` commands #217, @skriss
* Add plugin support for block/object stores, backup/restore item actions #174 #188 #206 #213 #215 #223 #226, @skriss @ncdc
* Improve Azure deployment instructions #216, @ncdc
* Change default TTL for backups to 30 days #204, @nrb
* Improve logging for backups and restores #199, @ncdc
* Add `ark backup describe`, `ark schedule describe` #196, @ncdc
* Add `ark restore describe` and move restore warnings/errors to object storage #173 #201 #202, @ncdc
* Upgrade to client-go v5.0.1, kubernetes v1.8.2 #157, @ncdc
* Add Travis CI support #165 #166, @ncdc
### Bug Fixes
* Fix log location hook prefix stripping #222, @ncdc
* When running `ark backup download`, remove file if there's an error #154, @ncdc
* Update documentation for AWS KMS Key alias support #163, @lli-hiya
* Remove clock from `volume_snapshot_action` #137, @athampy

View File

@@ -0,0 +1,30 @@
- [v0.7.1](#v071)
- [v0.7.0](#v070)
## v0.7.1
#### 2018-02-22
### Download
- https://github.com/heptio/ark/releases/tag/v0.7.1
### Bug Fixes:
* Run the Ark server in its own namespace, separate from backups/schedules/restores/config (#322, @ncdc)
## v0.7.0
#### 2018-02-15
### Download
- https://github.com/heptio/ark/releases/tag/v0.7.0
### New Features:
* Run the Ark server in any namespace (#272, @ncdc)
* Add ability to delete backups and their associated data (#252, @skriss)
* Support both pre and post backup hooks (#243, @ncdc)
### Bug Fixes / Other Changes:
* Switch from Update() to Patch() when updating Ark resources (#241, @skriss)
* Don't fail the backup if a PVC is not bound to a PV (#256, @skriss)
* Restore serviceaccounts prior to workload controllers (#258, @ncdc)
* Stop removing annotations from PVs when restoring them (#263, @skriss)
* Update GCP client libraries (#249, @skriss)
* Clarify backup and restore creation messages (#270, @nrb)
* Update S3 bucket creation docs for us-east-1 (#285, @lypht)

100
changelogs/CHANGELOG-0.8.md Normal file
View File

@@ -0,0 +1,100 @@
- [v0.8.3](#v083)
- [v0.8.2](#v082)
- [v0.8.1](#v081)
- [v0.8.0](#v080)
## v0.8.3
#### 2018-06-29
### Download
- https://github.com/heptio/ark/releases/tag/v0.8.3
### Bug Fixes:
* Don't restore backup and restore resources to avoid possible data corruption (#622, @ncdc)
## v0.8.2
#### 2018-06-01
### Download
- https://github.com/heptio/ark/releases/tag/v0.8.2
### Bug Fixes:
* Don't crash when a persistent volume claim is missing spec.volumeName (#520, @ncdc)
## v0.8.1
#### 2018-04-23
### Download
- https://github.com/heptio/ark/releases/tag/v0.8.1
### Bug Fixes:
* Azure: allow pre-v0.8.0 backups with disk snapshots to be restored and deleted (#446 #449, @skriss)
## v0.8.0
#### 2018-04-19
### Download
- https://github.com/heptio/ark/releases/tag/v0.8.0
### Highlights:
* Backup deletion has been completely revamped to make it simpler and less error-prone. As a user, you still use the `ark backup delete` command to request deletion of a backup and its associated cloud
resources; behind the scenes, we've switched to using a new `DeleteBackupRequest` Custom Resource and associated controller for processing deletion requests.
* We've reduced the number of required fields in the Ark config. For Azure, `location` is no longer required, and for GCP, `project` is not needed.
* Ark now copies tags from volumes to snapshots during backup, and from snapshots to new volumes during restore.
### Breaking Changes:
* Ark has moved back to a single namespace (`heptio-ark` by default) as part of #383.
### All New Features:
* Add global `--kubecontext` flag to Ark CLI (#296, @blakebarnett)
* Azure: support cross-resource group restores of volumes (#356 #378, @skriss)
* AWS/Azure/GCP: copy tags from volumes to snapshots, and from snapshots to volumes (#341, @skriss)
* Replace finalizer for backup deletion with `DeleteBackupRequest` custom resource & controller (#383 #431, @ncdc @nrb)
* Don't log warnings during restore if an identical object already exists in the cluster (#405, @nrb)
* Add bash & zsh completion support (#384, @containscafeine)
### Bug Fixes / Other Changes:
* Error from the Ark CLI if attempting to restore a non-existent backup (#302, @ncdc)
* Enable running the Ark server locally for development purposes (#334, @ncdc)
* Add examples to `ark schedule create` documentation (#331, @lypht)
* GCP: Remove `project` requirement from Ark config (#345, @skriss)
* Add `--from-backup` flag to `ark restore create` and allow custom restore names (#342 #409, @skriss)
* Azure: remove `location` requirement from Ark config (#344, @skriss)
* Add documentation/examples for storing backups in IBM Cloud Object Storage (#321, @roytman)
* Reduce verbosity of hooks logging (#362, @skriss)
* AWS: Add minimal IAM policy to documentation (#363 #419, @hopkinsth)
* Don't restore events (#374, @sanketjpatel)
* Azure: reduce API polling interval from 60s to 5s (#359, @skriss)
* Switch from hostPath to emptyDir volume type for minio example (#386, @containscafeine)
* Add limit ranges as a prioritized resource for restores (#392, @containscafeine)
* AWS: Add documentation on using Ark with kube2iam (#402, @domderen)
* Azure: add node selector so Ark pod is scheduled on a linux node (#415, @ffd2subroutine)
* Error from the Ark CLI if attempting to get logs for a non-existent restore (#391, @containscafeine)
* GCP: Add minimal IAM policy to documentation (#429, @skriss @jody-frankowski)
### Upgrading from v0.7.1:
Ark v0.7.1 moved the Ark server deployment into a separate namespace, `heptio-ark-server`. As of v0.8.0 we've
returned to a single namespace, `heptio-ark`, for all Ark-related resources. If you're currently running v0.7.1,
here are the steps you can take to upgrade:
1. Execute the steps from the **Credentials and configuration** section for your cloud:
* [AWS](https://heptio.github.io/velero/v0.8.0/aws-config#credentials-and-configuration)
* [Azure](https://heptio.github.io/velero/v0.8.0/azure-config#credentials-and-configuration)
* [GCP](https://heptio.github.io/velero/v0.8.0/gcp-config#credentials-and-configuration)
When you get to the secret creation step, if you don't have your `credentials-ark` file handy,
you can copy the existing secret from your `heptio-ark-server` namespace into the `heptio-ark` namespace:
```bash
kubectl get secret/cloud-credentials -n heptio-ark-server --export -o json | \
jq '.metadata.namespace="heptio-ark"' | \
kubectl apply -f -
```
2. You can now safely delete the `heptio-ark-server` namespace:
```bash
kubectl delete namespace heptio-ark-server
```
3. Execute the commands from the **Start the server** section for your cloud:
* [AWS](https://heptio.github.io/velero/v0.8.0/aws-config#start-the-server)
* [Azure](https://heptio.github.io/velero/v0.8.0/azure-config#start-the-server)
* [GCP](https://heptio.github.io/velero/v0.8.0/gcp-config#start-the-server)

181
changelogs/CHANGELOG-0.9.md Normal file
View File

@@ -0,0 +1,181 @@
- [v0.9.11](#v0911)
- [v0.9.10](#v0910)
- [v0.9.9](#v099)
- [v0.9.8](#v098)
- [v0.9.7](#v097)
- [v0.9.6](#v096)
- [v0.9.5](#v095)
- [v0.9.4](#v094)
- [v0.9.3](#v093)
- [v0.9.2](#v092)
- [v0.9.1](#v091)
- [v0.9.0](#v090)
## v0.9.11
#### 2018-11-08
### Download
- https://github.com/heptio/ark/releases/tag/v0.9.11
### Bug Fixes
* Fix bug preventing PV snapshots from being restored (#1040, @ncdc)
## v0.9.10
#### 2018-11-01
### Download
- https://github.com/heptio/ark/releases/tag/v0.9.10
### Bug Fixes
* restore storageclasses before pvs and pvcs (#594, @shubheksha)
* AWS: Ensure that the order returned by ListObjects is consistent (#999, @bashofmann)
* Add CRDs to list of prioritized resources (#424, @domenicrosati)
* Verify PV doesn't exist before creating new volume (#609, @nrb)
* Update README.md - Grammar mistake corrected (#1018, @midhunbiju)
## v0.9.9
#### 2018-10-24
### Download
- https://github.com/heptio/ark/releases/tag/v0.9.9
### Bug Fixes
* Check if initContainers key exists before attempting to remove volume mounts. (#927, @skriss)
## v0.9.8
#### 2018-10-18
### Download
- https://github.com/heptio/ark/releases/tag/v0.9.8
### Bug Fixes
* Discard service account token volume mounts from init containers on restore (#910, @james-powis)
* Support --include-cluster-resources flag when creating schedule (#942, @captjt)
* Remove logic to get a GCP project (#926, @shubheksha)
* Only try to back up PVCs linked PV if the PVC's phase is Bound (#920, @skriss)
* Claim ownership of new AWS volumes on Kubernetes cluster being restored into (#801, @ljakimczuk)
* Remove timeout check when taking snapshots (#928, @carlisia)
## v0.9.7
#### 2018-10-04
### Download
- https://github.com/heptio/ark/releases/tag/v0.9.7
### Bug Fixes
* Preserve explicitly-specified node ports during restore (#712, @timoreimann)
* Enable restoring resources with ownerReference set (#837, @mwieczorek)
* Fix error when restoring ExternalName services (#869, @shubheksha)
* remove restore log helper for accurate line numbers (#891, @skriss)
* Display backup StartTimestamp in `ark backup get` output (#894, @marctc)
* Fix restic restores when using namespace mappings (#900, @skriss)
## v0.9.6
#### 2018-09-21
### Download
- https://github.com/heptio/ark/releases/tag/v0.9.6
### Bug Fixes
* Discard service account tokens from non-default service accounts on restore (#843, @james-powis)
* Update Docker images to use `alpine:3.8` (#852, @nrb)
## v0.9.5
#### 2018-09-17
### Download
- https://github.com/heptio/ark/releases/tag/v0.9.5
### Bug Fixes
* Fix issue causing restic restores not to work (#834, @skriss)
## v0.9.4
#### 20180-09-05
### Download
- https://github.com/heptio/ark/releases/tag/v0.9.4
### Bug Fixes
* Terminate plugin clients to resolve memory leaks (#797, @skriss)
* Fix nil map errors when merging annotations (#812, @nrb)
## v0.9.3
#### 2018-08-10
### Download
- https://github.com/heptio/ark/releases/tag/v0.9.3
### Bug Fixes
* Initalize Prometheus metrics when creating a new schedule (#689, @lemaral)
## v0.9.2
#### 2018-07-26
### Download
- https://github.com/heptio/ark/releases/tag/v0.9.2) - 2018-07-26
### Bug Fixes:
* Fix issue where modifications made by backup item actions were not being saved to backup tarball (#704, @skriss)
## v0.9.1
#### 2018-07-23
### Download
- https://github.com/heptio/ark/releases/tag/v0.9.1
### Bug Fixes:
* Require namespace for Ark's CRDs to already exist at server startup (#676, @skriss)
* Require all Ark CRDs to exist at server startup (#683, @skriss)
* Fix `latest` tagging in Makefile (#690, @skriss)
* Make Ark compatible with clusters that don't have the `rbac.authorization.k8s.io/v1` API group (#682, @nrb)
* Don't consider missing snapshots an error during backup deletion, limit backup deletion requests per backup to 1 (#687, @skriss)
## v0.9.0
#### 2018-07-06
### Download
- https://github.com/heptio/ark/releases/tag/v0.9.0
### Highlights:
* Ark now has support for backing up and restoring Kubernetes volumes using a free open-source backup tool called [restic](https://github.com/restic/restic).
This provides users an out-of-the-box solution for backing up and restoring almost any type of Kubernetes volume, whether or not it has snapshot support
integrated with Ark. For more information, see the [documentation](https://github.com/heptio/ark/blob/master/docs/restic.md).
* Support for Prometheus metrics has been added! View total number of backup attempts (including success or failure), total backup size in bytes, and backup
durations. More metrics coming in future releases!
### All New Features:
* Add restic support (#508 #532 #533 #534 #535 #537 #540 #541 #545 #546 #547 #548 #555 #557 #561 #563 #569 #570 #571 #606 #608 #610 #621 #631 #636, @skriss)
* Add prometheus metrics (#531 #551 #564, @ashish-amarnath @nrb)
* When backing up a service account, include cluster roles/cluster role bindings that reference it (#470, @skriss)
* When restoring service accounts, copy secrets/image pull secrets into the target cluster even if the service account already exists (#403, @nrb)
### Bug Fixes / Other Changes:
* Upgrade to Kubernetes 1.10 dependencies (#417, @skriss)
* Upgrade to go 1.10 and alpine 3.7 (#456, @skriss)
* Display no excluded resources/namespaces as `<none>` rather than `*` (#453, @nrb)
* Skip completed jobs and pods when restoring (#463, @nrb)
* Set namespace correctly when syncing backups from object storage (#472, @skriss)
* When building on macOS, bind-mount volumes with delegated config (#478, @skriss)
* Add replica sets and daemonsets to cohabitating resources so they're not backed up twice (#482 #485, @skriss)
* Shut down the Ark server gracefully on SIGINT/SIGTERM (#483, @skriss)
* Only back up resources that support GET and DELETE in addition to LIST and CREATE (#486, @nrb)
* Show a better error message when trying to get an incomplete restore's logs (#496, @nrb)
* Stop processing when setting a backup deletion request's phase to `Deleting` fails (#500, @nrb)
* Add library code to install Ark's server components (#437 #506, @marpaia)
* Properly handle errors when backing up additional items (#512, @carlpett)
* Run post hooks even if backup actions fail (#514, @carlpett)
* GCP: fail backup if upload to object storage fails (#510, @nrb)
* AWS: don't require `region` as part of backup storage provider config (#455, @skriss)
* Ignore terminating resources while doing a backup (#526, @yastij)
* Log to stdout instead of stderr (#553, @ncdc)
* Move sample minio deployment's config to an emptyDir (#566, @runyontr)
* Add `omitempty` tag to optional API fields (@580, @nikhita)
* Don't restore PVs with a reclaim policy of `Delete` and no snapshot (#613, @ncdc)
* Don't restore mirror pods (#619, @ncdc)
### Docs Contributors:
* @gianrubio
* @castrojo
* @dhananjaysathe
* @c-knowles
* @mattkelly
* @ae-v
* @hamidzr

139
changelogs/CHANGELOG-1.0.md Normal file
View File

@@ -0,0 +1,139 @@
## v1.0.0
#### 2019-05-20
### Highlights
- We've added a new command, `velero install`, to make it easier to get up and running with Velero. This CLI command replaces the static YAML installation files that were previously part of release tarballs. See the updated [install instructions][3] for more information.
- We've made a number of improvements to the plugin framework:
- we've reorganized the relevant packages to minimize the import surface for plugin authors
- all plugins are now wrapped in panic handlers that will report information on panics back to Velero
- Velero's `--log-level` flag is now passed to plugin implementations
- Errors logged within plugins are now annotated with the file/line of where the error occurred
- Restore item actions can now optionally return a list of additional related items that should be restored
- Restore item actions can now indicate that an item *should not* be restored
- For Azure installation, the `cloud-credentials` secret can now be created from a file containing a list of environment variables. Note that `velero install` always uses this method of providing credentials for Azure. For more details, see [Run on Azure][0].
- We've added a new phase, `PartiallyFailed`, for both backups and restores. This new phase is used for backups/restores that successfully process some but not all of their items.
- We removed all legacy Ark references, including API types, prometheus metrics, restic & hook annotations, etc.
- The restic integration remains a **beta feature**. Please continue to try it out and provide feedback, and we'll be working over the next couple of releases to bring it to GA.
### Breaking Changes
#### API
* All legacy Ark data types and pre-1.0 compatibility code has been removed. Users should migrate any backups created pre-v0.11.0 with the `velero migrate-backups` command, available in [v0.11.1][2].
#### Image
* The base container image has been switched to `ubuntu:bionic`
#### Labels/Annotations/Metrics
* The "ark" annotations for specifying hooks are no longer supported, and have been replaced with "velero"-based equivalents.
* The "ark" annotation for specifying restic backups is no longer supported, and has been replaced with a "velero"-based equivalent.
* The "ark" prometheus metrics no longer exist, and have been replaced with "velero"-based equivalents.
#### Plugin Development
* `BlockStore` plugins are now named `VolumeSnapshotter` plugins
* Plugin APIs have moved to reduce the import surface:
* Plugin gRPC servers live in `github.com/heptio/velero/pkg/plugin/framework`
* Plugin interface types live in `github.com/heptio/velero/pkg/plugin/velero`
* RestoreItemAction interface now takes the original item from the backup as a parameter
* RestoreItemAction plugins can now return additional items to restore
* RestoreItemAction plugins can now skip restoring an item
* Plugins may now send stack traces with errors to the Velero server, so that the errors may be put into the server log
* Plugins must now be "namespaced," using `example.domain.com/plugin-name` format
* For external ObjectStore and VolumeSnapshotter plugins. this name will also be the provider name in BackupStorageLoction and VolumeSnapshotLocation objects
* `--log-level` flag is now passed to all plugins
#### Validation
* Configs for Azure, AWS, and GCP are now checked for invalid or extra keys, and the server is halted if any are found
### Download
- https://github.com/heptio/velero/releases/tag/v1.0.0
### Container Image
`gcr.io/heptio-images/velero:v1.0.0`
### Documentation
https://velero.io/docs/v1.0.0/
### Upgrading
To upgrade from a previous version of Velero, see our [upgrade instructions][1].
### All Changes
* Change base images to ubuntu:bionic (#1488, @skriss)
* Expose the timestamp of the last successful backup in a gauge (#1448, @fabito)
* check backup existence before download (#1447, @fabito)
* Use `latest` image tag if no version information is provided at build time (#1439, @nrb)
* switch from `restic stats` to `restic snapshots` for checking restic repository existence (#1416, @skriss)
* GCP: add optional 'project' config to volume snapshot location for if snapshots are in a different project than the IAM account (#1405, @skriss)
* Disallow bucket names starting with '-' (#1407, @nrb)
* Shorten label values when they're longer than 63 characters (#1392, @anshulc)
* Fail backup if it already exists in object storage. (#1390, @ncdc,carlisia)
* Add PartiallyFailed phase for backups, log + continue on errors during backup process (#1386, @skriss)
* Remove deprecated "hooks" for backups (they've been replaced by "pre hooks") (#1384, @skriss)
* Restic repo ensurer: return error if new repository does not become ready within a minute, and fix channel closing/deletion (#1367, @skriss)
* Support non-namespaced names for built-in plugins (#1366, @nrb)
* Change container base images to debian:stretch-slim and upgrade to go 1.12 (#1365, @skriss)
* Azure: allow credentials to be provided in a .env file (path specified by $AZURE_CREDENTIALS_FILE), formatted like (#1364, @skriss):
```
AZURE_TENANT_ID=${AZURE_TENANT_ID}
AZURE_SUBSCRIPTION_ID=${AZURE_SUBSCRIPTION_ID}
AZURE_CLIENT_ID=${AZURE_CLIENT_ID}
AZURE_CLIENT_SECRET=${AZURE_CLIENT_SECRET}
AZURE_RESOURCE_GROUP=${AZURE_RESOURCE_GROUP}
```
* Instantiate the plugin manager with the per-restore logger so plugin logs are captured in the per-restore log (#1358, @skriss)
* Add gauge metrics for number of existing backups and restores (#1353, @fabito)
* Set default TTL for backups (#1352, @vorar)
* Validate that there can't be any duplicate plugin name, and that the name format is `example.io/name`. (#1339, @carlisia)
* AWS/Azure/GCP: fail fast if unsupported keys are provided in BackupStorageLocation/VolumeSnapshotLocation config (#1338, @skriss)
* `velero backup logs` & `velero restore logs`: show helpful error message if backup/restore does not exist or is not finished processing (#1337, @skriss)
* Add support for allowing a RestoreItemAction to skip item restore. (#1336, @sseago)
* Improve error message around invalid S3 URLs, and gracefully handle trailing backslashes. (#1331, @skriss)
* Set backup's start timestamp before patching it to InProgress so start times display in `velero backup get` while in progress (#1330, @skriss)
* Added ability to dynamically disable controllers (#1326, @amanw)
* Remove deprecated code in preparation for v1.0 release (#1323, @skriss):
- remove ark.heptio.com API group
- remove support for reading ark-backup.json files from object storage
- remove Ark field from RestoreResult type
- remove support for "hook.backup.ark.heptio.com/..." annotations for specifying hooks
- remove support for $HOME/.config/ark/ client config directory
- remove support for restoring Azure snapshots using short snapshot ID formats in backup metadata
- stop applying "velero-restore" label to restored resources and remove it from the API pkg
- remove code that strips the "gc.ark.heptio.com" finalizer from backups
- remove support for "backup.ark.heptio.com/..." annotations for requesting restic backups
- remove "ark"-prefixed prometheus metrics
- remove VolumeBackups field and related code from Backup's status
* Rename BlockStore plugin to VolumeSnapshotter (#1321, @skriss)
* Bump plugin ProtocolVersion to version 2 (#1319, @carlisia)
* Remove Warning field from restore item action output (#1318, @skriss)
* Fix for #1312, use describe to determine if AWS EBS snapshot is encrypted and explicitly pass that value in EC2 CreateVolume call. (#1316, @mstump)
* Allow restic restore helper image name to be optionally specified via ConfigMap (#1311, @skriss)
* Compile only once to lower the initialization cost for regexp.MustCompile. (#1306, @pei0804)
* Enable restore item actions to return additional related items to be restored; have pods return PVCs and PVCs return PVs (#1304, @skriss)
* Log error locations from plugin logger, and don't overwrite them in the client logger if they exist already (#1301, @skriss)
* Send stack traces from plugin errors to Velero via gRPC so error location info can be logged (#1300, @skriss)
* Azure: restore volumes in the original region's zone (#1298, @sylr)
* Check for and exclude hostPath-based persistent volumes from restic backup (#1297, @skriss)
* Make resticrepositories non-restorable resources (#1296, @skriss)
* Gracefully handle failed API groups from the discovery API (#1293, @fabito)
* Add `velero install` command for basic use cases. (#1287, @nrb)
* Collect 3 new metrics: backup_deletion_{attempt|failure|success}_total (#1280, @fabito)
* Pass --log-level flag to internal/external plugins, matching Velero server's log level (#1278, @skriss)
* AWS EBS Volume IDs now contain AZ (#1274, @tsturzl)
* Add panic handlers to all server-side plugin methods (#1270, @skriss)
* Move all the interfaces and associated types necessary to implement all of the Velero plugins to under the new package `velero`. (#1264, @carlisia)
* Update `velero restore` to not open every single file open during extraction of the data (#1261, @asaf)
* Remove restore code that waits for a PV to become Available (#1254, @skriss)
* Improve `describe` output
* Move Phase to right under Metadata(name/namespace/label/annotations)
* Move Validation errors: section right after Phase: section and only show it if the item has a phase of FailedValidation
* For restores move Warnings and Errors under Validation errors. Leave their display as is. (#1248, @DheerajSShetty)
* Don't remove storage class from a persistent volume when restoring it (#1246, @skriss)
* Need to defer closing the the ReadCloser in ObjectStoreGRPCServer.GetObject (#1236, @DheerajSShetty)
* Update Kubernetes dependencies to match v1.12, and update Azure SDK to v19.0.0 (GA) (#1231, @skriss)
* Remove pkg/util/collections/map_utils.go, replace with structured API types and apimachinery's unstructured helpers (#1146, @skriss)
* Add original resource (from backup) to restore item action interface (#1123, @mwieczorek)
[0]: https://velero.io/docs/v1.0.0/azure-config
[1]: https://velero.io/docs/v1.0.0/upgrade-to-1.0
[2]: https://github.com/heptio/velero/releases/tag/v0.11.1
[3]: https://velero.io/docs/v1.0.0/install-overview

100
changelogs/CHANGELOG-1.1.md Normal file
View File

@@ -0,0 +1,100 @@
## v1.1.0
#### 2019-08-22
### Download
- https://github.com/heptio/velero/releases/tag/v1.1.0
### Container Image
`gcr.io/heptio-images/velero:v1.1.0`
### Documentation
https://velero.io/docs/v1.1.0/
### Upgrading
**If you are running Velero in a non-default namespace**, i.e. any namespace other than `velero`, manual intervention is required when upgrading to v1.1. See [upgrading to v1.1](https://velero.io/docs/v1.1.0/upgrade-to-1.1/) for details.
### Highlights
#### Improved Restic Support
A big focus of our work this cycle was continuing to improve support for restic. To that end, weve fixed the following bugs:
- Prior to version 1.1, restic backups could be delayed or failed due to long-lived locks on the repository. Now, Velero removes stale locks from restic repositories every 5 minutes, ensuring they do not interrupt normal operations.
- Previously, the PodVolumeBackup custom resources that represented a restic backup within a cluster were not synchronized between clusters, making it unclear what restic volumes were available to restore into a new cluster. In version 1.1, these resources are synced into clusters, so they are more visible to you when you are trying to restore volumes.
- Originally, Velero would not validate the host path in which volumes were mounted on a given node. If a node did not expose the filesystem correctly, you wouldnt know about it until a backup failed. Now, Veleros restic server will validate that the directory structure is correct on startup, providing earlier feedback when its not.
- Veleros restic support is intended to work on a broad range of volume types. With the general release of the [Container Storage Interface API](https://kubernetes.io/blog/2019/01/15/container-storage-interface-ga/), Velero can now use restic to back up CSI volumes.
Along with our bug fixes, weve provided an easier way to move restic backups between storage providers. Different providers often have different StorageClasses, requiring user intervention to make restores successfully complete.
To make cross-provider moves simpler, weve introduced a StorageClass remapping plug-in. It allows you to automatically translate one StorageClass on PersistentVolumeClaims and PersistentVolumes to another. You can read more about it in our [documentation](https://velero.io/docs/v1.1.0/restore-reference/#changing-pv-pvc-storage-classes).
#### Quality-of-Life Improvements
Weve also made several other enhancements to Velero that should benefit all users.
Users sometimes ask about recommendations for Veleros resource allocation within their cluster. To help with this concern, weve added default resource requirements to the Velero Deployment and restic init containers, along with configurable requests and limits for the restic DaemonSet. All these values can be adjusted if your environment requires it.
Weve also taken some time to improve Velero for the future by updating the Deployment and DaemonSet to use the apps/v1 API group, which will be the [default in Kubernetes 1.16](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.16.md#action-required-3). This change means that `velero install` and the `velero plugin` commands will require Kubernetes 1.9 or later to work. Existing Velero installs will continue to work without needing changes, however.
In order to help you better understand what resources have been backed up, weve added a list of resources in the `velero backup describe --details` command. This change makes it easier to inspect a backup without having to download and extract it.
In the same vein, weve added the ability to put custom tags on cloud-provider snapshots. This approach should provide a better way to keep track of the resources being created in your cloud account. To add a label to a snapshot at backup time, use the `--labels` argument in the `velero backup create` command.
Our final change for increasing visibility into your Velero installation is the `velero plugin get` command. This command will report all the plug-ins within the Velero deployment..
Velero has previously used a restore-only flag on the server to control whether a cluster could write backups to object storage. With Velero 1.1, weve now moved the restore-only behavior into read-only BackupStorageLocations. This move means that the Velero server can use a BackupStorageLocation as a source to restore from, but not for backups, while still retaining the ability to back up to other configured locations. In the future, the `--restore-only` flag will be removed in favor of configuring read-only BackupStorageLocations.
#### Community Contributions
We appreciate all community contributions, whether they be pull requests, bug reports, feature requests, or just questions. With this release, we wanted to draw attention to a few contributions in particular:
For users of node-based IAM authentication systems such as kube2iam, `velero install` now supports the `--pod-annotations` argument for applying necessary annotations at install time. This support should make `velero install` more flexible for scenarios that do not use Secrets for access to their cloud buckets and volumes. You can read more about how to use this new argument in our [AWS documentation](https://velero.io/docs/v1.1.0/aws-config/#alternative-setup-permissions-using-kube2iam). Huge thanks to [Traci Kamp](https://github.com/tlkamp) for this contribution.
Structured logging is important for any application, and Velero is no different. Starting with version 1.1, the Velero server can now output its logs in a JSON format, allowing easier parsing and ingestion. Thank you to [Donovan Carthew](https://github.com/carthewd) for this feature.
AWS supports multiple profiles for accessing object storage, but in the past Velero only used the default. With v.1.1, you can set the `profile` key on yourBackupStorageLocation to specify an alternate profile. If no profile is set, the default one is used, making this change backward compatible. Thanks [Pranav Gaikwad](https://github.com/pranavgaikwad) for this change.
Finally, thanks to testing by [Dylan Murray](https://github.com/dymurray) and [Scott Seago](https://github.com/sseago), an issue with running Velero in non-default namespaces was found in our beta version for this release. If youre running Velero in a namespace other than `velero`, please follow the [upgrade instructions](https://velero.io/docs/v1.1.0/upgrade-to-1.1/).
### All Changes
* Add the prefix to BSL config map so that object stores can use it when initializing (#1767, @betta1)
* Use `VELERO_NAMESPACE` to determine what namespace Velero server is running in. For any v1.0 installations using a different namespace, the `VELERO_NAMESPACE` environment variable will need to be set to the correct namespace. (#1748, @nrb)
* support setting CPU/memory requests with unbounded limits using velero install (#1745, @prydonius)
* sort output of resource list in `velero backup describe --details` (#1741, @prydonius)
* adds the ability to define custom tags to be added to snapshots by specifying custom labels on the Backup CR with the velero backup create --labels flag (#1729, @prydonius)
* Restore restic volumes from PodVolumeBackups CRs (#1723, @carlisia)
* properly restore PVs backed up with restic and a reclaim policy of "Retain" (#1713, @skriss)
* Make `--secret-file` flag on `velero install` optional, add `--no-secret` flag for explicit confirmation (#1699, @nrb)
* Add low cpu/memory limits to the restic init container. This allows for restoration into namespaces with quotas defined. (#1677, @nrb)
* Adds configurable CPU/memory requests and limits to the restic DaemonSet generated by velero install. (#1710, @prydonius)
* remove any stale locks from restic repositories every 5m (#1708, @skriss)
* error if backup storage location's Bucket field also contains a prefix, and gracefully handle leading/trailing slashes on Bucket and Prefix fields. (#1694, @skriss)
* enhancement: allow option to choose JSON log output (#1654, @carthewd)
* Adds configurable CPU/memory requests and limits to the Velero Deployment generated by velero install. (#1678, @prydonius)
* Store restic PodVolumeBackups in obj storage & use that as source of truth like regular backups. (#1577, @carlisia)
* Update Velero Deployment to use apps/v1 API group. `velero install` and `velero plugin add/remove` commands will now require Kubernetes 1.9+ (#1673, @nrb)
* Respect the --kubecontext and --kubeconfig arugments for `velero install`. (#1656, @nrb)
* add plugin for updating PV & PVC storage classes on restore based on a config map (#1621, @skriss)
* Add restic support for CSI volumes (#1615, @nrb)
* bug fix: Fixed namespace usage with cli command 'version' (#1630, @jwmatthews)
* enhancement: allow users to specify additional Velero/Restic pod annotations on the command line with the pod-annotations flag. (#1626, @tlkamp)
* adds validation for pod volumes hostPath mount on restic server startup (#1616, @prydonius)
* enable support for ppc64le architecture (#1605, @prajyot)
* bug fix: only restore additional items returned from restore item actions if they match the restore's namespace/resource selectors (#1612, @skriss)
* add startTimestamp and completionTimestamp to PodVolumeBackup and PodVolumeRestore status fields (#1609, @prydonius)
* bug fix: respect namespace selector when determining which restore item actions to run (#1607, @skriss)
* ensure correct backup item actions run with namespace selector (#1601, @prydonius)
* allows excluding resources from backups with the `velero.io/exclude-from-backup=true` label (#1588, @prydonius)
* ensures backup item action modifications to an item's namespace/name are saved in the file path in the tarball (#1587, @prydonius)
* Hides `velero server` and `velero restic server` commands from the list of available commands as these are not intended for use by the velero CLI user. (#1561, @prydonius)
* remove dependency on glog, update to klog (#1559, @skriss)
* move issue-template-gen from docs/ to hack/ (#1558, @skriss)
* fix panic when processing DeleteBackupRequest objects without labels (#1556, @prydonius)
* support for multiple AWS profiles (#1548, @pranavgaikwad)
* Add CLI command to list (get) all Velero plugins (#1535, @carlisia)
* Added author as a tag on blog post. Should fix 404 error when trying to follow link as specified in issue #1522. (#1522, @coonsd)
* Allow individual backup storage locations to be read-only (#1517, @skriss)
* Stop returning an error when a restic volume is empty since it is a valid scenario. (#1480, @carlisia)
* add ability to use wildcard in includes/excludes (#1428, @guilhem)

View File

View File

@@ -0,0 +1,77 @@
/*
Copyright 2018 the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"time"
)
func main() {
if len(os.Args) != 2 {
fmt.Fprintln(os.Stderr, "ERROR: exactly one argument must be provided, the restore's UID")
os.Exit(1)
}
ticker := time.NewTicker(time.Second)
defer ticker.Stop()
for {
select {
case <-ticker.C:
if done() {
fmt.Println("All restic restores are done")
return
}
}
}
}
// done returns true if for each directory under /restores, a file exists
// within the .velero/ subdirectory whose name is equal to os.Args[1], or
// false otherwise
func done() bool {
children, err := ioutil.ReadDir("/restores")
if err != nil {
fmt.Fprintf(os.Stderr, "ERROR reading /restores directory: %s\n", err)
return false
}
for _, child := range children {
if !child.IsDir() {
fmt.Printf("%s is not a directory, skipping.\n", child.Name())
continue
}
doneFile := filepath.Join("/restores", child.Name(), ".velero", os.Args[1])
if _, err := os.Stat(doneFile); os.IsNotExist(err) {
fmt.Printf("Not found: %s\n", doneFile)
return false
} else if err != nil {
fmt.Fprintf(os.Stderr, "ERROR looking for %s: %s\n", doneFile, err)
return false
}
fmt.Printf("Found %s", doneFile)
}
return true
}

View File

@@ -1,5 +1,5 @@
/*
Copyright 2017 the Heptio Ark contributors.
Copyright 2017, 2019 the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -20,17 +20,17 @@ import (
"os"
"path/filepath"
"github.com/golang/glog"
"k8s.io/klog"
"github.com/heptio/ark/pkg/cmd"
"github.com/heptio/ark/pkg/cmd/ark"
"github.com/heptio/velero/pkg/cmd"
"github.com/heptio/velero/pkg/cmd/velero"
)
func main() {
defer glog.Flush()
defer klog.Flush()
baseName := filepath.Base(os.Args[0])
err := ark.NewCommand(baseName).Execute()
err := velero.NewCommand(baseName).Execute()
cmd.CheckError(err)
}

48
design/_template.md Normal file
View File

@@ -0,0 +1,48 @@
# Design proposal template (replace with your proposal's title)
Status: {Draft,Accepted,Declined}
One to two sentences that describes the goal of this proposal.
The reader should be able to tell by the title, and the opening paragraph, if this document is relevant to them.
_Note_: The preferred style for design documents is one sentence per line.
*Do not wrap lines*.
This aids in review of the document as changes to a line are not obscured by the reflowing those changes caused and has a side effect of avoiding debate about one or two space after a period.
## Goals
- A short list of things which will be accomplished by implementing this proposal.
- Two things is ok.
- Three is pushing it.
- More than three goals suggests that the proposal's scope is too large.
## Non Goals
- A short list of items which are:
- a. out of scope
- b. follow on items which are deliberately excluded from this proposal.
## Background
One to two paragraphs of exposition to set the context for this proposal.
## High-Level Design
One to two paragraphs that describe the high level changes that will be made to implement this proposal.
## Detailed Design
A detailed design describing how the changes to the product should be made.
The names of types, fields, interfaces, and methods should be agreed on here, not debated in code review.
The same applies to changes in CRDs, YAML examples, and so on.
Ideally the changes should be made in sequence so that the work required to implement this design can be done incrementally, possibly in parallel.
## Alternatives Considered
If there are alternative high level or detailed designs that were not pursued they should be called out here with a brief explanation of why they were not pursued.
## Security Considerations
If this proposal has an impact to the security of the product, its users, or data stored or transmitted via the product, they must be addressed here.

View File

@@ -0,0 +1,96 @@
# Expose list of backed up resources in backup details
Status: Accepted
To increase the visibility of what a backup might contain, this document proposes storing metadata about backed up resources in object storage and adding a new section to the detailed backup description output to list them.
## Goals
- Include a list of backed up resources as metadata in the bucket
- Enable users to get a view of what resources are included in a backup using the Velero CLI
## Non Goals
- Expose the full manifests of the backed up resources
## Background
As reported in [#396](https://github.com/heptio/velero/issues/396), the information reported in a `velero backup describe <name> --details` command is fairly limited, and does not easily describe what resources a backup contains.
In order to see what a backup might contain, a user would have to download the backup tarball and extract it.
This makes it difficult to keep track of different backups in a cluster.
## High-Level Design
After performing a backup, a new file will be created that contains the list of the resources that have been included in the backup.
This file will be persisted in object storage alongside the backup contents and existing metadata.
A section will be added to the output of `velero backup describe <name> --details` command to view this metadata.
## Detailed Design
### Metadata file
This metadata will be in JSON (or YAML) format so that it can be easily inspected from the bucket outside of Velero tooling, and will contain the API resource and group, namespaces and names of the resources:
```
apps/v1/Deployment:
- default/database
- default/wordpress
v1/Service:
- default/database
- default/wordpress
v1/Secret:
- default/database-root-password
- default/database-user-password
v1/ConfigMap:
- default/database
v1/PersistentVolume:
- my-pv
```
The filename for this metadata will be `<backup name>-resource-list.json.gz`.
The top-level key is the string form of the `schema.GroupResource` type that we currently keep track of in the backup controller code path.
### Changes in Backup controller
The Backupper currently initialises a map to track the `backedUpItems` (https://github.com/heptio/velero/blob/1594bdc8d0132f548e18ffcc1db8c4cd2b042726/pkg/backup/backup.go#L269), this is passed down through GroupBackupper, ResourceBackupper and ItemBackupper where ItemBackupper records each backed up item.
This property will be moved to the [Backup request struct](https://github.com/heptio/velero/blob/16910a6215cbd8f0bde385dba9879629ebcbcc28/pkg/backup/request.go#L11), allowing the BackupController to access it after a successful backup.
`backedUpItems` currently uses the `schema.GroupResource` as a key for the resource.
In order to record the API group, version and kind for the resource, this key will be constructed from the object's `schema.GroupVersionKind` in the format `{group}/{version}/{kind}` (e.g. `apps/v1/Deployment`).
The `backedUpItems` map is kept as a flat structure internally for quick lookup.
When the backup is ready to upload, `backedUpItems` will be converted to a nested structure representing the metadata file above, grouped by `schema.GroupVersionKind`.
After converting to the right format, it can be passed to the `persistBackup` function to persist the file in object storage.
### Changes to DownloadRequest CRD and processing
A new `DownloadTargetKind` "BackupResourceList" will be added to the DownloadRequest CR.
The `GetDownloadURL` function in the `persistence` package will be updated to handle this new DownloadTargetKind to enable the Velero client to fetch the metadata from the bucket.
### Changes to `velero backup describe <name> --details`
This command will need to be updated to fetch the metadata from the bucket using the `Stream` method used in other commands.
The file will be read in memory and displayed in the output of the command.
Depending on the format the metadata is stored in, it may need processing to print in a more human-readable format.
If we choose to store the metadata in YAML, it can likely be directly printed out.
If the metadata file does not exist, this is an older backup and we cannot display the list of resources that were backed up.
## Open Questions
## Alternatives Considered
### Fetch backup contents archive and walkthrough to list contents
Instead of recording new metadata about what resources have been backed up, we could simply download the backup contents archive and walkthrough it to list the contents everytime `velero backup describe <name> --details` is run.
The advantage of this approach is that we don't need to change any backup procedures as we already have this content, and we will also be able to list resources for older backups.
Additionally, if we wanted to expose more information about the backed up resources, we can do so without having to update what we store in the metadata.
The disadvantages are:
- downloading the whole backup archive will be larger than just downloading a smaller file with metadata
- reduces the metadata available in the bucket that users might want to inspect outside of Velero tooling (though this is not an explicit requirement)
## Security Considerations

54
design/pv-cloning.md Normal file
View File

@@ -0,0 +1,54 @@
# Cloning PVs While Remapping Namespaces
Status: Approved
Velero supports restoring resources into different namespaces than they were backed up from.
This enables a user to, among other things, clone a namespace within a cluster.
However, if the namespace being cloned uses persistent volume claims, Velero cannot currently create a second copy of the original persistent volume when restoring.
This limitation is documented in detail in [issue #192](https://github.com/heptio/velero/issues/192).
This document proposes a solution that allows new copies of persistent volumes to be created during a namespace clone.
## Goals
- Enable persistent volumes to be cloned when using `velero restore create --namespace-mappings ...` to create a second copy of a namespace within a cluster.
## Non Goals
- Cloning of persistent volumes in any scenario other than when using `velero restore create --namespace-mappings ...` flag.
- [CSI-based cloning](https://kubernetes.io/docs/concepts/storage/volume-pvc-datasource/).
## Background
(Omitted, see introduction)
## High-Level Design
During a restore, Velero will detect that it needs to assign a new name to a persistent volume being restored if and only if both of the following conditions are met:
- the persistent volume is claimed by a persistent volume claim in a namespace that's being remapped using `velero restore create --namespace-mappings ...`
- a persistent volume already exists in the cluster with the original name
If these conditions exist, Velero will give the persistent volume a new arbitrary name before restoring it.
It will also update the `spec.volumeName` of the related persistent volume claim.
## Detailed Design
In `pkg/restore/restore.go`, around [line 872](https://github.com/heptio/velero/blob/master/pkg/restore/restore.go#L872), Velero has special-case code for persistent volumes.
This code will be updated to check for the two preconditions described in the previous section.
If the preconditions are met, the object will be given a new name.
The persistent volume will also be annotated with the original name, e.g. `velero.io/original-pv-name=NAME`.
Importantly, the name change will occur **before** [line 890](https://github.com/heptio/velero/blob/master/pkg/restore/restore.go#L890), where Velero checks to see if it should restore the persistent volume.
Additionally, the old and new persistent volume names will be recorded in a new field that will be added to the `context` struct, `renamedPVs map[string]string`.
In the special-case code for persistent volume claims starting on [line 987](https://github.com/heptio/velero/blob/master/pkg/restore/restore.go#L987), Velero will check to see if the claimed persistent volume has been renamed by looking in `ctx.renamedPVs`.
If so, Velero will update the persistent volume claim's `spec.volumeName` to the new name.
## Alternatives Considered
One alternative approach is to add a new CLI flag and API field for restores, e.g. `--clone-pvs`, that a user could provide to indicate they want to create copies of persistent volumes.
This approach would work fine, but it does require the user to be aware of this flag/field and to properly specify it when needed.
It seems like a better UX to detect the typical conditions where this behavior is needed, and to automatically apply it.
Additionally, the design proposed here does not preclude such a flag/field from being added later, if it becomes necessary to cover other use cases.
## Security Considerations
N/A

View File

@@ -1,12 +1,11 @@
# Examples
The YAML config files in this directory can be used to quickly deploy a containerized Ark deployment.
This directory contains sample YAML config files that can be used for exploring Velero.
* `common/`: Contains manifests to set up Ark. Can be used across cloud provider platforms. (Note that Azure requires its own deployment file due to its unique way of loading credentials).
* `minio/`: Used in the [Quickstart][0] to set up [Minio][1], a local S3-compatible object storage service. It provides a convenient way to test Velero without tying you to a specific cloud provider.
* `minio/`: Used in the [Quickstart][1] to set up [Minio][0], a local S3-compatible object storage service. It provides a convenient way to test Ark without tying you to a specific cloud provider.
* `nginx-app/`: A sample nginx app that can be used to test backups and restores.
* `aws/`, `azure/`, `gcp/`, `ibm/`: Contains manifests specific to the given cloud provider's setup.
[0]: https://github.com/minio/minio
[1]: /README.md#quickstart
[0]: /docs/get-started.md
[1]: https://github.com/minio/minio

View File

@@ -1,33 +0,0 @@
# Copyright 2017 the Heptio Ark contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
apiVersion: ark.heptio.com/v1
kind: Config
metadata:
namespace: heptio-ark
name: default
persistentVolumeProvider:
name: aws
config:
region: <YOUR_REGION>
backupStorageProvider:
name: aws
bucket: <YOUR_BUCKET>
config:
region: <YOUR_REGION>
backupSyncPeriod: 30m
gcSyncPeriod: 30m
scheduleSyncPeriod: 1m
restoreOnlyMode: false

View File

@@ -1,44 +0,0 @@
# Copyright 2018 the Heptio Ark contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
namespace: heptio-ark
name: ark
spec:
replicas: 1
template:
metadata:
labels:
component: ark
annotations:
iam.amazonaws.com/role: arn:aws:iam::<AWS_ACCOUNT_ID>:role/<HEPTIO_ARK_ROLE_NAME>
spec:
restartPolicy: Always
serviceAccountName: ark
containers:
- name: ark
image: gcr.io/heptio-images/ark:latest
command:
- /ark
args:
- server
volumeMounts:
- name: plugins
mountPath: /plugins
volumes:
- name: plugins
emptyDir: {}

View File

@@ -1,50 +0,0 @@
# Copyright 2017 the Heptio Ark contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
namespace: heptio-ark
name: ark
spec:
replicas: 1
template:
metadata:
labels:
component: ark
spec:
restartPolicy: Always
serviceAccountName: ark
containers:
- name: ark
image: gcr.io/heptio-images/ark:latest
command:
- /ark
args:
- server
volumeMounts:
- name: cloud-credentials
mountPath: /credentials
- name: plugins
mountPath: /plugins
env:
- name: AWS_SHARED_CREDENTIALS_FILE
value: /credentials/cloud
volumes:
- name: cloud-credentials
secret:
secretName: cloud-credentials
- name: plugins
emptyDir: {}

View File

@@ -1,47 +0,0 @@
# Copyright 2017 the Heptio Ark contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
namespace: heptio-ark
name: ark
spec:
replicas: 1
template:
metadata:
labels:
component: ark
spec:
restartPolicy: Always
serviceAccountName: ark
containers:
- name: ark
image: gcr.io/heptio-images/ark:latest
command:
- /ark
args:
- server
envFrom:
- secretRef:
name: cloud-credentials
volumeMounts:
- name: plugins
mountPath: /plugins
volumes:
- name: plugins
emptyDir: {}
nodeSelector:
beta.kubernetes.io/os: linux

View File

@@ -1,134 +0,0 @@
# Copyright 2017 the Heptio Ark contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: backups.ark.heptio.com
labels:
component: ark
spec:
group: ark.heptio.com
version: v1
scope: Namespaced
names:
plural: backups
kind: Backup
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: schedules.ark.heptio.com
labels:
component: ark
spec:
group: ark.heptio.com
version: v1
scope: Namespaced
names:
plural: schedules
kind: Schedule
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: restores.ark.heptio.com
labels:
component: ark
spec:
group: ark.heptio.com
version: v1
scope: Namespaced
names:
plural: restores
kind: Restore
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: configs.ark.heptio.com
labels:
component: ark
spec:
group: ark.heptio.com
version: v1
scope: Namespaced
names:
plural: configs
kind: Config
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: downloadrequests.ark.heptio.com
labels:
component: ark
spec:
group: ark.heptio.com
version: v1
scope: Namespaced
names:
plural: downloadrequests
kind: DownloadRequest
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: deletebackuprequests.ark.heptio.com
labels:
component: ark
spec:
group: ark.heptio.com
version: v1
scope: Namespaced
names:
plural: deletebackuprequests
kind: DeleteBackupRequest
---
apiVersion: v1
kind: Namespace
metadata:
name: heptio-ark
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: ark
namespace: heptio-ark
labels:
component: ark
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: ark
labels:
component: ark
subjects:
- kind: ServiceAccount
namespace: heptio-ark
name: ark
roleRef:
kind: ClusterRole
name: cluster-admin
apiGroup: rbac.authorization.k8s.io

View File

@@ -1,10 +0,0 @@
# File Structure
## 00-prereqs.yaml
This file contains the prerequisites necessary to run the Ark server:
- `heptio-ark` namespace
- `ark` service account
- RBAC rules to grant permissions to the `ark` service account
- CRDs for the Ark-specific resources (Backup, Schedule, Restore, Config)

View File

@@ -1,50 +0,0 @@
# Copyright 2018 the Heptio Ark contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
namespace: heptio-ark
name: ark
spec:
replicas: 1
template:
metadata:
labels:
component: ark
spec:
restartPolicy: Always
serviceAccountName: ark
containers:
- name: ark
image: gcr.io/heptio-images/ark:latest
command:
- /ark
args:
- server
volumeMounts:
- name: cloud-credentials
mountPath: /credentials
- name: plugins
mountPath: /plugins
env:
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /credentials/cloud
volumes:
- name: cloud-credentials
secret:
secretName: cloud-credentials
- name: plugins
emptyDir: {}

View File

@@ -1,50 +0,0 @@
# Copyright 2018 the Heptio Ark contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
namespace: heptio-ark
name: ark
spec:
replicas: 1
template:
metadata:
labels:
component: ark
spec:
restartPolicy: Always
serviceAccountName: ark
containers:
- name: ark
image: gcr.io/heptio-images/ark:latest
command:
- /ark
args:
- server
volumeMounts:
- name: cloud-credentials
mountPath: /credentials
- name: plugins
mountPath: /plugins
env:
- name: AWS_SHARED_CREDENTIALS_FILE
value: /credentials/cloud
volumes:
- name: cloud-credentials
secret:
secretName: cloud-credentials
- name: plugins
emptyDir: {}

View File

@@ -1,4 +1,4 @@
# Copyright 2017 the Heptio Ark contributors.
# Copyright 2017 the Velero contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -13,16 +13,25 @@
# limitations under the License.
---
apiVersion: apps/v1beta1
apiVersion: v1
kind: Namespace
metadata:
name: velero
---
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: heptio-ark
namespace: velero
name: minio
labels:
component: minio
spec:
strategy:
type: Recreate
selector:
matchLabels:
component: minio
template:
metadata:
labels:
@@ -31,6 +40,8 @@ spec:
volumes:
- name: storage
emptyDir: {}
- name: config
emptyDir: {}
containers:
- name: minio
image: minio/minio:latest
@@ -38,6 +49,7 @@ spec:
args:
- server
- /storage
- --config-dir=/config
env:
- name: MINIO_ACCESS_KEY
value: "minio"
@@ -48,16 +60,21 @@ spec:
volumeMounts:
- name: storage
mountPath: "/storage"
- name: config
mountPath: "/config"
---
apiVersion: v1
kind: Service
metadata:
namespace: heptio-ark
namespace: velero
name: minio
labels:
component: minio
spec:
# ClusterIP is recommended for production environments.
# Change to NodePort if needed per documentation,
# but only if you run Minio in a test/trial environment, for example with Minikube.
type: ClusterIP
ports:
- port: 9000
@@ -66,25 +83,11 @@ spec:
selector:
component: minio
---
apiVersion: v1
kind: Secret
metadata:
namespace: heptio-ark
name: cloud-credentials
labels:
component: minio
stringData:
cloud: |
[default]
aws_access_key_id = minio
aws_secret_access_key = minio123
---
apiVersion: batch/v1
kind: Job
metadata:
namespace: heptio-ark
namespace: velero
name: minio-setup
labels:
component: minio
@@ -94,6 +97,9 @@ spec:
name: minio-setup
spec:
restartPolicy: OnFailure
volumes:
- name: config
emptyDir: {}
containers:
- name: mc
image: minio/mc:latest
@@ -101,4 +107,7 @@ spec:
command:
- /bin/sh
- -c
- "mc config host add ark http://minio:9000 minio minio123 && mc mb -p ark/ark"
- "mc --config-dir=/config config host add velero http://minio:9000 minio minio123 && mc --config-dir=/config mb -p velero/velero"
volumeMounts:
- name: config
mountPath: "/config"

View File

@@ -1,31 +0,0 @@
# Copyright 2017 the Heptio Ark contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
apiVersion: ark.heptio.com/v1
kind: Config
metadata:
namespace: heptio-ark
name: default
backupStorageProvider:
name: aws
bucket: ark
config:
region: minio
s3ForcePathStyle: "true"
s3Url: http://minio.heptio-ark.svc:9000
backupSyncPeriod: 1m
gcSyncPeriod: 1m
scheduleSyncPeriod: 1m
restoreOnlyMode: false

View File

@@ -1,50 +0,0 @@
# Copyright 2017 the Heptio Ark contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
namespace: heptio-ark
name: ark
spec:
replicas: 1
template:
metadata:
labels:
component: ark
spec:
restartPolicy: Always
serviceAccountName: ark
containers:
- name: ark
image: gcr.io/heptio-images/ark:latest
command:
- /ark
args:
- server
volumeMounts:
- name: cloud-credentials
mountPath: /credentials
- name: plugins
mountPath: /plugins
env:
- name: AWS_SHARED_CREDENTIALS_FILE
value: /credentials/cloud
volumes:
- name: cloud-credentials
secret:
secretName: cloud-credentials
- name: plugins
emptyDir: {}

View File

@@ -4,12 +4,12 @@ This directory contains manifests for two versions of a sample Nginx app under t
## `base.yaml`
This is the most basic version of the Nginx app, which can be used to test Ark's backup and restore functionality.
This is the most basic version of the Nginx app, which can be used to test Velero's backup and restore functionality.
*This can be deployed as is.*
## `with-pv.yaml`
This sets up an Nginx app that logs to a persistent volume, so that Ark's PV snapshotting functionality can also be tested.
This sets up an Nginx app that logs to a persistent volume, so that Velero's PV snapshotting functionality can also be tested.
*This requires you to first replace the placeholder value `<YOUR_STORAGE_CLASS_NAME>`.*

View File

@@ -1,4 +1,4 @@
# Copyright 2017 the Heptio Ark contributors.
# Copyright 2017 the Velero contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -21,13 +21,16 @@ metadata:
app: nginx
---
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
namespace: nginx-example
spec:
replicas: 2
selector:
matchLabels:
app: nginx
template:
metadata:
labels:

View File

@@ -1,4 +1,4 @@
# Copyright 2017 the Heptio Ark contributors.
# Copyright 2017 the Velero contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -29,7 +29,7 @@ metadata:
labels:
app: nginx
spec:
storageClassName: <YOUR_STORAGE_CLASS_NAME>
# storageClassName: <YOUR_STORAGE_CLASS_NAME>
accessModes:
- ReadWriteOnce
resources:
@@ -37,17 +37,25 @@ spec:
storage: 50Mi
---
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
namespace: nginx-example
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
annotations:
pre.hook.backup.velero.io/container: fsfreeze
pre.hook.backup.velero.io/command: '["/sbin/fsfreeze", "--freeze", "/var/log/nginx"]'
post.hook.backup.velero.io/container: fsfreeze
post.hook.backup.velero.io/command: '["/sbin/fsfreeze", "--unfreeze", "/var/log/nginx"]'
spec:
volumes:
- name: nginx-logs
@@ -62,6 +70,14 @@ spec:
- mountPath: "/var/log/nginx"
name: nginx-logs
readOnly: false
- image: gcr.io/heptio-images/fsfreeze-pause:latest
name: fsfreeze
securityContext:
privileged: true
volumeMounts:
- mountPath: "/var/log/nginx"
name: nginx-logs
readOnly: false
---
apiVersion: v1

View File

@@ -1,5 +1,5 @@
/*
Copyright YEAR the Heptio Ark contributors.
Copyright the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -1,4 +1,4 @@
# Copyright 2018 the Heptio Ark contributors.
# Copyright 2018 the Velero contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -12,10 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM gcr.io/heptio-images/golang:1.9-alpine3.6
FROM golang:1.12
RUN mkdir -p /go/src/k8s.io && \
cd /go/src/k8s.io && \
git clone -b kubernetes-1.9.0 https://github.com/kubernetes/code-generator && \
git clone -b kubernetes-1.9.0 https://github.com/kubernetes/apimachinery && \
git config --global advice.detachedHead false && \
git clone -b kubernetes-1.14.0 https://github.com/kubernetes/code-generator && \
git clone -b kubernetes-1.14.0 https://github.com/kubernetes/apimachinery && \
go get golang.org/x/tools/cmd/goimports && \
cd /go/src/golang.org/x/tools && \
git checkout 40a48ad93fbe707101afb2099b738471f70594ec && \
go install ./cmd/goimports && \
echo chmod -R a+w /go

View File

@@ -41,7 +41,7 @@ fi
export CGO_ENABLED=0
GIT_SHA=$(git describe --tags --always)
GIT_SHA=$(git rev-parse HEAD)
GIT_DIRTY=$(git status --porcelain 2> /dev/null)
if [[ -z "${GIT_DIRTY}" ]]; then
GIT_TREE_STATE=clean
@@ -61,7 +61,7 @@ if [[ "${GOOS}" = "windows" ]]; then
OUTPUT="${OUTPUT}.exe"
fi
go build -i \
go build \
-o ${OUTPUT} \
-installsuffix "static" \
-ldflags "${LDFLAGS}" \

31
hack/changelog.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/bin/bash
# Copyright 2018 the Velero contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -o errexit
set -o nounset
set -o pipefail
CHANGELOG_PATH='changelogs/unreleased'
UNRELEASED=$(ls -t ${CHANGELOG_PATH})
echo -e "Generating CHANGELOG markdown from ${CHANGELOG_PATH}\n"
for entry in $UNRELEASED
do
IFS=$'-' read -ra pruser <<<"$entry"
contents=$(cat ${CHANGELOG_PATH}/${entry})
echo " * ${contents} (#${pruser[0]}, @${pruser[1]})"
done
echo -e "\nCopy and paste the list above in to the appropriate CHANGELOG file."
echo "Be sure to run: git rm ${CHANGELOG_PATH}/*"

17
hack/ci-check.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/usr/bin/env bash
# If we're doing push build, as opposed to a PR, always run make ci
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
make ci
# Exit script early, returning make ci's error
exit $?
fi
# Only run `make ci` if files outside of the site directory changed in the branch
# In a PR build, $TRAVIS_BRANCH is the destination branch.
if [[ $(git diff --name-only $TRAVIS_BRANCH | grep --invert-match site/) ]]; then
make ci
else
echo "Skipping make ci since nothing outside of site directory changed."
exit 0
fi

108
hack/gen-docs.sh Executable file
View File

@@ -0,0 +1,108 @@
#!/bin/bash
# Copyright 2019 the Velero contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# gen-docs.sh is used for the "make gen-docs" target. See additional
# documentation in the Makefile.
set -o errexit
set -o nounset
set -o pipefail
# don't run if there's already a directory for the target docs version
if [[ -d site/docs/$NEW_DOCS_VERSION ]]; then
echo "ERROR: site/docs/$NEW_DOCS_VERSION already exists"
exit 1
fi
# get the alphabetically last item in site/docs to use as PREVIOUS_DOCS_VERSION
# if not explicitly specified by the user
if [[ -z "${PREVIOUS_DOCS_VERSION:-}" ]]; then
echo "PREVIOUS_DOCS_VERSION was not specified, getting the latest version"
PREVIOUS_DOCS_VERSION=$(ls -1 site/docs/ | tail -n 1)
fi
# make a copy of the previous versioned docs dir
echo "Creating copy of docs directory site/docs/$PREVIOUS_DOCS_VERSION in site/docs/$NEW_DOCS_VERSION"
cp -r site/docs/${PREVIOUS_DOCS_VERSION}/ site/docs/${NEW_DOCS_VERSION}/
# 'git add' the previous version's docs as-is so we get a useful diff when we copy the master docs in
echo "Running 'git add' for previous version's doc contents to use as a base for diff"
git add site/docs/${NEW_DOCS_VERSION}
# now copy the contents of site/docs/master into the same directory so we can get a nice
# git diff of what changed since previous version
echo "Copying site/docs/master/ to site/docs/${NEW_DOCS_VERSION}/"
rm -rf site/docs/${NEW_DOCS_VERSION}/ && cp -r site/docs/master/ site/docs/${NEW_DOCS_VERSION}/
# make a copy of the previous versioned ToC
NEW_DOCS_TOC="$(echo ${NEW_DOCS_VERSION} | tr . -)-toc"
PREVIOUS_DOCS_TOC="$(echo ${PREVIOUS_DOCS_VERSION} | tr . -)-toc"
echo "Creating copy of site/_data/$PREVIOUS_DOCS_TOC.yml at site/_data/$NEW_DOCS_TOC.yml"
cp site/_data/$PREVIOUS_DOCS_TOC.yml site/_data/$NEW_DOCS_TOC.yml
# 'git add' the previous version's ToC content as-is so we get a useful diff when we copy the master ToC in
echo "Running 'git add' for previous version's ToC to use as a base for diff"
git add site/_data/$NEW_DOCS_TOC.yml
# now copy the master ToC so we can get a nice git diff of what changed since previous version
echo "Copying site/_data/master-toc.yml to site/_data/$NEW_DOCS_TOC.yml"
rm site/_data/$NEW_DOCS_TOC.yml && cp site/_data/master-toc.yml site/_data/$NEW_DOCS_TOC.yml
# replace known version-specific links -- the sed syntax is slightly different in OS X and Linux,
# so check which OS we're running on.
if [[ $(uname) == "Darwin" ]]; then
echo "[OS X] updating version-specific links"
find site/docs/${NEW_DOCS_VERSION} -type f -name "*.md" | xargs sed -i '' "s|https://velero.io/docs/master|https://velero.io/docs/$NEW_DOCS_VERSION|g"
find site/docs/${NEW_DOCS_VERSION} -type f -name "*.md" | xargs sed -i '' "s|https://github.com/heptio/velero/blob/master|https://github.com/heptio/velero/blob/$NEW_DOCS_VERSION|g"
echo "[OS X] Updating latest version in _config.yml"
sed -i '' "s/latest: ${PREVIOUS_DOCS_VERSION}/latest: ${NEW_DOCS_VERSION}/" site/_config.yml
# newlines and lack of indentation are requirements for this sed syntax
# which is doing an append
echo "[OS X] Adding latest version to versions list in _config.yml"
sed -i '' "/- master/a\\
- ${NEW_DOCS_VERSION}
" site/_config.yml
echo "[OS X] Adding ToC mapping entry"
sed -i '' "/master: master-toc/a\\
${NEW_DOCS_VERSION}: ${NEW_DOCS_TOC}
" site/_data/toc-mapping.yml
else
echo "[Linux] updating version-specific links"
find site/docs/${NEW_DOCS_VERSION} -type f -name "*.md" | xargs sed -i'' "s|https://velero.io/docs/master|https://velero.io/docs/$NEW_DOCS_VERSION|g"
find site/docs/${NEW_DOCS_VERSION} -type f -name "*.md" | xargs sed -i'' "s|https://github.com/heptio/velero/blob/master|https://github.com/heptio/velero/blob/$NEW_DOCS_VERSION|g"
echo "[Linux] Updating latest version in _config.yml"
sed -i'' "s/latest: ${PREVIOUS_DOCS_VERSION}/latest: ${NEW_DOCS_VERSION}/" site/_config.yml
echo "[Linux] Adding latest version to versions list in _config.yml"
sed -i'' "/- master/a - ${NEW_DOCS_VERSION}" site/_config.yml
echo "[Linux] Adding ToC mapping entry"
sed -i'' "/master: master-toc/a ${NEW_DOCS_VERSION}: ${NEW_DOCS_TOC}" site/_data/toc-mapping.yml
fi
echo "Success! site/docs/$NEW_DOCS_VERSION has been created."
echo ""
echo "The next steps are:"
echo " 1. Consult site/README-JEKYLL.md for further manual steps required to finalize the new versioned docs generation."
echo " 2. Run a 'git diff' to review all changes made to the docs since the previous version."
echo " 3. Make any manual changes/corrections necessary."
echo " 4. Run 'git add' to stage all unstaged changes, then 'git commit'."

View File

@@ -1,6 +1,6 @@
#!/bin/bash -e
#
# Copyright 2017 the Heptio Ark contributors.
# Copyright 2017 the Velero contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

50
hack/goreleaser.sh Executable file
View File

@@ -0,0 +1,50 @@
#!/bin/bash
# Copyright 2018 the Velero contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -o errexit
set -o nounset
set -o pipefail
if [[ -z "${GITHUB_TOKEN}" ]]; then
echo "GITHUB_TOKEN must be set"
exit 1
fi
# TODO derive this from the major+minor version
if [ -z "${RELEASE_NOTES_FILE}" ]; then
echo "RELEASE_NOTES_FILE must be set"
exit 1
fi
GIT_DIRTY=$(git status --porcelain 2> /dev/null)
if [[ -z "${GIT_DIRTY}" ]]; then
export GIT_TREE_STATE=clean
else
export GIT_TREE_STATE=dirty
fi
# $PUBLISH must explicitly be set to 'true' for goreleaser
# to publish the release to GitHub.
if [[ "${PUBLISH:-}" != "true" ]]; then
goreleaser release \
--rm-dist \
--release-notes="${RELEASE_NOTES_FILE}" \
--skip-publish
else
goreleaser release \
--rm-dist \
--release-notes="${RELEASE_NOTES_FILE}"
fi

View File

@@ -0,0 +1,45 @@
/*
Copyright 2018 the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This code renders the IssueTemplate string in pkg/cmd/cli/bug/bug.go to
// .github/ISSUE_TEMPLATE/bug_report.md via the hack/update-generated-issue-template.sh script.
package main
import (
"log"
"os"
"text/template"
"github.com/heptio/velero/pkg/cmd/cli/bug"
)
func main() {
outTemplateFilename := os.Args[1]
outFile, err := os.OpenFile(outTemplateFilename, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0644)
if err != nil {
log.Fatal(err)
}
defer outFile.Close()
tmpl, err := template.New("ghissue").Parse(bug.IssueTemplate)
if err != nil {
log.Fatal(err)
}
err = tmpl.Execute(outFile, bug.VeleroBugInfo{})
if err != nil {
log.Fatal(err)
}
}

View File

@@ -20,9 +20,20 @@ set -o pipefail
export CGO_ENABLED=0
TARGETS=$(for d in "$@"; do echo ./$d/...; done)
TARGETS=(
./cmd/...
./pkg/...
)
echo "Running tests:"
go test -i -installsuffix "static" ${TARGETS}
go test -installsuffix "static" -timeout 60s ${TARGETS}
if [[ ${#@} -ne 0 ]]; then
TARGETS=("$@")
fi
echo "Running tests:" "${TARGETS[@]}"
if [[ -n "${GOFLAGS:-}" ]]; then
echo "GOFLAGS: ${GOFLAGS}"
fi
go test -installsuffix "static" -timeout 60s "${TARGETS[@]}"
echo "Success!"

View File

@@ -1,6 +1,6 @@
#!/bin/bash -e
#
# Copyright 2017 the Heptio Ark contributors.
# Copyright 2017 the Velero contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View File

@@ -1,6 +1,6 @@
#!/bin/bash -e
#!/bin/bash
#
# Copyright 2017 the Heptio Ark contributors.
# Copyright 2017 the Velero contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -14,13 +14,54 @@
# See the License for the specific language governing permissions and
# limitations under the License.
HACK_DIR=$(dirname "${BASH_SOURCE}")
set -o errexit
set -o nounset
set -o pipefail
echo "Updating formatting"
if [[ ${1:-} == '--verify' ]]; then
# List file diffs that need formatting updates
MODE='-d'
ACTION='Verifying'
else
# Write formatting updates to files
MODE='-w'
ACTION='Updating'
fi
gofmt -w -s $(find . -type f -name "*.go" -not -path "./vendor/*" -not -path "./pkg/generated/*" -not -name "zz_generated*")
if ! command -v goimports > /dev/null; then
echo 'goimports is missing - please run "go get golang.org/x/tools/cmd/goimports"'
exit 1
fi
command -v goimports > /dev/null || go get golang.org/x/tools/cmd/goimports
goimports -w -d $(find . -type f -name "*.go" -not -path "./vendor/*" -not -path "./pkg/generated/*" -not -name "zz_generated*")
files="$(find . -type f -name '*.go' -not -path './vendor/*' -not -path './site/*' -not -path './pkg/generated/*' -not -name 'zz_generated*')"
echo "${ACTION} gofmt"
for file in ${files}; do
output=$(gofmt "${MODE}" -s "${file}")
if [[ -n "${output}" ]]; then
VERIFY_FMT_FAILED=1
echo "${output}"
fi
done
if [[ -n "${VERIFY_FMT_FAILED:-}" ]]; then
echo "${ACTION} gofmt - failed! Please run 'make update'."
else
echo "${ACTION} gofmt - done!"
fi
echo "Success!"
echo "${ACTION} goimports"
for file in ${files}; do
output=$(goimports "${MODE}" -local github.com/heptio/velero "${file}")
if [[ -n "${output}" ]]; then
VERIFY_IMPORTS_FAILED=1
echo "${output}"
fi
done
if [[ -n "${VERIFY_IMPORTS_FAILED:-}" ]]; then
echo "${ACTION} goimports - failed! Please run 'make update'."
else
echo "${ACTION} goimports - done!"
fi
if [[ -n "${VERIFY_FMT_FAILED:-}" || -n "${VERIFY_IMPORTS_FAILED:-}" ]]; then
exit 1
fi

View File

@@ -1,6 +1,6 @@
#!/bin/bash
#
# Copyright 2017 the Heptio Ark contributors.
# Copyright 2017 the Velero contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -32,8 +32,8 @@ cd ${GOPATH}/src/k8s.io/code-generator
./generate-groups.sh \
all \
github.com/heptio/ark/pkg/generated \
github.com/heptio/ark/pkg/apis \
ark:v1 \
--go-header-file ${GOPATH}/src/github.com/heptio/ark/hack/boilerplate.go.txt \
github.com/heptio/velero/pkg/generated \
github.com/heptio/velero/pkg/apis \
"velero:v1" \
--go-header-file ${GOPATH}/src/github.com/heptio/velero/hack/boilerplate.go.txt \
$@

View File

@@ -1,6 +1,6 @@
#!/bin/bash -e
#
# Copyright 2017 the Heptio Ark contributors.
# Copyright 2018, 2019 the Velero contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -14,24 +14,23 @@
# See the License for the specific language governing permissions and
# limitations under the License.
ARK_ROOT=$(dirname ${BASH_SOURCE})/..
BIN=${ARK_ROOT}/_output/bin
VELERO_ROOT=$(dirname ${BASH_SOURCE})/..
BIN=${VELERO_ROOT}/_output/bin
mkdir -p ${BIN}
echo "Updating generated docs"
go build -o ${BIN}/docs-gen ./docs/generate/ark.go
echo "Updating generated Github issue template"
go build -o ${BIN}/issue-tmpl-gen ./hack/issue-template-gen/main.go
if [[ $# -gt 1 ]]; then
echo "usage: ${BASH_SOURCE} [DIRECTORY]"
echo "usage: ${BASH_SOURCE} [OUTPUT_FILE]"
exit 1
fi
OUTPUT_DIR="$@"
if [[ -z "${OUTPUT_DIR}" ]]; then
OUTPUT_DIR=${ARK_ROOT}/docs/cli-reference
OUTPUT_ISSUE_FILE="$1"
if [[ -z "${OUTPUT_ISSUE_FILE}" ]]; then
OUTPUT_ISSUE_FILE=${VELERO_ROOT}/.github/ISSUE_TEMPLATE/bug_report.md
fi
${BIN}/docs-gen ark ${OUTPUT_DIR}
${BIN}/issue-tmpl-gen ${OUTPUT_ISSUE_FILE}
echo "Success!"

View File

@@ -1,6 +1,6 @@
#!/bin/bash -e
#
# Copyright 2017 the Heptio Ark contributors.
# Copyright 2017 the Velero contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View File

@@ -1,6 +1,6 @@
#!/bin/bash -e
#!/bin/bash
#
# Copyright 2017 the Heptio Ark contributors.
# Copyright 2017 the Velero contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -14,19 +14,5 @@
# See the License for the specific language governing permissions and
# limitations under the License.
HACK_DIR=$(dirname "${BASH_SOURCE}")
echo "Verifying gofmt"
files=$(gofmt -l -s $(find . -type f -name "*.go" -not -path "./vendor/*" -not -path "./pkg/generated/*" -not -name "zz_generated*"))
if [[ -n "${files}" ]]; then
echo "The following files need gofmt updating - please run 'make update'"
echo "${files}"
exit 1
fi
echo "Success!"
echo "Verifying goimports"
command -v goimports > /dev/null || go get golang.org/x/tools/cmd/goimports
goimports -l $(find . -type f -name "*.go" -not -path "./vendor/*" -not -path "./pkg/generated/*" -not -name "zz_generated*")
echo "Success!"
HACK_DIR=$(dirname "${BASH_SOURCE[0]}")
"${HACK_DIR}"/update-fmt.sh --verify

View File

@@ -1,6 +1,6 @@
#!/bin/bash -e
#
# Copyright 2017 the Heptio Ark contributors.
# Copyright 2017 the Velero contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View File

@@ -1,6 +1,6 @@
#!/bin/bash -e
#
# Copyright 2017 the Heptio Ark contributors.
# Copyright 2018 the Velero contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -14,10 +14,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
ARK_ROOT=$(dirname ${BASH_SOURCE})/..
VELERO_ROOT=$(dirname ${BASH_SOURCE})/..
HACK_DIR=$(dirname "${BASH_SOURCE}")
DOCS_DIR=${ARK_ROOT}/docs/cli-reference
TMP_DIR="$(mktemp -d)"
ISSUE_TEMPLATE_FILE=${VELERO_ROOT}/.github/ISSUE_TEMPLATE/bug_report.md
OUT_TMP_FILE="$(mktemp -d)"/bug_report.md
trap cleanup INT TERM HUP EXIT
@@ -25,15 +26,12 @@ cleanup() {
rm -rf ${TMP_DIR}
}
echo "Verifying generated docs"
${HACK_DIR}/update-generated-docs.sh ${TMP_DIR} > /dev/null
exclude_file="README.md"
output=$(echo "`diff -r ${DOCS_DIR} ${TMP_DIR}`" | sed "/${exclude_file}/d")
echo "Verifying generated Github issue template"
${HACK_DIR}/update-generated-issue-template.sh ${OUT_TMP_FILE} > /dev/null
output=$(echo "`diff ${ISSUE_TEMPLATE_FILE} ${OUT_TMP_FILE}`")
if [[ -n "${output}" ]] ; then
echo "FAILURE: verification of docs failed:"
echo "FAILURE: verification of generated template failed:"
echo "${output}"
exit 1
fi

4
netlify.toml Normal file
View File

@@ -0,0 +1,4 @@
[build]
base = "site/"
command = "jekyll build"
publish = "site/_site"

View File

@@ -1,89 +0,0 @@
/*
Copyright 2017 the Heptio Ark contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ConfigList is a list of Configs.
type ConfigList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []Config `json:"items"`
}
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// Config is an Ark resource that captures configuration information to be
// used for running the Ark server.
type Config struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`
// PersistentVolumeProvider is the configuration information for the cloud where
// the cluster is running and has PersistentVolumes to snapshot or restore. Optional.
PersistentVolumeProvider *CloudProviderConfig `json:"persistentVolumeProvider"`
// BackupStorageProvider is the configuration information for the cloud where
// Ark backups are stored in object storage. This may be a different cloud than
// where the cluster is running.
BackupStorageProvider ObjectStorageProviderConfig `json:"backupStorageProvider"`
// BackupSyncPeriod is how often the BackupSyncController runs to ensure all
// Ark backups in object storage exist as Backup API objects in the cluster.
BackupSyncPeriod metav1.Duration `json:"backupSyncPeriod"`
// GCSyncPeriod is how often the GCController runs to delete expired backup
// API objects and corresponding backup files in object storage.
GCSyncPeriod metav1.Duration `json:"gcSyncPeriod"`
// ScheduleSyncPeriod is how often the ScheduleController runs to check for
// new backups that should be triggered based on schedules.
ScheduleSyncPeriod metav1.Duration `json:"scheduleSyncPeriod"`
// ResourcePriorities is an ordered slice of resources specifying the desired
// order of resource restores. Any resources not in the list will be restored
// alphabetically after the prioritized resources.
ResourcePriorities []string `json:"resourcePriorities"`
// RestoreOnlyMode is whether Ark should run in a mode where only restores
// are allowed; backups, schedules, and garbage-collection are all disabled.
RestoreOnlyMode bool `json:"restoreOnlyMode"`
}
// CloudProviderConfig is configuration information about how to connect
// to a particular cloud.
type CloudProviderConfig struct {
Name string `json:"name"`
Config map[string]string `json:"config"`
}
// ObjectStorageProviderConfig is configuration information for connecting to
// a particular bucket in object storage to access Ark backups.
type ObjectStorageProviderConfig struct {
// CloudProviderConfig is the configuration information for the cloud where
// Ark backups are stored in object storage.
CloudProviderConfig `json:",inline"`
// Bucket is the name of the bucket in object storage where Ark backups
// are stored.
Bucket string `json:"bucket"`
}

View File

@@ -1,5 +1,5 @@
/*
Copyright 2017 the Heptio Ark contributors.
Copyright 2017, 2019 the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -16,9 +16,11 @@ limitations under the License.
package v1
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// BackupSpec defines the specification for an Ark backup.
// BackupSpec defines the specification for a Velero backup.
type BackupSpec struct {
// IncludedNamespaces is a slice of namespace names to include objects
// from. If empty, all namespaces are included.
@@ -44,7 +46,7 @@ type BackupSpec struct {
// SnapshotVolumes specifies whether to take cloud snapshots
// of any PV's referenced in the set of objects included
// in the Backup.
SnapshotVolumes *bool `json:"snapshotVolumes"`
SnapshotVolumes *bool `json:"snapshotVolumes,omitempty"`
// TTL is a time.Duration-parseable string describing how long
// the Backup should be retained for.
@@ -56,6 +58,12 @@ type BackupSpec struct {
// Hooks represent custom behaviors that should be executed at different phases of the backup.
Hooks BackupHooks `json:"hooks"`
// StorageLocation is a string containing the name of a BackupStorageLocation where the backup should be stored.
StorageLocation string `json:"storageLocation"`
// VolumeSnapshotLocations is a list containing names of VolumeSnapshotLocations associated with this backup.
VolumeSnapshotLocations []string `json:"volumeSnapshotLocations"`
}
// BackupHooks contains custom behaviors that should be executed at different phases of the backup.
@@ -80,9 +88,7 @@ type BackupResourceHookSpec struct {
// ExcludedResources specifies the resources to which this hook spec does not apply.
ExcludedResources []string `json:"excludedResources"`
// LabelSelector, if specified, filters the resources to which this hook spec applies.
LabelSelector *metav1.LabelSelector `json:"labelSelector"`
// Hooks is a list of BackupResourceHooks to execute. DEPRECATED. Replaced by PreHooks.
Hooks []BackupResourceHook `json:"hooks"`
LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"`
// PreHooks is a list of BackupResourceHooks to execute prior to storing the item in the backup.
// These are executed before any "additional items" from item actions are processed.
PreHooks []BackupResourceHook `json:"pre,omitempty"`
@@ -104,14 +110,14 @@ type ExecHook struct {
Container string `json:"container"`
// Command is the command and arguments to execute.
Command []string `json:"command"`
// OnError specifies how Ark should behave if it encounters an error executing this hook.
// OnError specifies how Velero should behave if it encounters an error executing this hook.
OnError HookErrorMode `json:"onError"`
// Timeout defines the maximum amount of time Ark should wait for the hook to complete before
// Timeout defines the maximum amount of time Velero should wait for the hook to complete before
// considering the execution a failure.
Timeout metav1.Duration `json:"timeout"`
}
// HookErrorMode defines how Ark should treat an error from a hook.
// HookErrorMode defines how Velero should treat an error from a hook.
type HookErrorMode string
const (
@@ -124,7 +130,7 @@ const (
)
// BackupPhase is a string representation of the lifecycle phase
// of an Ark backup.
// of a Velero backup.
type BackupPhase string
const (
@@ -143,6 +149,10 @@ const (
// errors.
BackupPhaseCompleted BackupPhase = "Completed"
// BackupPhasePartiallyFailed means the backup has run to completion
// but encountered 1+ errors backing up individual items.
BackupPhasePartiallyFailed BackupPhase = "PartiallyFailed"
// BackupPhaseFailed means the backup ran but encountered an error that
// prevented it from completing successfully.
BackupPhaseFailed BackupPhase = "Failed"
@@ -151,7 +161,7 @@ const (
BackupPhaseDeleting BackupPhase = "Deleting"
)
// BackupStatus captures the current status of an Ark backup.
// BackupStatus captures the current status of a Velero backup.
type BackupStatus struct {
// Version is the backup format version.
Version int `json:"version"`
@@ -162,41 +172,45 @@ type BackupStatus struct {
// Phase is the current state of the Backup.
Phase BackupPhase `json:"phase"`
// VolumeBackups is a map of PersistentVolume names to
// information about the backed-up volume in the cloud
// provider API.
VolumeBackups map[string]*VolumeBackupInfo `json:"volumeBackups"`
// ValidationErrors is a slice of all validation errors (if
// applicable).
ValidationErrors []string `json:"validationErrors"`
}
// VolumeBackupInfo captures the required information about
// a PersistentVolume at backup time to be able to restore
// it later.
type VolumeBackupInfo struct {
// SnapshotID is the ID of the snapshot taken in the cloud
// provider API of this volume.
SnapshotID string `json:"snapshotID"`
// StartTimestamp records the time a backup was started.
// Separate from CreationTimestamp, since that value changes
// on restores.
// The server's time is used for StartTimestamps
StartTimestamp metav1.Time `json:"startTimestamp"`
// Type is the type of the disk/volume in the cloud provider
// API.
Type string `json:"type"`
// CompletionTimestamp records the time a backup was completed.
// Completion time is recorded even on failed backups.
// Completion time is recorded before uploading the backup object.
// The server's time is used for CompletionTimestamps
CompletionTimestamp metav1.Time `json:"completionTimestamp"`
// AvailabilityZone is the where the volume is provisioned
// in the cloud provider.
AvailabilityZone string `json:"availabilityZone,omitempty"`
// VolumeSnapshotsAttempted is the total number of attempted
// volume snapshots for this backup.
VolumeSnapshotsAttempted int `json:"volumeSnapshotsAttempted"`
// Iops is the optional value of provisioned IOPS for the
// disk/volume in the cloud provider API.
Iops *int64 `json:"iops,omitempty"`
// VolumeSnapshotsCompleted is the total number of successfully
// completed volume snapshots for this backup.
VolumeSnapshotsCompleted int `json:"volumeSnapshotsCompleted"`
// Warnings is a count of all warning messages that were generated during
// execution of the backup. The actual warnings are in the backup's log
// file in object storage.
Warnings int `json:"warnings"`
// Errors is a count of all error messages that were generated during
// execution of the backup. The actual errors are in the backup's log
// file in object storage.
Errors int `json:"errors"`
}
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// Backup is an Ark resource that respresents the capture of Kubernetes
// Backup is a Velero resource that respresents the capture of Kubernetes
// cluster state at a point in time (API objects and associated volume state).
type Backup struct {
metav1.TypeMeta `json:",inline"`

View File

@@ -0,0 +1,109 @@
/*
Copyright 2018 the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
)
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// BackupStorageLocation is a location where Velero stores backup objects.
type BackupStorageLocation struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`
Spec BackupStorageLocationSpec `json:"spec"`
Status BackupStorageLocationStatus `json:"status"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// BackupStorageLocationList is a list of BackupStorageLocations.
type BackupStorageLocationList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []BackupStorageLocation `json:"items"`
}
// StorageType represents the type of storage that a backup location uses.
// ObjectStorage must be non-nil, since it is currently the only supported StorageType.
type StorageType struct {
ObjectStorage *ObjectStorageLocation `json:"objectStorage,omitempty"`
}
// ObjectStorageLocation specifies the settings necessary to connect to a provider's object storage.
type ObjectStorageLocation struct {
// Bucket is the bucket to use for object storage.
Bucket string `json:"bucket"`
// Prefix is the path inside a bucket to use for Velero storage. Optional.
Prefix string `json:"prefix"`
}
// BackupStorageLocationSpec defines the specification for a Velero BackupStorageLocation.
type BackupStorageLocationSpec struct {
// Provider is the provider of the backup storage.
Provider string `json:"provider"`
// Config is for provider-specific configuration fields.
Config map[string]string `json:"config"`
StorageType `json:",inline"`
// AccessMode defines the permissions for the backup storage location.
AccessMode BackupStorageLocationAccessMode `json:"accessMode,omitempty"`
}
// BackupStorageLocationPhase is the lifecyle phase of a Velero BackupStorageLocation.
type BackupStorageLocationPhase string
const (
// BackupStorageLocationPhaseAvailable means the location is available to read and write from.
BackupStorageLocationPhaseAvailable BackupStorageLocationPhase = "Available"
// BackupStorageLocationPhaseUnavailable means the location is unavailable to read and write from.
BackupStorageLocationPhaseUnavailable BackupStorageLocationPhase = "Unavailable"
)
// BackupStorageLocationAccessMode represents the permissions for a BackupStorageLocation.
type BackupStorageLocationAccessMode string
const (
// BackupStorageLocationAccessModeReadOnly represents read-only access to a BackupStorageLocation.
BackupStorageLocationAccessModeReadOnly BackupStorageLocationAccessMode = "ReadOnly"
// BackupStorageLocationAccessModeReadWrite represents read and write access to a BackupStorageLocation.
BackupStorageLocationAccessModeReadWrite BackupStorageLocationAccessMode = "ReadWrite"
)
// TODO(2.0): remove the AccessMode field from BackupStorageLocationStatus.
// BackupStorageLocationStatus describes the current status of a Velero BackupStorageLocation.
type BackupStorageLocationStatus struct {
Phase BackupStorageLocationPhase `json:"phase,omitempty"`
LastSyncedRevision types.UID `json:"lastSyncedRevision,omitempty"`
LastSyncedTime metav1.Time `json:"lastSyncedTime,omitempty"`
// AccessMode is an unused field.
//
// Deprecated: there is now an AccessMode field on the Spec and this field
// will be removed entirely as of v2.0.
AccessMode BackupStorageLocationAccessMode `json:"accessMode,omitempty"`
}

View File

@@ -1,5 +1,5 @@
/*
Copyright 2017 the Heptio Ark contributors.
Copyright 2017 the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -18,23 +18,22 @@ package v1
const (
// DefaultNamespace is the Kubernetes namespace that is used by default for
// the Ark server and API objects.
DefaultNamespace = "heptio-ark"
// the Velero server and API objects.
DefaultNamespace = "velero"
// ResourcesDir is a top-level directory expected in backups which contains sub-directories
// for each resource type in the backup.
ResourcesDir = "resources"
// RestoreLabelKey is the label key that's applied to all resources that
// are created during a restore. This is applied for ease of identification
// of restored resources. The value will be the restore's name.
RestoreLabelKey = "ark-restore"
// MetadataDir is a top-level directory expected in backups which contains
// files that store metadata about the backup, such as the backup version.
MetadataDir = "metadata"
// ClusterScopedDir is the name of the directory containing cluster-scoped
// resources within an Ark backup.
// resources within a Velero backup.
ClusterScopedDir = "cluster"
// NamespaceScopedDir is the name of the directory containing namespace-scoped
// resource within an Ark backup.
// resource within a Velero backup.
NamespaceScopedDir = "namespaces"
)

View File

@@ -1,5 +1,5 @@
/*
Copyright 2018 the Heptio Ark contributors.
Copyright 2018 the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -33,11 +33,6 @@ const (
DeleteBackupRequestPhaseInProgress DeleteBackupRequestPhase = "InProgress"
// DeleteBackupRequestPhaseProcessed means the DeleteBackupRequest has been processed.
DeleteBackupRequestPhaseProcessed DeleteBackupRequestPhase = "Processed"
// BackupNameLabel is the label key used by a DeleteBackupRequest to identify its backup by name.
BackupNameLabel = "ark.heptio.com/backup-name"
// BackupUIDLabel is the label key used by a DeleteBackupRequest to identify its backup by uid.
BackupUIDLabel = "ark.heptio.com/backup-uid"
)
// DeleteBackupRequestStatus is the current status of a DeleteBackupRequest.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2017 the Heptio Ark contributors.
Copyright 2017 the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -17,5 +17,5 @@ limitations under the License.
// +k8s:deepcopy-gen=package
// Package v1 is the v1 version of the API.
// +groupName=ark.heptio.com
// +groupName=velero.io
package v1

View File

@@ -1,5 +1,5 @@
/*
Copyright 2017 the Heptio Ark contributors.
Copyright 2017 the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -28,10 +28,12 @@ type DownloadRequestSpec struct {
type DownloadTargetKind string
const (
DownloadTargetKindBackupLog DownloadTargetKind = "BackupLog"
DownloadTargetKindBackupContents DownloadTargetKind = "BackupContents"
DownloadTargetKindRestoreLog DownloadTargetKind = "RestoreLog"
DownloadTargetKindRestoreResults DownloadTargetKind = "RestoreResults"
DownloadTargetKindBackupLog DownloadTargetKind = "BackupLog"
DownloadTargetKindBackupContents DownloadTargetKind = "BackupContents"
DownloadTargetKindBackupVolumeSnapshots DownloadTargetKind = "BackupVolumeSnapshots"
DownloadTargetKindBackupResourceList DownloadTargetKind = "BackupResourceList"
DownloadTargetKindRestoreLog DownloadTargetKind = "RestoreLog"
DownloadTargetKindRestoreResults DownloadTargetKind = "RestoreResults"
)
// DownloadTarget is the specification for what kind of file to download, and the name of the

View File

@@ -0,0 +1,50 @@
/*
Copyright 2018 the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1
const (
// BackupNameLabel is the label key used to identify a backup by name.
BackupNameLabel = "velero.io/backup-name"
// BackupUIDLabel is the label key used to identify a backup by uid.
BackupUIDLabel = "velero.io/backup-uid"
// RestoreNameLabel is the label key used to identify a restore by name.
RestoreNameLabel = "velero.io/restore-name"
// ScheduleNameLabel is the label key used to identify a schedule by name.
ScheduleNameLabel = "velero.io/schedule-name"
// RestoreUIDLabel is the label key used to identify a restore by uid.
RestoreUIDLabel = "velero.io/restore-uid"
// PodUIDLabel is the label key used to identify a pod by uid.
PodUIDLabel = "velero.io/pod-uid"
// PodVolumeOperationTimeoutAnnotation is the annotation key used to apply
// a backup/restore-specific timeout value for pod volume operations (i.e.
// restic backups/restores).
PodVolumeOperationTimeoutAnnotation = "velero.io/pod-volume-timeout"
// StorageLocationLabel is the label key used to identify the storage
// location of a backup.
StorageLocationLabel = "velero.io/storage-location"
// ResticVolumeNamespaceLabel is the label key used to identify which
// namespace a restic repository stores pod volume backups for.
ResticVolumeNamespaceLabel = "velero.io/volume-namespace"
)

View File

@@ -0,0 +1,103 @@
/*
Copyright 2018 the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1
import (
corev1api "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// PodVolumeBackupSpec is the specification for a PodVolumeBackup.
type PodVolumeBackupSpec struct {
// Node is the name of the node that the Pod is running on.
Node string `json:"node"`
// Pod is a reference to the pod containing the volume to be backed up.
Pod corev1api.ObjectReference `json:"pod"`
// Volume is the name of the volume within the Pod to be backed
// up.
Volume string `json:"volume"`
// BackupStorageLocation is the name of the backup storage location
// where the restic repository is stored.
BackupStorageLocation string `json:"backupStorageLocation"`
// RepoIdentifier is the restic repository identifier.
RepoIdentifier string `json:"repoIdentifier"`
// Tags are a map of key-value pairs that should be applied to the
// volume backup as tags.
Tags map[string]string `json:"tags"`
}
// PodVolumeBackupPhase represents the lifecycle phase of a PodVolumeBackup.
type PodVolumeBackupPhase string
const (
PodVolumeBackupPhaseNew PodVolumeBackupPhase = "New"
PodVolumeBackupPhaseInProgress PodVolumeBackupPhase = "InProgress"
PodVolumeBackupPhaseCompleted PodVolumeBackupPhase = "Completed"
PodVolumeBackupPhaseFailed PodVolumeBackupPhase = "Failed"
)
// PodVolumeBackupStatus is the current status of a PodVolumeBackup.
type PodVolumeBackupStatus struct {
// Phase is the current state of the PodVolumeBackup.
Phase PodVolumeBackupPhase `json:"phase"`
// Path is the full path within the controller pod being backed up.
Path string `json:"path"`
// SnapshotID is the identifier for the snapshot of the pod volume.
SnapshotID string `json:"snapshotID"`
// Message is a message about the pod volume backup's status.
Message string `json:"message"`
// StartTimestamp records the time a backup was started.
// Separate from CreationTimestamp, since that value changes
// on restores.
// The server's time is used for StartTimestamps
StartTimestamp metav1.Time `json:"startTimestamp"`
// CompletionTimestamp records the time a backup was completed.
// Completion time is recorded even on failed backups.
// Completion time is recorded before uploading the backup object.
// The server's time is used for CompletionTimestamps
CompletionTimestamp metav1.Time `json:"completionTimestamp"`
}
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type PodVolumeBackup struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`
Spec PodVolumeBackupSpec `json:"spec"`
Status PodVolumeBackupStatus `json:"status,omitempty"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// PodVolumeBackupList is a list of PodVolumeBackups.
type PodVolumeBackupList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []PodVolumeBackup `json:"items"`
}

View File

@@ -0,0 +1,89 @@
/*
Copyright 2018 the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1
import (
corev1api "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// PodVolumeRestoreSpec is the specification for a PodVolumeRestore.
type PodVolumeRestoreSpec struct {
// Pod is a reference to the pod containing the volume to be restored.
Pod corev1api.ObjectReference `json:"pod"`
// Volume is the name of the volume within the Pod to be restored.
Volume string `json:"volume"`
// BackupStorageLocation is the name of the backup storage location
// where the restic repository is stored.
BackupStorageLocation string `json:"backupStorageLocation"`
// RepoIdentifier is the restic repository identifier.
RepoIdentifier string `json:"repoIdentifier"`
// SnapshotID is the ID of the volume snapshot to be restored.
SnapshotID string `json:"snapshotID"`
}
// PodVolumeRestorePhase represents the lifecycle phase of a PodVolumeRestore.
type PodVolumeRestorePhase string
const (
PodVolumeRestorePhaseNew PodVolumeRestorePhase = "New"
PodVolumeRestorePhaseInProgress PodVolumeRestorePhase = "InProgress"
PodVolumeRestorePhaseCompleted PodVolumeRestorePhase = "Completed"
PodVolumeRestorePhaseFailed PodVolumeRestorePhase = "Failed"
)
// PodVolumeRestoreStatus is the current status of a PodVolumeRestore.
type PodVolumeRestoreStatus struct {
// Phase is the current state of the PodVolumeRestore.
Phase PodVolumeRestorePhase `json:"phase"`
// Message is a message about the pod volume restore's status.
Message string `json:"message"`
// StartTimestamp records the time a restore was started.
// The server's time is used for StartTimestamps
StartTimestamp metav1.Time `json:"startTimestamp"`
// CompletionTimestamp records the time a restore was completed.
// Completion time is recorded even on failed restores.
// The server's time is used for CompletionTimestamps
CompletionTimestamp metav1.Time `json:"completionTimestamp"`
}
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type PodVolumeRestore struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`
Spec PodVolumeRestoreSpec `json:"spec"`
Status PodVolumeRestoreStatus `json:"status,omitempty"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// PodVolumeRestoreList is a list of PodVolumeRestores.
type PodVolumeRestoreList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []PodVolumeRestore `json:"items"`
}

View File

@@ -0,0 +1,83 @@
/*
Copyright 2017 the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)
var (
// SchemeBuilder collects the scheme builder functions for the Velero API
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
// AddToScheme applies the SchemeBuilder functions to a specified scheme
AddToScheme = SchemeBuilder.AddToScheme
)
// GroupName is the group name for the Velero API
const GroupName = "velero.io"
// SchemeGroupVersion is the GroupVersion for the Velero API
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}
// Resource gets a Velero GroupResource for a specified resource
func Resource(resource string) schema.GroupResource {
return SchemeGroupVersion.WithResource(resource).GroupResource()
}
type typeInfo struct {
PluralName string
ItemType runtime.Object
ItemListType runtime.Object
}
func newTypeInfo(pluralName string, itemType, itemListType runtime.Object) typeInfo {
return typeInfo{
PluralName: pluralName,
ItemType: itemType,
ItemListType: itemListType,
}
}
// CustomResources returns a map of all custom resources within the Velero
// API group, keyed on Kind.
func CustomResources() map[string]typeInfo {
return map[string]typeInfo{
"Backup": newTypeInfo("backups", &Backup{}, &BackupList{}),
"Restore": newTypeInfo("restores", &Restore{}, &RestoreList{}),
"Schedule": newTypeInfo("schedules", &Schedule{}, &ScheduleList{}),
"DownloadRequest": newTypeInfo("downloadrequests", &DownloadRequest{}, &DownloadRequestList{}),
"DeleteBackupRequest": newTypeInfo("deletebackuprequests", &DeleteBackupRequest{}, &DeleteBackupRequestList{}),
"PodVolumeBackup": newTypeInfo("podvolumebackups", &PodVolumeBackup{}, &PodVolumeBackupList{}),
"PodVolumeRestore": newTypeInfo("podvolumerestores", &PodVolumeRestore{}, &PodVolumeRestoreList{}),
"ResticRepository": newTypeInfo("resticrepositories", &ResticRepository{}, &ResticRepositoryList{}),
"BackupStorageLocation": newTypeInfo("backupstoragelocations", &BackupStorageLocation{}, &BackupStorageLocationList{}),
"VolumeSnapshotLocation": newTypeInfo("volumesnapshotlocations", &VolumeSnapshotLocation{}, &VolumeSnapshotLocationList{}),
"ServerStatusRequest": newTypeInfo("serverstatusrequests", &ServerStatusRequest{}, &ServerStatusRequestList{}),
}
}
func addKnownTypes(scheme *runtime.Scheme) error {
for _, typeInfo := range CustomResources() {
scheme.AddKnownTypes(SchemeGroupVersion, typeInfo.ItemType, typeInfo.ItemListType)
}
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
}

View File

@@ -0,0 +1,80 @@
/*
Copyright 2018 the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// ResticRepositorySpec is the specification for a ResticRepository.
type ResticRepositorySpec struct {
// VolumeNamespace is the namespace this restic repository contains
// pod volume backups for.
VolumeNamespace string `json:"volumeNamespace"`
// BackupStorageLocation is the name of the BackupStorageLocation
// that should contain this repository.
BackupStorageLocation string `json:"backupStorageLocation"`
// ResticIdentifier is the full restic-compatible string for identifying
// this repository.
ResticIdentifier string `json:"resticIdentifier"`
// MaintenanceFrequency is how often maintenance should be run.
MaintenanceFrequency metav1.Duration `json:"maintenanceFrequency"`
}
// ResticRepositoryPhase represents the lifecycle phase of a ResticRepository.
type ResticRepositoryPhase string
const (
ResticRepositoryPhaseNew ResticRepositoryPhase = "New"
ResticRepositoryPhaseReady ResticRepositoryPhase = "Ready"
ResticRepositoryPhaseNotReady ResticRepositoryPhase = "NotReady"
)
// ResticRepositoryStatus is the current status of a ResticRepository.
type ResticRepositoryStatus struct {
// Phase is the current state of the ResticRepository.
Phase ResticRepositoryPhase `json:"phase"`
// Message is a message about the current status of the ResticRepository.
Message string `json:"message"`
// LastMaintenanceTime is the last time maintenance was run.
LastMaintenanceTime metav1.Time `json:"lastMaintenanceTime"`
}
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type ResticRepository struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`
Spec ResticRepositorySpec `json:"spec"`
Status ResticRepositoryStatus `json:"status,omitempty"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ResticRepositoryList is a list of ResticRepositories.
type ResticRepositoryList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []ResticRepository `json:"items"`
}

View File

@@ -1,5 +1,5 @@
/*
Copyright 2017 the Heptio Ark contributors.
Copyright 2017, 2019 the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -18,12 +18,17 @@ package v1
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// RestoreSpec defines the specification for an Ark restore.
// RestoreSpec defines the specification for a Velero restore.
type RestoreSpec struct {
// BackupName is the unique name of the Ark backup to restore
// BackupName is the unique name of the Velero backup to restore
// from.
BackupName string `json:"backupName"`
// ScheduleName is the unique name of the Velero schedule to restore
// from. If specified, and BackupName is empty, Velero will restore
// from the most recent successful backup created from this schedule.
ScheduleName string `json:"scheduleName,omitempty"`
// IncludedNamespaces is a slice of namespace names to include objects
// from. If empty, all namespaces are included.
IncludedNamespaces []string `json:"includedNamespaces"`
@@ -49,20 +54,20 @@ type RestoreSpec struct {
// LabelSelector is a metav1.LabelSelector to filter with
// when restoring individual objects from the backup. If empty
// or nil, all objects are included. Optional.
LabelSelector *metav1.LabelSelector `json:"labelSelector"`
LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"`
// RestorePVs specifies whether to restore all included
// PVs from snapshot (via the cloudprovider).
RestorePVs *bool `json:"restorePVs"`
RestorePVs *bool `json:"restorePVs,omitempty"`
// IncludeClusterResources specifies whether cluster-scoped resources
// should be included for consideration in the restore. If null, defaults
// to true.
IncludeClusterResources *bool `json:"includeClusterResources"`
IncludeClusterResources *bool `json:"includeClusterResources,omitempty"`
}
// RestorePhase is a string representation of the lifecycle phase
// of an Ark restore
// of a Velero restore
type RestorePhase string
const (
@@ -77,12 +82,20 @@ const (
// RestorePhaseInProgress means the restore is currently executing.
RestorePhaseInProgress RestorePhase = "InProgress"
// RestorePhaseCompleted means the restore has finished executing.
// Any relevant warnings or errors will be captured in the Status.
// RestorePhaseCompleted means the restore has run successfully
// without errors.
RestorePhaseCompleted RestorePhase = "Completed"
// RestorePhasePartiallyFailed means the restore has run to completion
// but encountered 1+ errors restoring individual items.
RestorePhasePartiallyFailed RestorePhase = "PartiallyFailed"
// RestorePhaseFailed means the restore was unable to execute.
// The failing error is recorded in status.FailureReason.
RestorePhaseFailed RestorePhase = "Failed"
)
// RestoreStatus captures the current status of an Ark restore
// RestoreStatus captures the current status of a Velero restore
type RestoreStatus struct {
// Phase is the current state of the Restore
Phase RestorePhase `json:"phase"`
@@ -98,31 +111,16 @@ type RestoreStatus struct {
// Errors is a count of all error messages that were generated during
// execution of the restore. The actual errors are stored in object storage.
Errors int `json:"errors"`
}
// RestoreResult is a collection of messages that were generated
// during execution of a restore. This will typically store either
// warning or error messages.
type RestoreResult struct {
// Ark is a slice of messages related to the operation of Ark
// itself (for example, messages related to connecting to the
// cloud, reading a backup file, etc.)
Ark []string `json:"ark"`
// Cluster is a slice of messages related to restoring cluster-
// scoped resources.
Cluster []string `json:"cluster"`
// Namespaces is a map of namespace name to slice of messages
// related to restoring namespace-scoped resources.
Namespaces map[string][]string `json:"namespaces"`
// FailureReason is an error that caused the entire restore to fail.
FailureReason string `json:"failureReason"`
}
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// Restore is an Ark resource that represents the application of
// resources from an Ark backup to a target Kubernetes cluster.
// Restore is a Velero resource that represents the application of
// resources from a Velero backup to a target Kubernetes cluster.
type Restore struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`

View File

@@ -1,5 +1,5 @@
/*
Copyright 2017 the Heptio Ark contributors.
Copyright 2017 the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@ package v1
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// ScheduleSpec defines the specification for an Ark schedule
// ScheduleSpec defines the specification for a Velero schedule
type ScheduleSpec struct {
// Template is the definition of the Backup to be run
// on the provided schedule
@@ -30,7 +30,7 @@ type ScheduleSpec struct {
}
// SchedulePhase is a string representation of the lifecycle phase
// of an Ark schedule
// of a Velero schedule
type SchedulePhase string
const (
@@ -47,7 +47,7 @@ const (
SchedulePhaseFailedValidation SchedulePhase = "FailedValidation"
)
// ScheduleStatus captures the current state of an Ark schedule
// ScheduleStatus captures the current state of a Velero schedule
type ScheduleStatus struct {
// Phase is the current phase of the Schedule
Phase SchedulePhase `json:"phase"`
@@ -64,7 +64,7 @@ type ScheduleStatus struct {
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// Schedule is an Ark resource that represents a pre-scheduled or
// Schedule is a Velero resource that represents a pre-scheduled or
// periodic Backup that should be run.
type Schedule struct {
metav1.TypeMeta `json:",inline"`

View File

@@ -0,0 +1,79 @@
/*
Copyright 2018 the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ServerStatusRequest is a request to access current status information about
// the Velero server.
type ServerStatusRequest struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`
Spec ServerStatusRequestSpec `json:"spec"`
Status ServerStatusRequestStatus `json:"status,omitempty"`
}
// ServerStatusRequestSpec is the specification for a ServerStatusRequest.
type ServerStatusRequestSpec struct {
}
// ServerStatusRequestPhase represents the lifecycle phase of a ServerStatusRequest.
type ServerStatusRequestPhase string
const (
// ServerStatusRequestPhaseNew means the ServerStatusRequest has not been processed yet.
ServerStatusRequestPhaseNew ServerStatusRequestPhase = "New"
// ServerStatusRequestPhaseProcessed means the ServerStatusRequest has been processed.
ServerStatusRequestPhaseProcessed ServerStatusRequestPhase = "Processed"
)
// PluginInfo contains attributes of a Velero plugin
type PluginInfo struct {
Name string `json:"name"`
Kind string `json:"kind"`
}
// ServerStatusRequestStatus is the current status of a ServerStatusRequest.
type ServerStatusRequestStatus struct {
// Phase is the current lifecycle phase of the ServerStatusRequest.
Phase ServerStatusRequestPhase `json:"phase"`
// ProcessedTimestamp is when the ServerStatusRequest was processed
// by the ServerStatusRequestController.
ProcessedTimestamp metav1.Time `json:"processedTimestamp"`
// ServerVersion is the Velero server version.
ServerVersion string `json:"serverVersion"`
// Plugins list information about the plugins running on the Velero server
Plugins []PluginInfo `json:"plugins"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ServerStatusRequestList is a list of ServerStatusRequests.
type ServerStatusRequestList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []ServerStatusRequest `json:"items"`
}

View File

@@ -0,0 +1,65 @@
/*
Copyright 2018 the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// VolumeSnapshotLocation is a location where Velero stores volume snapshots.
type VolumeSnapshotLocation struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`
Spec VolumeSnapshotLocationSpec `json:"spec"`
Status VolumeSnapshotLocationStatus `json:"status"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// VolumeSnapshotLocationList is a list of VolumeSnapshotLocations.
type VolumeSnapshotLocationList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []VolumeSnapshotLocation `json:"items"`
}
// VolumeSnapshotLocationSpec defines the specification for a Velero VolumeSnapshotLocation.
type VolumeSnapshotLocationSpec struct {
// Provider is the provider of the volume storage.
Provider string `json:"provider"`
// Config is for provider-specific configuration fields.
Config map[string]string `json:"config"`
}
// VolumeSnapshotLocationPhase is the lifecyle phase of a Velero VolumeSnapshotLocation.
type VolumeSnapshotLocationPhase string
const (
// VolumeSnapshotLocationPhaseAvailable means the location is available to read and write from.
VolumeSnapshotLocationPhaseAvailable VolumeSnapshotLocationPhase = "Available"
// VolumeSnapshotLocationPhaseUnavailable means the location is unavailable to read and write from.
VolumeSnapshotLocationPhaseUnavailable VolumeSnapshotLocationPhase = "Unavailable"
)
// VolumeSnapshotLocationStatus describes the current status of a Velero VolumeSnapshotLocation.
type VolumeSnapshotLocationStatus struct {
Phase VolumeSnapshotLocationPhase `json:"phase,omitempty"`
}

View File

@@ -1,5 +1,5 @@
/*
Copyright 2017 the Heptio Ark contributors.
Copyright 2017 the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -19,50 +19,49 @@ package backup
import (
"archive/tar"
"compress/gzip"
"context"
"fmt"
"io"
"path/filepath"
"time"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime/schema"
kuberrs "k8s.io/apimachinery/pkg/util/errors"
api "github.com/heptio/ark/pkg/apis/ark/v1"
"github.com/heptio/ark/pkg/client"
"github.com/heptio/ark/pkg/cloudprovider"
"github.com/heptio/ark/pkg/discovery"
"github.com/heptio/ark/pkg/util/collections"
kubeutil "github.com/heptio/ark/pkg/util/kube"
"github.com/heptio/ark/pkg/util/logging"
api "github.com/heptio/velero/pkg/apis/velero/v1"
"github.com/heptio/velero/pkg/client"
"github.com/heptio/velero/pkg/discovery"
"github.com/heptio/velero/pkg/plugin/velero"
"github.com/heptio/velero/pkg/podexec"
"github.com/heptio/velero/pkg/restic"
"github.com/heptio/velero/pkg/util/collections"
)
// BackupVersion is the current backup version for Velero.
const BackupVersion = 1
// Backupper performs backups.
type Backupper interface {
// Backup takes a backup using the specification in the api.Backup and writes backup and log data
// to the given writers.
Backup(backup *api.Backup, backupFile, logFile io.Writer, actions []ItemAction) error
Backup(logger logrus.FieldLogger, backup *Request, backupFile io.Writer, actions []velero.BackupItemAction, volumeSnapshotterGetter VolumeSnapshotterGetter) error
}
// kubernetesBackupper implements Backupper.
type kubernetesBackupper struct {
dynamicFactory client.DynamicFactory
discoveryHelper discovery.Helper
podCommandExecutor podCommandExecutor
groupBackupperFactory groupBackupperFactory
snapshotService cloudprovider.SnapshotService
}
type itemKey struct {
resource string
namespace string
name string
dynamicFactory client.DynamicFactory
discoveryHelper discovery.Helper
podCommandExecutor podexec.PodCommandExecutor
groupBackupperFactory groupBackupperFactory
resticBackupperFactory restic.BackupperFactory
resticTimeout time.Duration
}
type resolvedAction struct {
ItemAction
velero.BackupItemAction
resourceIncludesExcludes *collections.IncludesExcludes
namespaceIncludesExcludes *collections.IncludesExcludes
@@ -73,23 +72,35 @@ func (i *itemKey) String() string {
return fmt.Sprintf("resource=%s,namespace=%s,name=%s", i.resource, i.namespace, i.name)
}
func cohabitatingResources() map[string]*cohabitatingResource {
return map[string]*cohabitatingResource{
"deployments": newCohabitatingResource("deployments", "extensions", "apps"),
"daemonsets": newCohabitatingResource("daemonsets", "extensions", "apps"),
"replicasets": newCohabitatingResource("replicasets", "extensions", "apps"),
"networkpolicies": newCohabitatingResource("networkpolicies", "extensions", "networking.k8s.io"),
"events": newCohabitatingResource("events", "", "events.k8s.io"),
}
}
// NewKubernetesBackupper creates a new kubernetesBackupper.
func NewKubernetesBackupper(
discoveryHelper discovery.Helper,
dynamicFactory client.DynamicFactory,
podCommandExecutor podCommandExecutor,
snapshotService cloudprovider.SnapshotService,
podCommandExecutor podexec.PodCommandExecutor,
resticBackupperFactory restic.BackupperFactory,
resticTimeout time.Duration,
) (Backupper, error) {
return &kubernetesBackupper{
discoveryHelper: discoveryHelper,
dynamicFactory: dynamicFactory,
podCommandExecutor: podCommandExecutor,
groupBackupperFactory: &defaultGroupBackupperFactory{},
snapshotService: snapshotService,
discoveryHelper: discoveryHelper,
dynamicFactory: dynamicFactory,
podCommandExecutor: podCommandExecutor,
groupBackupperFactory: &defaultGroupBackupperFactory{},
resticBackupperFactory: resticBackupperFactory,
resticTimeout: resticTimeout,
}, nil
}
func resolveActions(actions []ItemAction, helper discovery.Helper) ([]resolvedAction, error) {
func resolveActions(actions []velero.BackupItemAction, helper discovery.Helper) ([]resolvedAction, error) {
var resolved []resolvedAction
for _, action := range actions {
@@ -109,7 +120,7 @@ func resolveActions(actions []ItemAction, helper discovery.Helper) ([]resolvedAc
}
res := resolvedAction{
ItemAction: action,
BackupItemAction: action,
resourceIncludesExcludes: resources,
namespaceIncludesExcludes: namespaces,
selector: selector,
@@ -164,18 +175,11 @@ func getResourceHooks(hookSpecs []api.BackupResourceHookSpec, discoveryHelper di
}
func getResourceHook(hookSpec api.BackupResourceHookSpec, discoveryHelper discovery.Helper) (resourceHook, error) {
// Use newer PreHooks if it's set
preHooks := hookSpec.PreHooks
if len(preHooks) == 0 {
// Fall back to Hooks otherwise (DEPRECATED)
preHooks = hookSpec.Hooks
}
h := resourceHook{
name: hookSpec.Name,
namespaces: collections.NewIncludesExcludes().Includes(hookSpec.IncludedNamespaces...).Excludes(hookSpec.ExcludedNamespaces...),
resources: getResourceIncludesExcludes(discoveryHelper, hookSpec.IncludedResources, hookSpec.ExcludedResources),
pre: preHooks,
pre: hookSpec.PreHooks,
post: hookSpec.PostHooks,
}
@@ -190,88 +194,109 @@ func getResourceHook(hookSpec api.BackupResourceHookSpec, discoveryHelper discov
return h, nil
}
type VolumeSnapshotterGetter interface {
GetVolumeSnapshotter(name string) (velero.VolumeSnapshotter, error)
}
// Backup backs up the items specified in the Backup, placing them in a gzip-compressed tar file
// written to backupFile. The finalized api.Backup is written to metadata.
func (kb *kubernetesBackupper) Backup(backup *api.Backup, backupFile, logFile io.Writer, actions []ItemAction) error {
// written to backupFile. The finalized api.Backup is written to metadata. Any error that represents
// a complete backup failure is returned. Errors that constitute partial failures (i.e. failures to
// back up individual resources that don't prevent the backup from continuing to be processed) are logged
// to the backup log.
func (kb *kubernetesBackupper) Backup(log logrus.FieldLogger, backupRequest *Request, backupFile io.Writer, actions []velero.BackupItemAction, volumeSnapshotterGetter VolumeSnapshotterGetter) error {
gzippedData := gzip.NewWriter(backupFile)
defer gzippedData.Close()
tw := tar.NewWriter(gzippedData)
defer tw.Close()
gzippedLog := gzip.NewWriter(logFile)
defer gzippedLog.Close()
log.Info("Writing backup version file")
if err := kb.writeBackupVersion(tw); err != nil {
return errors.WithStack(err)
}
logger := logrus.New()
logger.Out = gzippedLog
logger.Hooks.Add(&logging.ErrorLocationHook{})
logger.Hooks.Add(&logging.LogLocationHook{})
log := logger.WithField("backup", kubeutil.NamespaceAndName(backup))
log.Info("Starting backup")
backupRequest.NamespaceIncludesExcludes = getNamespaceIncludesExcludes(backupRequest.Backup)
log.Infof("Including namespaces: %s", backupRequest.NamespaceIncludesExcludes.IncludesString())
log.Infof("Excluding namespaces: %s", backupRequest.NamespaceIncludesExcludes.ExcludesString())
namespaceIncludesExcludes := getNamespaceIncludesExcludes(backup)
log.Infof("Including namespaces: %s", namespaceIncludesExcludes.IncludesString())
log.Infof("Excluding namespaces: %s", namespaceIncludesExcludes.ExcludesString())
backupRequest.ResourceIncludesExcludes = getResourceIncludesExcludes(kb.discoveryHelper, backupRequest.Spec.IncludedResources, backupRequest.Spec.ExcludedResources)
log.Infof("Including resources: %s", backupRequest.ResourceIncludesExcludes.IncludesString())
log.Infof("Excluding resources: %s", backupRequest.ResourceIncludesExcludes.ExcludesString())
resourceIncludesExcludes := getResourceIncludesExcludes(kb.discoveryHelper, backup.Spec.IncludedResources, backup.Spec.ExcludedResources)
log.Infof("Including resources: %s", resourceIncludesExcludes.IncludesString())
log.Infof("Excluding resources: %s", resourceIncludesExcludes.ExcludesString())
resourceHooks, err := getResourceHooks(backup.Spec.Hooks.Resources, kb.discoveryHelper)
var err error
backupRequest.ResourceHooks, err = getResourceHooks(backupRequest.Spec.Hooks.Resources, kb.discoveryHelper)
if err != nil {
return err
}
var labelSelector string
if backup.Spec.LabelSelector != nil {
labelSelector = metav1.FormatLabelSelector(backup.Spec.LabelSelector)
}
backedUpItems := make(map[itemKey]struct{})
var errs []error
cohabitatingResources := map[string]*cohabitatingResource{
"deployments": newCohabitatingResource("deployments", "extensions", "apps"),
"networkpolicies": newCohabitatingResource("networkpolicies", "extensions", "networking.k8s.io"),
"events": newCohabitatingResource("events", "", "events.k8s.io"),
}
resolvedActions, err := resolveActions(actions, kb.discoveryHelper)
backupRequest.ResolvedActions, err = resolveActions(actions, kb.discoveryHelper)
if err != nil {
return err
}
backupRequest.BackedUpItems = map[itemKey]struct{}{}
podVolumeTimeout := kb.resticTimeout
if val := backupRequest.Annotations[api.PodVolumeOperationTimeoutAnnotation]; val != "" {
parsed, err := time.ParseDuration(val)
if err != nil {
log.WithError(errors.WithStack(err)).Errorf("Unable to parse pod volume timeout annotation %s, using server value.", val)
} else {
podVolumeTimeout = parsed
}
}
ctx, cancelFunc := context.WithTimeout(context.Background(), podVolumeTimeout)
defer cancelFunc()
var resticBackupper restic.Backupper
if kb.resticBackupperFactory != nil {
resticBackupper, err = kb.resticBackupperFactory.NewBackupper(ctx, backupRequest.Backup)
if err != nil {
return errors.WithStack(err)
}
}
gb := kb.groupBackupperFactory.newGroupBackupper(
log,
backup,
namespaceIncludesExcludes,
resourceIncludesExcludes,
labelSelector,
backupRequest,
kb.dynamicFactory,
kb.discoveryHelper,
backedUpItems,
cohabitatingResources,
resolvedActions,
cohabitatingResources(),
kb.podCommandExecutor,
tw,
resourceHooks,
kb.snapshotService,
resticBackupper,
newPVCSnapshotTracker(),
volumeSnapshotterGetter,
)
for _, group := range kb.discoveryHelper.Resources() {
if err := gb.backupGroup(group); err != nil {
errs = append(errs, err)
log.WithError(err).WithField("apiGroup", group.String()).Error("Error backing up API group")
}
}
err = kuberrs.Flatten(kuberrs.NewAggregate(errs))
if err == nil {
log.Infof("Backup completed successfully")
} else {
log.Infof("Backup completed with errors: %v", err)
}
return nil
}
return err
func (kb *kubernetesBackupper) writeBackupVersion(tw *tar.Writer) error {
versionFile := filepath.Join(api.MetadataDir, "version")
versionString := fmt.Sprintf("%d\n", BackupVersion)
hdr := &tar.Header{
Name: versionFile,
Size: int64(len(versionString)),
Typeflag: tar.TypeReg,
Mode: 0755,
ModTime: time.Now(),
}
if err := tw.WriteHeader(hdr); err != nil {
return errors.WithStack(err)
}
if _, err := tw.Write([]byte(versionString)); err != nil {
return errors.WithStack(err)
}
return nil
}
type tarWriter interface {

View File

@@ -1,5 +1,5 @@
/*
Copyright 2017 the Heptio Ark contributors.
Copyright 2017 the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -17,55 +17,49 @@ limitations under the License.
package backup
import (
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
corev1api "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"github.com/heptio/ark/pkg/apis/ark/v1"
"github.com/heptio/ark/pkg/util/collections"
v1 "github.com/heptio/velero/pkg/apis/velero/v1"
"github.com/heptio/velero/pkg/kuberesource"
"github.com/heptio/velero/pkg/plugin/velero"
)
// backupPVAction inspects a PersistentVolumeClaim for the PersistentVolume
// PVCAction inspects a PersistentVolumeClaim for the PersistentVolume
// that it references and backs it up
type backupPVAction struct {
type PVCAction struct {
log logrus.FieldLogger
}
func NewBackupPVAction(log logrus.FieldLogger) ItemAction {
return &backupPVAction{log: log}
func NewPVCAction(logger logrus.FieldLogger) *PVCAction {
return &PVCAction{log: logger}
}
var pvGroupResource = schema.GroupResource{Group: "", Resource: "persistentvolumes"}
func (a *backupPVAction) AppliesTo() (ResourceSelector, error) {
return ResourceSelector{
func (a *PVCAction) AppliesTo() (velero.ResourceSelector, error) {
return velero.ResourceSelector{
IncludedResources: []string{"persistentvolumeclaims"},
}, nil
}
// Execute finds the PersistentVolume bound by the provided
// PersistentVolumeClaim, if any, and backs it up
func (a *backupPVAction) Execute(item runtime.Unstructured, backup *v1.Backup) (runtime.Unstructured, []ResourceIdentifier, error) {
a.log.Info("Executing backupPVAction")
func (a *PVCAction) Execute(item runtime.Unstructured, backup *v1.Backup) (runtime.Unstructured, []velero.ResourceIdentifier, error) {
a.log.Info("Executing PVCAction")
var additionalItems []ResourceIdentifier
pvc := item.UnstructuredContent()
volumeName, err := collections.GetString(pvc, "spec.volumeName")
// if there's no volume name, it's not an error, since it's possible
// for the PVC not be bound; don't return an additional PV item to
// back up.
if err != nil || volumeName == "" {
a.log.Info("No spec.volumeName found for PersistentVolumeClaim")
return nil, nil, nil
var pvc corev1api.PersistentVolumeClaim
if err := runtime.DefaultUnstructuredConverter.FromUnstructured(item.UnstructuredContent(), &pvc); err != nil {
return nil, nil, errors.Wrap(err, "unable to convert unstructured item to persistent volume claim")
}
additionalItems = append(additionalItems, ResourceIdentifier{
GroupResource: pvGroupResource,
Name: volumeName,
})
if pvc.Status.Phase != corev1api.ClaimBound || pvc.Spec.VolumeName == "" {
return item, nil, nil
}
return item, additionalItems, nil
pv := velero.ResourceIdentifier{
GroupResource: kuberesource.PersistentVolumes,
Name: pvc.Spec.VolumeName,
}
return item, []velero.ResourceIdentifier{pv}, nil
}

View File

@@ -1,5 +1,5 @@
/*
Copyright 2017 the Heptio Ark contributors.
Copyright 2017 the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -19,23 +19,28 @@ package backup
import (
"testing"
"github.com/heptio/ark/pkg/apis/ark/v1"
arktest "github.com/heptio/ark/pkg/util/test"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
corev1api "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
v1 "github.com/heptio/velero/pkg/apis/velero/v1"
"github.com/heptio/velero/pkg/kuberesource"
"github.com/heptio/velero/pkg/plugin/velero"
velerotest "github.com/heptio/velero/pkg/test"
)
func TestBackupPVAction(t *testing.T) {
pvc := &unstructured.Unstructured{
Object: map[string]interface{}{
"spec": map[string]interface{}{},
"spec": map[string]interface{}{},
"status": map[string]interface{}{},
},
}
backup := &v1.Backup{}
a := NewBackupPVAction(arktest.NewLogger())
a := NewPVCAction(velerotest.NewLogger())
// no spec.volumeName should result in no error
// and no additional items
@@ -50,11 +55,39 @@ func TestBackupPVAction(t *testing.T) {
assert.NoError(t, err)
assert.Len(t, additional, 0)
// non-empty spec.volumeName should result in
// no error and an additional item for the PV
// non-empty spec.volumeName when status.phase is empty
// should result in no error and no additional items
pvc.Object["spec"].(map[string]interface{})["volumeName"] = "myVolume"
_, additional, err = a.Execute(pvc, backup)
require.NoError(t, err)
require.Len(t, additional, 0)
// non-empty spec.volumeName when status.phase is 'Pending'
// should result in no error and no additional items
pvc.Object["status"].(map[string]interface{})["phase"] = corev1api.ClaimPending
_, additional, err = a.Execute(pvc, backup)
require.NoError(t, err)
require.Len(t, additional, 0)
// non-empty spec.volumeName when status.phase is 'Lost'
// should result in no error and no additional items
pvc.Object["status"].(map[string]interface{})["phase"] = corev1api.ClaimLost
_, additional, err = a.Execute(pvc, backup)
require.NoError(t, err)
require.Len(t, additional, 0)
// non-empty spec.volumeName when status.phase is 'Bound'
// should result in no error and one additional item for the PV
pvc.Object["status"].(map[string]interface{})["phase"] = corev1api.ClaimBound
_, additional, err = a.Execute(pvc, backup)
require.NoError(t, err)
require.Len(t, additional, 1)
assert.Equal(t, ResourceIdentifier{GroupResource: pvGroupResource, Name: "myVolume"}, additional[0])
assert.Equal(t, velero.ResourceIdentifier{GroupResource: kuberesource.PersistentVolumes, Name: "myVolume"}, additional[0])
// empty spec.volumeName when status.phase is 'Bound' should
// result in no error and no additional items
pvc.Object["spec"].(map[string]interface{})["volumeName"] = ""
_, additional, err = a.Execute(pvc, backup)
assert.NoError(t, err)
assert.Len(t, additional, 0)
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
/*
Copyright 2018 the Heptio Ark contributors.
Copyright 2018 the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -19,8 +19,10 @@ package backup
import (
"fmt"
"github.com/heptio/ark/pkg/apis/ark/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/heptio/velero/pkg/apis/velero/v1"
"github.com/heptio/velero/pkg/label"
)
// NewDeleteBackupRequest creates a DeleteBackupRequest for the backup identified by name and uid.
@@ -29,7 +31,7 @@ func NewDeleteBackupRequest(name string, uid string) *v1.DeleteBackupRequest {
ObjectMeta: metav1.ObjectMeta{
GenerateName: name + "-",
Labels: map[string]string{
v1.BackupNameLabel: name,
v1.BackupNameLabel: label.GetValidName(name),
v1.BackupUIDLabel: uid,
},
},
@@ -43,6 +45,6 @@ func NewDeleteBackupRequest(name string, uid string) *v1.DeleteBackupRequest {
// find DeleteBackupRequests for the backup identified by name and uid.
func NewDeleteBackupRequestListOptions(name, uid string) metav1.ListOptions {
return metav1.ListOptions{
LabelSelector: fmt.Sprintf("%s=%s,%s=%s", v1.BackupNameLabel, name, v1.BackupUIDLabel, uid),
LabelSelector: fmt.Sprintf("%s=%s,%s=%s", v1.BackupNameLabel, label.GetValidName(name), v1.BackupUIDLabel, uid),
}
}

View File

@@ -1,5 +1,5 @@
/*
Copyright 2017 the Heptio Ark contributors.
Copyright 2017 the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -22,33 +22,27 @@ import (
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
kuberrs "k8s.io/apimachinery/pkg/util/errors"
"github.com/heptio/ark/pkg/apis/ark/v1"
"github.com/heptio/ark/pkg/client"
"github.com/heptio/ark/pkg/cloudprovider"
"github.com/heptio/ark/pkg/discovery"
"github.com/heptio/ark/pkg/util/collections"
"github.com/heptio/velero/pkg/client"
"github.com/heptio/velero/pkg/discovery"
"github.com/heptio/velero/pkg/podexec"
"github.com/heptio/velero/pkg/restic"
)
type groupBackupperFactory interface {
newGroupBackupper(
log logrus.FieldLogger,
backup *v1.Backup,
namespaces, resources *collections.IncludesExcludes,
labelSelector string,
backupRequest *Request,
dynamicFactory client.DynamicFactory,
discoveryHelper discovery.Helper,
backedUpItems map[itemKey]struct{},
cohabitatingResources map[string]*cohabitatingResource,
actions []resolvedAction,
podCommandExecutor podCommandExecutor,
podCommandExecutor podexec.PodCommandExecutor,
tarWriter tarWriter,
resourceHooks []resourceHook,
snapshotService cloudprovider.SnapshotService,
resticBackupper restic.Backupper,
resticSnapshotTracker *pvcSnapshotTracker,
volumeSnapshotterGetter VolumeSnapshotterGetter,
) groupBackupper
}
@@ -56,34 +50,28 @@ type defaultGroupBackupperFactory struct{}
func (f *defaultGroupBackupperFactory) newGroupBackupper(
log logrus.FieldLogger,
backup *v1.Backup,
namespaces, resources *collections.IncludesExcludes,
labelSelector string,
backupRequest *Request,
dynamicFactory client.DynamicFactory,
discoveryHelper discovery.Helper,
backedUpItems map[itemKey]struct{},
cohabitatingResources map[string]*cohabitatingResource,
actions []resolvedAction,
podCommandExecutor podCommandExecutor,
podCommandExecutor podexec.PodCommandExecutor,
tarWriter tarWriter,
resourceHooks []resourceHook,
snapshotService cloudprovider.SnapshotService,
resticBackupper restic.Backupper,
resticSnapshotTracker *pvcSnapshotTracker,
volumeSnapshotterGetter VolumeSnapshotterGetter,
) groupBackupper {
return &defaultGroupBackupper{
log: log,
backup: backup,
namespaces: namespaces,
resources: resources,
labelSelector: labelSelector,
dynamicFactory: dynamicFactory,
discoveryHelper: discoveryHelper,
backedUpItems: backedUpItems,
cohabitatingResources: cohabitatingResources,
actions: actions,
podCommandExecutor: podCommandExecutor,
tarWriter: tarWriter,
resourceHooks: resourceHooks,
snapshotService: snapshotService,
log: log,
backupRequest: backupRequest,
dynamicFactory: dynamicFactory,
discoveryHelper: discoveryHelper,
cohabitatingResources: cohabitatingResources,
podCommandExecutor: podCommandExecutor,
tarWriter: tarWriter,
resticBackupper: resticBackupper,
resticSnapshotTracker: resticSnapshotTracker,
volumeSnapshotterGetter: volumeSnapshotterGetter,
resourceBackupperFactory: &defaultResourceBackupperFactory{},
}
}
@@ -94,43 +82,21 @@ type groupBackupper interface {
type defaultGroupBackupper struct {
log logrus.FieldLogger
backup *v1.Backup
namespaces, resources *collections.IncludesExcludes
labelSelector string
backupRequest *Request
dynamicFactory client.DynamicFactory
discoveryHelper discovery.Helper
backedUpItems map[itemKey]struct{}
cohabitatingResources map[string]*cohabitatingResource
actions []resolvedAction
podCommandExecutor podCommandExecutor
podCommandExecutor podexec.PodCommandExecutor
tarWriter tarWriter
resourceHooks []resourceHook
snapshotService cloudprovider.SnapshotService
resticBackupper restic.Backupper
resticSnapshotTracker *pvcSnapshotTracker
resourceBackupperFactory resourceBackupperFactory
volumeSnapshotterGetter VolumeSnapshotterGetter
}
// backupGroup backs up a single API group.
func (gb *defaultGroupBackupper) backupGroup(group *metav1.APIResourceList) error {
var (
errs []error
log = gb.log.WithField("group", group.GroupVersion)
rb = gb.resourceBackupperFactory.newResourceBackupper(
log,
gb.backup,
gb.namespaces,
gb.resources,
gb.labelSelector,
gb.dynamicFactory,
gb.discoveryHelper,
gb.backedUpItems,
gb.cohabitatingResources,
gb.actions,
gb.podCommandExecutor,
gb.tarWriter,
gb.resourceHooks,
gb.snapshotService,
)
)
log := gb.log.WithField("group", group.GroupVersion)
log.Infof("Backing up group")
@@ -145,13 +111,26 @@ func (gb *defaultGroupBackupper) backupGroup(group *metav1.APIResourceList) erro
sortCoreGroup(group)
}
rb := gb.resourceBackupperFactory.newResourceBackupper(
log,
gb.backupRequest,
gb.dynamicFactory,
gb.discoveryHelper,
gb.cohabitatingResources,
gb.podCommandExecutor,
gb.tarWriter,
gb.resticBackupper,
gb.resticSnapshotTracker,
gb.volumeSnapshotterGetter,
)
for _, resource := range group.APIResources {
if err := rb.backupResource(group, resource); err != nil {
errs = append(errs, err)
log.WithError(err).WithField("resource", resource.String()).Error("Error backing up API resource")
}
}
return kuberrs.NewAggregate(errs)
return nil
}
// sortCoreGroup sorts group as a coreGroup.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2017 the Heptio Ark contributors.
Copyright 2017, 2019 the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -19,176 +19,10 @@ package backup
import (
"testing"
"github.com/heptio/ark/pkg/apis/ark/v1"
"github.com/heptio/ark/pkg/client"
"github.com/heptio/ark/pkg/cloudprovider"
"github.com/heptio/ark/pkg/discovery"
"github.com/heptio/ark/pkg/util/collections"
arktest "github.com/heptio/ark/pkg/util/test"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
)
func TestBackupGroup(t *testing.T) {
backup := &v1.Backup{}
namespaces := collections.NewIncludesExcludes().Includes("a")
resources := collections.NewIncludesExcludes().Includes("b")
labelSelector := "foo=bar"
dynamicFactory := &arktest.FakeDynamicFactory{}
defer dynamicFactory.AssertExpectations(t)
discoveryHelper := arktest.NewFakeDiscoveryHelper(true, nil)
backedUpItems := map[itemKey]struct{}{
{resource: "a", namespace: "b", name: "c"}: {},
}
cohabitatingResources := map[string]*cohabitatingResource{
"a": {
resource: "a",
groupResource1: schema.GroupResource{Group: "g1", Resource: "a"},
groupResource2: schema.GroupResource{Group: "g2", Resource: "a"},
},
}
actions := []resolvedAction{
{
ItemAction: newFakeAction("pods"),
resourceIncludesExcludes: collections.NewIncludesExcludes().Includes("pods"),
},
}
podCommandExecutor := &mockPodCommandExecutor{}
defer podCommandExecutor.AssertExpectations(t)
tarWriter := &fakeTarWriter{}
resourceHooks := []resourceHook{
{name: "myhook"},
}
gb := (&defaultGroupBackupperFactory{}).newGroupBackupper(
arktest.NewLogger(),
backup,
namespaces,
resources,
labelSelector,
dynamicFactory,
discoveryHelper,
backedUpItems,
cohabitatingResources,
actions,
podCommandExecutor,
tarWriter,
resourceHooks,
nil,
).(*defaultGroupBackupper)
resourceBackupperFactory := &mockResourceBackupperFactory{}
defer resourceBackupperFactory.AssertExpectations(t)
gb.resourceBackupperFactory = resourceBackupperFactory
resourceBackupper := &mockResourceBackupper{}
defer resourceBackupper.AssertExpectations(t)
resourceBackupperFactory.On("newResourceBackupper",
mock.Anything,
backup,
namespaces,
resources,
labelSelector,
dynamicFactory,
discoveryHelper,
backedUpItems,
cohabitatingResources,
actions,
podCommandExecutor,
tarWriter,
resourceHooks,
nil,
).Return(resourceBackupper)
group := &metav1.APIResourceList{
GroupVersion: "v1",
APIResources: []metav1.APIResource{
{Name: "persistentvolumes"},
{Name: "pods"},
{Name: "persistentvolumeclaims"},
},
}
expectedOrder := []string{"pods", "persistentvolumeclaims", "persistentvolumes"}
var actualOrder []string
runFunc := func(args mock.Arguments) {
actualOrder = append(actualOrder, args.Get(1).(metav1.APIResource).Name)
}
resourceBackupper.On("backupResource", group, metav1.APIResource{Name: "pods"}).Return(nil).Run(runFunc)
resourceBackupper.On("backupResource", group, metav1.APIResource{Name: "persistentvolumeclaims"}).Return(nil).Run(runFunc)
resourceBackupper.On("backupResource", group, metav1.APIResource{Name: "persistentvolumes"}).Return(nil).Run(runFunc)
err := gb.backupGroup(group)
require.NoError(t, err)
// make sure PVs were last
assert.Equal(t, expectedOrder, actualOrder)
}
type mockResourceBackupperFactory struct {
mock.Mock
}
func (rbf *mockResourceBackupperFactory) newResourceBackupper(
log logrus.FieldLogger,
backup *v1.Backup,
namespaces *collections.IncludesExcludes,
resources *collections.IncludesExcludes,
labelSelector string,
dynamicFactory client.DynamicFactory,
discoveryHelper discovery.Helper,
backedUpItems map[itemKey]struct{},
cohabitatingResources map[string]*cohabitatingResource,
actions []resolvedAction,
podCommandExecutor podCommandExecutor,
tarWriter tarWriter,
resourceHooks []resourceHook,
snapshotService cloudprovider.SnapshotService,
) resourceBackupper {
args := rbf.Called(
log,
backup,
namespaces,
resources,
labelSelector,
dynamicFactory,
discoveryHelper,
backedUpItems,
cohabitatingResources,
actions,
podCommandExecutor,
tarWriter,
resourceHooks,
snapshotService,
)
return args.Get(0).(resourceBackupper)
}
type mockResourceBackupper struct {
mock.Mock
}
func (rb *mockResourceBackupper) backupResource(group *metav1.APIResourceList, resource metav1.APIResource) error {
args := rb.Called(group, resource)
return args.Error(0)
}
func TestSortCoreGroup(t *testing.T) {
group := &metav1.APIResourceList{
GroupVersion: "v1",

View File

@@ -1,74 +0,0 @@
/*
Copyright 2017 the Heptio Ark contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package backup
import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
api "github.com/heptio/ark/pkg/apis/ark/v1"
)
// ItemAction is an actor that performs an operation on an individual item being backed up.
type ItemAction interface {
// AppliesTo returns information about which resources this action should be invoked for.
// An ItemAction's Execute function will only be invoked on items that match the returned
// selector. A zero-valued ResourceSelector matches all resources.
AppliesTo() (ResourceSelector, error)
// Execute allows the ItemAction to perform arbitrary logic with the item being backed up,
// including mutating the item itself prior to backup. The item (unmodified or modified)
// should be returned, along with an optional slice of ResourceIdentifiers specifying
// additional related items that should be backed up.
Execute(item runtime.Unstructured, backup *api.Backup) (runtime.Unstructured, []ResourceIdentifier, error)
}
// ResourceIdentifier describes a single item by its group, resource, namespace, and name.
type ResourceIdentifier struct {
schema.GroupResource
Namespace string
Name string
}
// ResourceSelector is a collection of included/excluded namespaces,
// included/excluded resources, and a label-selector that can be used
// to match a set of items from a cluster.
type ResourceSelector struct {
// IncludedNamespaces is a slice of namespace names to match. All
// namespaces in this slice, except those in ExcludedNamespaces,
// will be matched. A nil/empty slice matches all namespaces.
IncludedNamespaces []string
// ExcludedNamespaces is a slice of namespace names to exclude.
// All namespaces in IncludedNamespaces, *except* those in
// this slice, will be matched.
ExcludedNamespaces []string
// IncludedResources is a slice of resources to match. Resources
// may be specified as full names (e.g. "services") or abbreviations
// (e.g. "svc"). All resources in this slice, except those in
// ExcludedResources, will be matched. A nil/empty slice matches
// all resources.
IncludedResources []string
// ExcludedResources is a slice of resources to exclude.
// Resources may be specified as full names (e.g. "services") or
// abbreviations (e.g. "svc"). All resources in IncludedResources,
// *except* those in this slice, will be matched.
ExcludedResources []string
// LabelSelector is a string representation of a selector to apply
// when matching resources. See "k8s.io/apimachinery/pkg/labels".Parse()
// for details on syntax.
LabelSelector string
}

View File

@@ -1,5 +1,5 @@
/*
Copyright 2017 the Heptio Ark contributors.
Copyright 2017 the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -19,66 +19,65 @@ package backup
import (
"archive/tar"
"encoding/json"
"fmt"
"path/filepath"
"time"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
corev1api "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
kubeerrs "k8s.io/apimachinery/pkg/util/errors"
api "github.com/heptio/ark/pkg/apis/ark/v1"
"github.com/heptio/ark/pkg/client"
"github.com/heptio/ark/pkg/cloudprovider"
"github.com/heptio/ark/pkg/discovery"
"github.com/heptio/ark/pkg/util/collections"
"github.com/heptio/ark/pkg/util/logging"
api "github.com/heptio/velero/pkg/apis/velero/v1"
velerov1api "github.com/heptio/velero/pkg/apis/velero/v1"
"github.com/heptio/velero/pkg/client"
"github.com/heptio/velero/pkg/discovery"
"github.com/heptio/velero/pkg/kuberesource"
"github.com/heptio/velero/pkg/plugin/velero"
"github.com/heptio/velero/pkg/podexec"
"github.com/heptio/velero/pkg/restic"
"github.com/heptio/velero/pkg/volume"
)
type itemBackupperFactory interface {
newItemBackupper(
backup *api.Backup,
namespaces, resources *collections.IncludesExcludes,
backedUpItems map[itemKey]struct{},
actions []resolvedAction,
podCommandExecutor podCommandExecutor,
backup *Request,
podCommandExecutor podexec.PodCommandExecutor,
tarWriter tarWriter,
resourceHooks []resourceHook,
dynamicFactory client.DynamicFactory,
discoveryHelper discovery.Helper,
snapshotService cloudprovider.SnapshotService,
resticBackupper restic.Backupper,
resticSnapshotTracker *pvcSnapshotTracker,
volumeSnapshotterGetter VolumeSnapshotterGetter,
) ItemBackupper
}
type defaultItemBackupperFactory struct{}
func (f *defaultItemBackupperFactory) newItemBackupper(
backup *api.Backup,
namespaces, resources *collections.IncludesExcludes,
backedUpItems map[itemKey]struct{},
actions []resolvedAction,
podCommandExecutor podCommandExecutor,
backupRequest *Request,
podCommandExecutor podexec.PodCommandExecutor,
tarWriter tarWriter,
resourceHooks []resourceHook,
dynamicFactory client.DynamicFactory,
discoveryHelper discovery.Helper,
snapshotService cloudprovider.SnapshotService,
resticBackupper restic.Backupper,
resticSnapshotTracker *pvcSnapshotTracker,
volumeSnapshotterGetter VolumeSnapshotterGetter,
) ItemBackupper {
ib := &defaultItemBackupper{
backup: backup,
namespaces: namespaces,
resources: resources,
backedUpItems: backedUpItems,
actions: actions,
tarWriter: tarWriter,
resourceHooks: resourceHooks,
dynamicFactory: dynamicFactory,
discoveryHelper: discoveryHelper,
snapshotService: snapshotService,
backupRequest: backupRequest,
tarWriter: tarWriter,
dynamicFactory: dynamicFactory,
discoveryHelper: discoveryHelper,
resticBackupper: resticBackupper,
resticSnapshotTracker: resticSnapshotTracker,
volumeSnapshotterGetter: volumeSnapshotterGetter,
itemHookHandler: &defaultItemHookHandler{
podCommandExecutor: podCommandExecutor,
},
@@ -95,24 +94,19 @@ type ItemBackupper interface {
}
type defaultItemBackupper struct {
backup *api.Backup
namespaces *collections.IncludesExcludes
resources *collections.IncludesExcludes
backedUpItems map[itemKey]struct{}
actions []resolvedAction
tarWriter tarWriter
resourceHooks []resourceHook
dynamicFactory client.DynamicFactory
discoveryHelper discovery.Helper
snapshotService cloudprovider.SnapshotService
backupRequest *Request
tarWriter tarWriter
dynamicFactory client.DynamicFactory
discoveryHelper discovery.Helper
resticBackupper restic.Backupper
resticSnapshotTracker *pvcSnapshotTracker
volumeSnapshotterGetter VolumeSnapshotterGetter
itemHookHandler itemHookHandler
additionalItemBackupper ItemBackupper
itemHookHandler itemHookHandler
additionalItemBackupper ItemBackupper
snapshotLocationVolumeSnapshotters map[string]velero.VolumeSnapshotter
}
var podsGroupResource = schema.GroupResource{Group: "", Resource: "pods"}
var namespacesGroupResource = schema.GroupResource{Group: "", Resource: "namespaces"}
// backupItem backs up an individual item to tarWriter. The item may be excluded based on the
// namespaces IncludesExcludes list.
func (ib *defaultItemBackupper) backupItem(logger logrus.FieldLogger, obj runtime.Unstructured, groupResource schema.GroupResource) error {
@@ -131,111 +125,112 @@ func (ib *defaultItemBackupper) backupItem(logger logrus.FieldLogger, obj runtim
// NOTE: we have to re-check namespace & resource includes/excludes because it's possible that
// backupItem can be invoked by a custom action.
if namespace != "" && !ib.namespaces.ShouldInclude(namespace) {
if namespace != "" && !ib.backupRequest.NamespaceIncludesExcludes.ShouldInclude(namespace) {
log.Info("Excluding item because namespace is excluded")
return nil
}
// NOTE: we specifically allow namespaces to be backed up even if IncludeClusterResources is
// false.
if namespace == "" && groupResource != namespacesGroupResource && ib.backup.Spec.IncludeClusterResources != nil && !*ib.backup.Spec.IncludeClusterResources {
if namespace == "" && groupResource != kuberesource.Namespaces && ib.backupRequest.Spec.IncludeClusterResources != nil && !*ib.backupRequest.Spec.IncludeClusterResources {
log.Info("Excluding item because resource is cluster-scoped and backup.spec.includeClusterResources is false")
return nil
}
if !ib.resources.ShouldInclude(groupResource.String()) {
if !ib.backupRequest.ResourceIncludesExcludes.ShouldInclude(groupResource.String()) {
log.Info("Excluding item because resource is excluded")
return nil
}
if metadata.GetDeletionTimestamp() != nil {
log.Info("Skipping item because it's being deleted.")
return nil
}
key := itemKey{
resource: groupResource.String(),
resource: resourceKey(obj),
namespace: namespace,
name: name,
}
if _, exists := ib.backedUpItems[key]; exists {
if _, exists := ib.backupRequest.BackedUpItems[key]; exists {
log.Info("Skipping item because it's already been backed up.")
return nil
}
ib.backedUpItems[key] = struct{}{}
ib.backupRequest.BackedUpItems[key] = struct{}{}
log.Info("Backing up resource")
// Never save status
delete(obj.UnstructuredContent(), "status")
log.Info("Backing up item")
log.Debug("Executing pre hooks")
if err := ib.itemHookHandler.handleHooks(log, groupResource, obj, ib.resourceHooks, hookPhasePre); err != nil {
if err := ib.itemHookHandler.handleHooks(log, groupResource, obj, ib.backupRequest.ResourceHooks, hookPhasePre); err != nil {
return err
}
for _, action := range ib.actions {
if !action.resourceIncludesExcludes.ShouldInclude(groupResource.String()) {
log.Debug("Skipping action because it does not apply to this resource")
continue
}
var (
backupErrs []error
pod *corev1api.Pod
resticVolumesToBackup []string
)
if namespace != "" && !action.namespaceIncludesExcludes.ShouldInclude(namespace) {
log.Debug("Skipping action because it does not apply to this namespace")
continue
}
if !action.selector.Matches(labels.Set(metadata.GetLabels())) {
log.Debug("Skipping action because label selector does not match")
continue
}
log.Info("Executing custom action")
if logSetter, ok := action.ItemAction.(logging.LogSetter); ok {
logSetter.SetLog(log)
}
if updatedItem, additionalItemIdentifiers, err := action.Execute(obj, ib.backup); err == nil {
obj = updatedItem
for _, additionalItem := range additionalItemIdentifiers {
gvr, resource, err := ib.discoveryHelper.ResourceFor(additionalItem.GroupResource.WithVersion(""))
if err != nil {
return err
}
client, err := ib.dynamicFactory.ClientForGroupVersionResource(gvr.GroupVersion(), resource, additionalItem.Namespace)
if err != nil {
return err
}
additionalItem, err := client.Get(additionalItem.Name, metav1.GetOptions{})
if err != nil {
return err
}
ib.additionalItemBackupper.backupItem(log, additionalItem, gvr.GroupResource())
}
if groupResource == kuberesource.Pods {
// pod needs to be initialized for the unstructured converter
pod = new(corev1api.Pod)
if err := runtime.DefaultUnstructuredConverter.FromUnstructured(obj.UnstructuredContent(), pod); err != nil {
backupErrs = append(backupErrs, errors.WithStack(err))
// nil it on error since it's not valid
pod = nil
} else {
// We want this to show up in the log file at the place where the error occurs. When we return
// the error, it get aggregated with all the other ones at the end of the backup, making it
// harder to tell when it happened.
log.WithError(err).Error("error executing custom action")
// get the volumes to backup using restic, and add any of them that are PVCs to the pvc snapshot
// tracker, so that when we backup PVCs/PVs via an item action in the next step, we don't snapshot
// PVs that will have their data backed up with restic.
resticVolumesToBackup = restic.GetVolumesToBackup(pod)
return errors.Wrapf(err, "error executing custom action (groupResource=%s, namespace=%s, name=%s)", groupResource.String(), namespace, name)
ib.resticSnapshotTracker.Track(pod, resticVolumesToBackup)
}
}
if groupResource == pvGroupResource {
if ib.snapshotService == nil {
log.Debug("Skipping Persistent Volume snapshot because they're not enabled.")
} else {
if err := ib.takePVSnapshot(obj, ib.backup, log); err != nil {
return err
}
updatedObj, err := ib.executeActions(log, obj, groupResource, name, namespace, metadata)
if err != nil {
backupErrs = append(backupErrs, err)
// if there was an error running actions, execute post hooks and return
log.Debug("Executing post hooks")
if err := ib.itemHookHandler.handleHooks(log, groupResource, obj, ib.backupRequest.ResourceHooks, hookPhasePost); err != nil {
backupErrs = append(backupErrs, err)
}
return kubeerrs.NewAggregate(backupErrs)
}
obj = updatedObj
if metadata, err = meta.Accessor(obj); err != nil {
return errors.WithStack(err)
}
// update name and namespace in case they were modified in an action
name = metadata.GetName()
namespace = metadata.GetNamespace()
if groupResource == kuberesource.PersistentVolumes {
if err := ib.takePVSnapshot(obj, log); err != nil {
backupErrs = append(backupErrs, err)
}
}
if groupResource == kuberesource.Pods && pod != nil {
// this function will return partial results, so process podVolumeBackups
// even if there are errors.
podVolumeBackups, errs := ib.backupPodVolumes(log, pod, resticVolumesToBackup)
ib.backupRequest.PodVolumeBackups = append(ib.backupRequest.PodVolumeBackups, podVolumeBackups...)
backupErrs = append(backupErrs, errs...)
}
log.Debug("Executing post hooks")
if err := ib.itemHookHandler.handleHooks(log, groupResource, obj, ib.resourceHooks, hookPhasePost); err != nil {
return err
if err := ib.itemHookHandler.handleHooks(log, groupResource, obj, ib.backupRequest.ResourceHooks, hookPhasePost); err != nil {
backupErrs = append(backupErrs, err)
}
if len(backupErrs) != 0 {
return kubeerrs.NewAggregate(backupErrs)
}
var filePath string
@@ -269,6 +264,106 @@ func (ib *defaultItemBackupper) backupItem(logger logrus.FieldLogger, obj runtim
return nil
}
// backupPodVolumes triggers restic backups of the specified pod volumes, and returns a list of PodVolumeBackups
// for volumes that were successfully backed up, and a slice of any errors that were encountered.
func (ib *defaultItemBackupper) backupPodVolumes(log logrus.FieldLogger, pod *corev1api.Pod, volumes []string) ([]*velerov1api.PodVolumeBackup, []error) {
if len(volumes) == 0 {
return nil, nil
}
if ib.resticBackupper == nil {
log.Warn("No restic backupper, not backing up pod's volumes")
return nil, nil
}
return ib.resticBackupper.BackupPodVolumes(ib.backupRequest.Backup, pod, log)
}
func (ib *defaultItemBackupper) executeActions(
log logrus.FieldLogger,
obj runtime.Unstructured,
groupResource schema.GroupResource,
name, namespace string,
metadata metav1.Object,
) (runtime.Unstructured, error) {
for _, action := range ib.backupRequest.ResolvedActions {
if !action.resourceIncludesExcludes.ShouldInclude(groupResource.String()) {
log.Debug("Skipping action because it does not apply to this resource")
continue
}
if namespace != "" && !action.namespaceIncludesExcludes.ShouldInclude(namespace) {
log.Debug("Skipping action because it does not apply to this namespace")
continue
}
if namespace == "" && !action.namespaceIncludesExcludes.IncludeEverything() {
log.Debug("Skipping action because resource is cluster-scoped and action only applies to specific namespaces")
continue
}
if !action.selector.Matches(labels.Set(metadata.GetLabels())) {
log.Debug("Skipping action because label selector does not match")
continue
}
log.Info("Executing custom action")
updatedItem, additionalItemIdentifiers, err := action.Execute(obj, ib.backupRequest.Backup)
if err != nil {
return nil, errors.Wrapf(err, "error executing custom action (groupResource=%s, namespace=%s, name=%s)", groupResource.String(), namespace, name)
}
obj = updatedItem
for _, additionalItem := range additionalItemIdentifiers {
gvr, resource, err := ib.discoveryHelper.ResourceFor(additionalItem.GroupResource.WithVersion(""))
if err != nil {
return nil, err
}
client, err := ib.dynamicFactory.ClientForGroupVersionResource(gvr.GroupVersion(), resource, additionalItem.Namespace)
if err != nil {
return nil, err
}
additionalItem, err := client.Get(additionalItem.Name, metav1.GetOptions{})
if err != nil {
return nil, errors.WithStack(err)
}
if err = ib.additionalItemBackupper.backupItem(log, additionalItem, gvr.GroupResource()); err != nil {
return nil, err
}
}
}
return obj, nil
}
// volumeSnapshotter instantiates and initializes a VolumeSnapshotter given a VolumeSnapshotLocation,
// or returns an existing one if one's already been initialized for the location.
func (ib *defaultItemBackupper) volumeSnapshotter(snapshotLocation *api.VolumeSnapshotLocation) (velero.VolumeSnapshotter, error) {
if bs, ok := ib.snapshotLocationVolumeSnapshotters[snapshotLocation.Name]; ok {
return bs, nil
}
bs, err := ib.volumeSnapshotterGetter.GetVolumeSnapshotter(snapshotLocation.Spec.Provider)
if err != nil {
return nil, err
}
if err := bs.Init(snapshotLocation.Spec.Config); err != nil {
return nil, err
}
if ib.snapshotLocationVolumeSnapshotters == nil {
ib.snapshotLocationVolumeSnapshotters = make(map[string]velero.VolumeSnapshotter)
}
ib.snapshotLocationVolumeSnapshotters[snapshotLocation.Name] = bs
return bs, nil
}
// zoneLabel is the label that stores availability-zone info
// on PVs
const zoneLabel = "failure-domain.beta.kubernetes.io/zone"
@@ -276,69 +371,123 @@ const zoneLabel = "failure-domain.beta.kubernetes.io/zone"
// takePVSnapshot triggers a snapshot for the volume/disk underlying a PersistentVolume if the provided
// backup has volume snapshots enabled and the PV is of a compatible type. Also records cloud
// disk type and IOPS (if applicable) to be able to restore to current state later.
func (ib *defaultItemBackupper) takePVSnapshot(pv runtime.Unstructured, backup *api.Backup, log logrus.FieldLogger) error {
func (ib *defaultItemBackupper) takePVSnapshot(obj runtime.Unstructured, log logrus.FieldLogger) error {
log.Info("Executing takePVSnapshot")
if backup.Spec.SnapshotVolumes != nil && !*backup.Spec.SnapshotVolumes {
if ib.backupRequest.Spec.SnapshotVolumes != nil && !*ib.backupRequest.Spec.SnapshotVolumes {
log.Info("Backup has volume snapshots disabled; skipping volume snapshot action.")
return nil
}
metadata, err := meta.Accessor(pv)
if err != nil {
pv := new(corev1api.PersistentVolume)
if err := runtime.DefaultUnstructuredConverter.FromUnstructured(obj.UnstructuredContent(), pv); err != nil {
return errors.WithStack(err)
}
name := metadata.GetName()
var pvFailureDomainZone string
labels := metadata.GetLabels()
log = log.WithField("persistentVolume", pv.Name)
if labels[zoneLabel] != "" {
pvFailureDomainZone = labels[zoneLabel]
} else {
// If this PV is claimed, see if we've already taken a (restic) snapshot of the contents
// of this PV. If so, don't take a snapshot.
if pv.Spec.ClaimRef != nil {
if ib.resticSnapshotTracker.Has(pv.Spec.ClaimRef.Namespace, pv.Spec.ClaimRef.Name) {
log.Info("Skipping persistent volume snapshot because volume has already been backed up with restic.")
return nil
}
}
pvFailureDomainZone := pv.Labels[zoneLabel]
if pvFailureDomainZone == "" {
log.Infof("label %q is not present on PersistentVolume", zoneLabel)
}
volumeID, err := ib.snapshotService.GetVolumeID(pv)
if err != nil {
return errors.Wrapf(err, "error getting volume ID for PersistentVolume")
var (
volumeID, location string
volumeSnapshotter velero.VolumeSnapshotter
)
for _, snapshotLocation := range ib.backupRequest.SnapshotLocations {
log := log.WithField("volumeSnapshotLocation", snapshotLocation.Name)
bs, err := ib.volumeSnapshotter(snapshotLocation)
if err != nil {
log.WithError(err).Error("Error getting volume snapshotter for volume snapshot location")
continue
}
if volumeID, err = bs.GetVolumeID(obj); err != nil {
log.WithError(err).Errorf("Error attempting to get volume ID for persistent volume")
continue
}
if volumeID == "" {
log.Infof("No volume ID returned by volume snapshotter for persistent volume")
continue
}
log.Infof("Got volume ID for persistent volume")
volumeSnapshotter = bs
location = snapshotLocation.Name
break
}
if volumeID == "" {
log.Info("PersistentVolume is not a supported volume type for snapshots, skipping.")
if volumeSnapshotter == nil {
log.Info("Persistent volume is not a supported volume type for snapshots, skipping.")
return nil
}
log = log.WithField("volumeID", volumeID)
tags := map[string]string{
"ark.heptio.com/backup": backup.Name,
"ark.heptio.com/pv": metadata.GetName(),
tags := ib.backupRequest.GetLabels()
if tags == nil {
tags = map[string]string{}
}
tags["velero.io/backup"] = ib.backupRequest.Name
tags["velero.io/pv"] = pv.Name
log.Info("Snapshotting PersistentVolume")
snapshotID, err := ib.snapshotService.CreateSnapshot(volumeID, pvFailureDomainZone, tags)
log.Info("Getting volume information")
volumeType, iops, err := volumeSnapshotter.GetVolumeInfo(volumeID, pvFailureDomainZone)
if err != nil {
// log+error on purpose - log goes to the per-backup log file, error goes to the backup
log.WithError(err).Error("error creating snapshot")
return errors.WithMessage(err, "error creating snapshot")
}
volumeType, iops, err := ib.snapshotService.GetVolumeInfo(volumeID, pvFailureDomainZone)
if err != nil {
log.WithError(err).Error("error getting volume info")
return errors.WithMessage(err, "error getting volume info")
}
if backup.Status.VolumeBackups == nil {
backup.Status.VolumeBackups = make(map[string]*api.VolumeBackupInfo)
}
log.Info("Snapshotting persistent volume")
snapshot := volumeSnapshot(ib.backupRequest.Backup, pv.Name, volumeID, volumeType, pvFailureDomainZone, location, iops)
backup.Status.VolumeBackups[name] = &api.VolumeBackupInfo{
SnapshotID: snapshotID,
Type: volumeType,
Iops: iops,
AvailabilityZone: pvFailureDomainZone,
var errs []error
snapshotID, err := volumeSnapshotter.CreateSnapshot(snapshot.Spec.ProviderVolumeID, snapshot.Spec.VolumeAZ, tags)
if err != nil {
errs = append(errs, errors.Wrap(err, "error taking snapshot of volume"))
snapshot.Status.Phase = volume.SnapshotPhaseFailed
} else {
snapshot.Status.Phase = volume.SnapshotPhaseCompleted
snapshot.Status.ProviderSnapshotID = snapshotID
}
ib.backupRequest.VolumeSnapshots = append(ib.backupRequest.VolumeSnapshots, snapshot)
return nil
// nil errors are automatically removed
return kubeerrs.NewAggregate(errs)
}
func volumeSnapshot(backup *api.Backup, volumeName, volumeID, volumeType, az, location string, iops *int64) *volume.Snapshot {
return &volume.Snapshot{
Spec: volume.SnapshotSpec{
BackupName: backup.Name,
BackupUID: string(backup.UID),
Location: location,
PersistentVolumeName: volumeName,
ProviderVolumeID: volumeID,
VolumeType: volumeType,
VolumeAZ: az,
VolumeIOPS: iops,
},
Status: volume.SnapshotStatus{
Phase: volume.SnapshotPhaseNew,
},
}
}
// resourceKey returns a string representing the object's GroupVersionKind (e.g.
// apps/v1/Deployment).
func resourceKey(obj runtime.Unstructured) string {
gvk := obj.GetObjectKind().GroupVersionKind()
return fmt.Sprintf("%s/%s", gvk.GroupVersion().String(), gvk.Kind)
}

View File

@@ -1,5 +1,5 @@
/*
Copyright 2017 the Heptio Ark contributors.
Copyright 2019 the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -17,602 +17,31 @@ limitations under the License.
package backup
import (
"archive/tar"
"encoding/json"
"fmt"
"reflect"
"testing"
"time"
"github.com/heptio/ark/pkg/apis/ark/v1"
api "github.com/heptio/ark/pkg/apis/ark/v1"
"github.com/heptio/ark/pkg/util/collections"
arktest "github.com/heptio/ark/pkg/util/test"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"github.com/heptio/velero/pkg/builder"
)
func TestBackupItemSkips(t *testing.T) {
func Test_resourceKey(t *testing.T) {
tests := []struct {
testName string
namespace string
name string
namespaces *collections.IncludesExcludes
groupResource schema.GroupResource
resources *collections.IncludesExcludes
backedUpItems map[itemKey]struct{}
resource metav1.Object
want string
}{
{
testName: "namespace not in includes list",
namespace: "ns",
name: "foo",
namespaces: collections.NewIncludesExcludes().Includes("a"),
},
{
testName: "namespace in excludes list",
namespace: "ns",
name: "foo",
namespaces: collections.NewIncludesExcludes().Excludes("ns"),
},
{
testName: "resource not in includes list",
namespace: "ns",
name: "foo",
groupResource: schema.GroupResource{Group: "foo", Resource: "bar"},
namespaces: collections.NewIncludesExcludes(),
resources: collections.NewIncludesExcludes().Includes("a.b"),
},
{
testName: "resource in excludes list",
namespace: "ns",
name: "foo",
groupResource: schema.GroupResource{Group: "foo", Resource: "bar"},
namespaces: collections.NewIncludesExcludes(),
resources: collections.NewIncludesExcludes().Excludes("bar.foo"),
},
{
testName: "resource already backed up",
namespace: "ns",
name: "foo",
groupResource: schema.GroupResource{Group: "foo", Resource: "bar"},
namespaces: collections.NewIncludesExcludes(),
resources: collections.NewIncludesExcludes(),
backedUpItems: map[itemKey]struct{}{
{resource: "bar.foo", namespace: "ns", name: "foo"}: {},
},
},
{resource: builder.ForPod("default", "test").Result(), want: "v1/Pod"},
{resource: builder.ForDeployment("default", "test").Result(), want: "apps/v1/Deployment"},
{resource: builder.ForPersistentVolume("test").Result(), want: "v1/PersistentVolume"},
{resource: builder.ForRole("default", "test").Result(), want: "rbac.authorization.k8s.io/v1/Role"},
}
for _, test := range tests {
t.Run(test.testName, func(t *testing.T) {
ib := &defaultItemBackupper{
namespaces: test.namespaces,
resources: test.resources,
backedUpItems: test.backedUpItems,
}
u := unstructuredOrDie(fmt.Sprintf(`{"apiVersion":"v1","kind":"Pod","metadata":{"namespace":"%s","name":"%s"}}`, test.namespace, test.name))
err := ib.backupItem(arktest.NewLogger(), u, test.groupResource)
assert.NoError(t, err)
for _, tt := range tests {
t.Run(tt.want, func(t *testing.T) {
content, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(tt.resource)
unstructured := &unstructured.Unstructured{Object: content}
assert.Equal(t, tt.want, resourceKey(unstructured))
})
}
}
func TestBackupItemSkipsClusterScopedResourceWhenIncludeClusterResourcesFalse(t *testing.T) {
f := false
ib := &defaultItemBackupper{
backup: &v1.Backup{
Spec: v1.BackupSpec{
IncludeClusterResources: &f,
},
},
namespaces: collections.NewIncludesExcludes(),
resources: collections.NewIncludesExcludes(),
}
u := unstructuredOrDie(`{"apiVersion":"v1","kind":"Foo","metadata":{"name":"bar"}}`)
err := ib.backupItem(arktest.NewLogger(), u, schema.GroupResource{Group: "foo", Resource: "bar"})
assert.NoError(t, err)
}
func TestBackupItemNoSkips(t *testing.T) {
tests := []struct {
name string
item string
namespaceIncludesExcludes *collections.IncludesExcludes
expectError bool
expectExcluded bool
expectedTarHeaderName string
tarWriteError bool
tarHeaderWriteError bool
customAction bool
expectedActionID string
customActionAdditionalItemIdentifiers []ResourceIdentifier
customActionAdditionalItems []runtime.Unstructured
groupResource string
snapshottableVolumes map[string]api.VolumeBackupInfo
}{
{
name: "explicit namespace include",
item: `{"metadata":{"namespace":"foo","name":"bar"}}`,
namespaceIncludesExcludes: collections.NewIncludesExcludes().Includes("foo"),
expectError: false,
expectExcluded: false,
expectedTarHeaderName: "resources/resource.group/namespaces/foo/bar.json",
},
{
name: "* namespace include",
item: `{"metadata":{"namespace":"foo","name":"bar"}}`,
namespaceIncludesExcludes: collections.NewIncludesExcludes().Includes("*"),
expectError: false,
expectExcluded: false,
expectedTarHeaderName: "resources/resource.group/namespaces/foo/bar.json",
},
{
name: "cluster-scoped",
item: `{"metadata":{"name":"bar"}}`,
expectError: false,
expectExcluded: false,
expectedTarHeaderName: "resources/resource.group/cluster/bar.json",
},
{
name: "make sure status is deleted",
item: `{"metadata":{"name":"bar"},"spec":{"color":"green"},"status":{"foo":"bar"}}`,
expectError: false,
expectExcluded: false,
expectedTarHeaderName: "resources/resource.group/cluster/bar.json",
},
{
name: "tar header write error",
item: `{"metadata":{"name":"bar"},"spec":{"color":"green"},"status":{"foo":"bar"}}`,
expectError: true,
tarHeaderWriteError: true,
},
{
name: "tar write error",
item: `{"metadata":{"name":"bar"},"spec":{"color":"green"},"status":{"foo":"bar"}}`,
expectError: true,
tarWriteError: true,
},
{
name: "action invoked - cluster-scoped",
namespaceIncludesExcludes: collections.NewIncludesExcludes().Includes("*"),
item: `{"metadata":{"name":"bar"}}`,
expectError: false,
expectExcluded: false,
expectedTarHeaderName: "resources/resource.group/cluster/bar.json",
customAction: true,
expectedActionID: "bar",
},
{
name: "action invoked - namespaced",
namespaceIncludesExcludes: collections.NewIncludesExcludes().Includes("*"),
item: `{"metadata":{"namespace": "myns", "name":"bar"}}`,
expectError: false,
expectExcluded: false,
expectedTarHeaderName: "resources/resource.group/namespaces/myns/bar.json",
customAction: true,
expectedActionID: "myns/bar",
},
{
name: "action invoked - additional items",
namespaceIncludesExcludes: collections.NewIncludesExcludes().Includes("*"),
item: `{"metadata":{"namespace": "myns", "name":"bar"}}`,
expectError: false,
expectExcluded: false,
expectedTarHeaderName: "resources/resource.group/namespaces/myns/bar.json",
customAction: true,
expectedActionID: "myns/bar",
customActionAdditionalItemIdentifiers: []ResourceIdentifier{
{
GroupResource: schema.GroupResource{Group: "g1", Resource: "r1"},
Namespace: "ns1",
Name: "n1",
},
{
GroupResource: schema.GroupResource{Group: "g2", Resource: "r2"},
Namespace: "ns2",
Name: "n2",
},
},
customActionAdditionalItems: []runtime.Unstructured{
unstructuredOrDie(`{"apiVersion":"g1/v1","kind":"r1","metadata":{"namespace":"ns1","name":"n1"}}`),
unstructuredOrDie(`{"apiVersion":"g2/v1","kind":"r1","metadata":{"namespace":"ns2","name":"n2"}}`),
},
},
{
name: "takePVSnapshot is not invoked for PVs when snapshotService == nil",
namespaceIncludesExcludes: collections.NewIncludesExcludes().Includes("*"),
item: `{"apiVersion": "v1", "kind": "PersistentVolume", "metadata": {"name": "mypv", "labels": {"failure-domain.beta.kubernetes.io/zone": "us-east-1c"}}, "spec": {"awsElasticBlockStore": {"volumeID": "aws://us-east-1c/vol-abc123"}}}`,
expectError: false,
expectExcluded: false,
expectedTarHeaderName: "resources/persistentvolumes/cluster/mypv.json",
groupResource: "persistentvolumes",
},
{
name: "takePVSnapshot is invoked for PVs when snapshotService != nil",
namespaceIncludesExcludes: collections.NewIncludesExcludes().Includes("*"),
item: `{"apiVersion": "v1", "kind": "PersistentVolume", "metadata": {"name": "mypv", "labels": {"failure-domain.beta.kubernetes.io/zone": "us-east-1c"}}, "spec": {"awsElasticBlockStore": {"volumeID": "aws://us-east-1c/vol-abc123"}}}`,
expectError: false,
expectExcluded: false,
expectedTarHeaderName: "resources/persistentvolumes/cluster/mypv.json",
groupResource: "persistentvolumes",
snapshottableVolumes: map[string]api.VolumeBackupInfo{
"vol-abc123": {SnapshotID: "snapshot-1", AvailabilityZone: "us-east-1c"},
},
},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
var (
actions []resolvedAction
action *fakeAction
backup = &v1.Backup{}
groupResource = schema.ParseGroupResource("resource.group")
backedUpItems = make(map[itemKey]struct{})
resources = collections.NewIncludesExcludes()
w = &fakeTarWriter{}
)
if test.groupResource != "" {
groupResource = schema.ParseGroupResource(test.groupResource)
}
item, err := getAsMap(test.item)
if err != nil {
t.Fatal(err)
}
namespaces := test.namespaceIncludesExcludes
if namespaces == nil {
namespaces = collections.NewIncludesExcludes()
}
if test.tarHeaderWriteError {
w.writeHeaderError = errors.New("error")
}
if test.tarWriteError {
w.writeError = errors.New("error")
}
if test.customAction {
action = &fakeAction{
additionalItems: test.customActionAdditionalItemIdentifiers,
}
actions = []resolvedAction{
{
ItemAction: action,
namespaceIncludesExcludes: collections.NewIncludesExcludes(),
resourceIncludesExcludes: collections.NewIncludesExcludes().Includes(groupResource.String()),
selector: labels.Everything(),
},
}
}
resourceHooks := []resourceHook{}
podCommandExecutor := &mockPodCommandExecutor{}
defer podCommandExecutor.AssertExpectations(t)
dynamicFactory := &arktest.FakeDynamicFactory{}
defer dynamicFactory.AssertExpectations(t)
discoveryHelper := arktest.NewFakeDiscoveryHelper(true, nil)
b := (&defaultItemBackupperFactory{}).newItemBackupper(
backup,
namespaces,
resources,
backedUpItems,
actions,
podCommandExecutor,
w,
resourceHooks,
dynamicFactory,
discoveryHelper,
nil,
).(*defaultItemBackupper)
var snapshotService *arktest.FakeSnapshotService
if test.snapshottableVolumes != nil {
snapshotService = &arktest.FakeSnapshotService{
SnapshottableVolumes: test.snapshottableVolumes,
VolumeID: "vol-abc123",
}
b.snapshotService = snapshotService
}
// make sure the podCommandExecutor was set correctly in the real hook handler
assert.Equal(t, podCommandExecutor, b.itemHookHandler.(*defaultItemHookHandler).podCommandExecutor)
itemHookHandler := &mockItemHookHandler{}
defer itemHookHandler.AssertExpectations(t)
b.itemHookHandler = itemHookHandler
additionalItemBackupper := &mockItemBackupper{}
defer additionalItemBackupper.AssertExpectations(t)
b.additionalItemBackupper = additionalItemBackupper
obj := &unstructured.Unstructured{Object: item}
itemHookHandler.On("handleHooks", mock.Anything, groupResource, obj, resourceHooks, hookPhasePre).Return(nil)
itemHookHandler.On("handleHooks", mock.Anything, groupResource, obj, resourceHooks, hookPhasePost).Return(nil)
for i, item := range test.customActionAdditionalItemIdentifiers {
itemClient := &arktest.FakeDynamicClient{}
defer itemClient.AssertExpectations(t)
dynamicFactory.On("ClientForGroupVersionResource", item.GroupResource.WithVersion("").GroupVersion(), metav1.APIResource{Name: item.Resource}, item.Namespace).Return(itemClient, nil)
itemClient.On("Get", item.Name, metav1.GetOptions{}).Return(test.customActionAdditionalItems[i], nil)
additionalItemBackupper.On("backupItem", mock.AnythingOfType("*logrus.Entry"), test.customActionAdditionalItems[i], item.GroupResource).Return(nil)
}
err = b.backupItem(arktest.NewLogger(), obj, groupResource)
gotError := err != nil
if e, a := test.expectError, gotError; e != a {
t.Fatalf("error: expected %t, got %t: %v", e, a, err)
}
if test.expectError {
return
}
if test.expectExcluded {
if len(w.headers) > 0 {
t.Errorf("unexpected header write")
}
if len(w.data) > 0 {
t.Errorf("unexpected data write")
}
return
}
// we have to delete status as that's what backupItem does,
// and this ensures that we're verifying the right data
delete(item, "status")
itemWithoutStatus, err := json.Marshal(&item)
if err != nil {
t.Fatal(err)
}
require.Equal(t, 1, len(w.headers), "headers")
assert.Equal(t, test.expectedTarHeaderName, w.headers[0].Name, "header.name")
assert.Equal(t, int64(len(itemWithoutStatus)), w.headers[0].Size, "header.size")
assert.Equal(t, byte(tar.TypeReg), w.headers[0].Typeflag, "header.typeflag")
assert.Equal(t, int64(0755), w.headers[0].Mode, "header.mode")
assert.False(t, w.headers[0].ModTime.IsZero(), "header.modTime set")
assert.Equal(t, 1, len(w.data), "# of data")
actual, err := getAsMap(string(w.data[0]))
if err != nil {
t.Fatal(err)
}
if e, a := item, actual; !reflect.DeepEqual(e, a) {
t.Errorf("data: expected %s, got %s", e, a)
}
if test.customAction {
if len(action.ids) != 1 {
t.Errorf("unexpected custom action ids: %v", action.ids)
} else if e, a := test.expectedActionID, action.ids[0]; e != a {
t.Errorf("action.ids[0]: expected %s, got %s", e, a)
}
require.Equal(t, 1, len(action.backups), "unexpected custom action backups: %#v", action.backups)
assert.Equal(t, backup, &(action.backups[0]), "backup")
}
if test.snapshottableVolumes != nil {
require.Equal(t, 1, len(snapshotService.SnapshotsTaken))
var expectedBackups []api.VolumeBackupInfo
for _, vbi := range test.snapshottableVolumes {
expectedBackups = append(expectedBackups, vbi)
}
var actualBackups []api.VolumeBackupInfo
for _, vbi := range backup.Status.VolumeBackups {
actualBackups = append(actualBackups, *vbi)
}
assert.Equal(t, expectedBackups, actualBackups)
}
})
}
}
func TestTakePVSnapshot(t *testing.T) {
iops := int64(1000)
tests := []struct {
name string
snapshotEnabled bool
pv string
ttl time.Duration
expectError bool
expectedVolumeID string
expectedSnapshotsTaken int
existingVolumeBackups map[string]*v1.VolumeBackupInfo
volumeInfo map[string]v1.VolumeBackupInfo
}{
{
name: "snapshot disabled",
pv: `{"apiVersion": "v1", "kind": "PersistentVolume", "metadata": {"name": "mypv"}}`,
snapshotEnabled: false,
},
{
name: "unsupported PV source type",
snapshotEnabled: true,
pv: `{"apiVersion": "v1", "kind": "PersistentVolume", "metadata": {"name": "mypv"}, "spec": {"unsupportedPVSource": {}}}`,
expectError: false,
},
{
name: "without iops",
snapshotEnabled: true,
pv: `{"apiVersion": "v1", "kind": "PersistentVolume", "metadata": {"name": "mypv", "labels": {"failure-domain.beta.kubernetes.io/zone": "us-east-1c"}}, "spec": {"awsElasticBlockStore": {"volumeID": "aws://us-east-1c/vol-abc123"}}}`,
expectError: false,
expectedSnapshotsTaken: 1,
expectedVolumeID: "vol-abc123",
ttl: 5 * time.Minute,
volumeInfo: map[string]v1.VolumeBackupInfo{
"vol-abc123": {Type: "gp", SnapshotID: "snap-1", AvailabilityZone: "us-east-1c"},
},
},
{
name: "with iops",
snapshotEnabled: true,
pv: `{"apiVersion": "v1", "kind": "PersistentVolume", "metadata": {"name": "mypv", "labels": {"failure-domain.beta.kubernetes.io/zone": "us-east-1c"}}, "spec": {"awsElasticBlockStore": {"volumeID": "aws://us-east-1c/vol-abc123"}}}`,
expectError: false,
expectedSnapshotsTaken: 1,
expectedVolumeID: "vol-abc123",
ttl: 5 * time.Minute,
volumeInfo: map[string]v1.VolumeBackupInfo{
"vol-abc123": {Type: "io1", Iops: &iops, SnapshotID: "snap-1", AvailabilityZone: "us-east-1c"},
},
},
{
name: "preexisting volume backup info in backup status",
snapshotEnabled: true,
pv: `{"apiVersion": "v1", "kind": "PersistentVolume", "metadata": {"name": "mypv"}, "spec": {"gcePersistentDisk": {"pdName": "pd-abc123"}}}`,
expectError: false,
expectedSnapshotsTaken: 1,
expectedVolumeID: "pd-abc123",
ttl: 5 * time.Minute,
existingVolumeBackups: map[string]*v1.VolumeBackupInfo{
"anotherpv": {SnapshotID: "anothersnap"},
},
volumeInfo: map[string]v1.VolumeBackupInfo{
"pd-abc123": {Type: "gp", SnapshotID: "snap-1"},
},
},
{
name: "create snapshot error",
snapshotEnabled: true,
pv: `{"apiVersion": "v1", "kind": "PersistentVolume", "metadata": {"name": "mypv"}, "spec": {"gcePersistentDisk": {"pdName": "pd-abc123"}}}`,
expectedVolumeID: "pd-abc123",
expectError: true,
},
{
name: "PV with label metadata but no failureDomainZone",
snapshotEnabled: true,
pv: `{"apiVersion": "v1", "kind": "PersistentVolume", "metadata": {"name": "mypv", "labels": {"failure-domain.beta.kubernetes.io/region": "us-east-1"}}, "spec": {"awsElasticBlockStore": {"volumeID": "aws://us-east-1c/vol-abc123"}}}`,
expectError: false,
expectedSnapshotsTaken: 1,
expectedVolumeID: "vol-abc123",
ttl: 5 * time.Minute,
volumeInfo: map[string]v1.VolumeBackupInfo{
"vol-abc123": {Type: "gp", SnapshotID: "snap-1"},
},
},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
backup := &v1.Backup{
ObjectMeta: metav1.ObjectMeta{
Namespace: v1.DefaultNamespace,
Name: "mybackup",
},
Spec: v1.BackupSpec{
SnapshotVolumes: &test.snapshotEnabled,
TTL: metav1.Duration{Duration: test.ttl},
},
Status: v1.BackupStatus{
VolumeBackups: test.existingVolumeBackups,
},
}
snapshotService := &arktest.FakeSnapshotService{
SnapshottableVolumes: test.volumeInfo,
VolumeID: test.expectedVolumeID,
}
ib := &defaultItemBackupper{snapshotService: snapshotService}
pv, err := getAsMap(test.pv)
if err != nil {
t.Fatal(err)
}
// method under test
err = ib.takePVSnapshot(&unstructured.Unstructured{Object: pv}, backup, arktest.NewLogger())
gotErr := err != nil
if e, a := test.expectError, gotErr; e != a {
t.Errorf("error: expected %v, got %v", e, a)
}
if test.expectError {
return
}
if !test.snapshotEnabled {
// don't need to check anything else if snapshots are disabled
return
}
expectedVolumeBackups := test.existingVolumeBackups
if expectedVolumeBackups == nil {
expectedVolumeBackups = make(map[string]*v1.VolumeBackupInfo)
}
// we should have one snapshot taken exactly
require.Equal(t, test.expectedSnapshotsTaken, snapshotService.SnapshotsTaken.Len())
if test.expectedSnapshotsTaken > 0 {
// the snapshotID should be the one in the entry in snapshotService.SnapshottableVolumes
// for the volume we ran the test for
snapshotID, _ := snapshotService.SnapshotsTaken.PopAny()
expectedVolumeBackups["mypv"] = &v1.VolumeBackupInfo{
SnapshotID: snapshotID,
Type: test.volumeInfo[test.expectedVolumeID].Type,
Iops: test.volumeInfo[test.expectedVolumeID].Iops,
AvailabilityZone: test.volumeInfo[test.expectedVolumeID].AvailabilityZone,
}
if e, a := expectedVolumeBackups, backup.Status.VolumeBackups; !reflect.DeepEqual(e, a) {
t.Errorf("backup.status.VolumeBackups: expected %v, got %v", e, a)
}
}
})
}
}
type fakeTarWriter struct {
closeCalled bool
headers []*tar.Header
data [][]byte
writeHeaderError error
writeError error
}
func (w *fakeTarWriter) Close() error { return nil }
func (w *fakeTarWriter) Write(data []byte) (int, error) {
w.data = append(w.data, data)
return 0, w.writeError
}
func (w *fakeTarWriter) WriteHeader(header *tar.Header) error {
w.headers = append(w.headers, header)
return w.writeHeaderError
}
type mockItemBackupper struct {
mock.Mock
}
func (ib *mockItemBackupper) backupItem(logger logrus.FieldLogger, obj runtime.Unstructured, groupResource schema.GroupResource) error {
args := ib.Called(logger, obj, groupResource)
return args.Error(0)
}

View File

@@ -1,5 +1,5 @@
/*
Copyright 2017 the Heptio Ark contributors.
Copyright 2017 the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -21,8 +21,6 @@ import (
"fmt"
"time"
api "github.com/heptio/ark/pkg/apis/ark/v1"
"github.com/heptio/ark/pkg/util/collections"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"k8s.io/apimachinery/pkg/api/meta"
@@ -30,6 +28,11 @@ import (
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
api "github.com/heptio/velero/pkg/apis/velero/v1"
"github.com/heptio/velero/pkg/kuberesource"
"github.com/heptio/velero/pkg/podexec"
"github.com/heptio/velero/pkg/util/collections"
)
type hookPhase string
@@ -56,7 +59,7 @@ type itemHookHandler interface {
// defaultItemHookHandler is the default itemHookHandler.
type defaultItemHookHandler struct {
podCommandExecutor podCommandExecutor
podCommandExecutor podexec.PodCommandExecutor
}
func (h *defaultItemHookHandler) handleHooks(
@@ -67,7 +70,7 @@ func (h *defaultItemHookHandler) handleHooks(
phase hookPhase,
) error {
// We only support hooks on pods right now
if groupResource != podsGroupResource {
if groupResource != kuberesource.Pods {
return nil
}
@@ -93,7 +96,7 @@ func (h *defaultItemHookHandler) handleHooks(
"hookPhase": phase,
},
)
if err := h.podCommandExecutor.executePodCommand(hookLog, obj.UnstructuredContent(), namespace, name, "<from-annotation>", hookFromAnnotations); err != nil {
if err := h.podCommandExecutor.ExecutePodCommand(hookLog, obj.UnstructuredContent(), namespace, name, "<from-annotation>", hookFromAnnotations); err != nil {
hookLog.WithError(err).Error("Error executing hook")
if hookFromAnnotations.OnError == api.HookErrorModeFail {
return err
@@ -117,7 +120,7 @@ func (h *defaultItemHookHandler) handleHooks(
hooks = resourceHook.post
}
for _, hook := range hooks {
if groupResource == podsGroupResource {
if groupResource == kuberesource.Pods {
if hook.Exec != nil {
hookLog := log.WithFields(
logrus.Fields{
@@ -126,7 +129,7 @@ func (h *defaultItemHookHandler) handleHooks(
"hookPhase": phase,
},
)
err := h.podCommandExecutor.executePodCommand(hookLog, obj.UnstructuredContent(), namespace, name, resourceHook.name, hook.Exec)
err := h.podCommandExecutor.ExecutePodCommand(hookLog, obj.UnstructuredContent(), namespace, name, resourceHook.name, hook.Exec)
if err != nil {
hookLog.WithError(err).Error("Error executing hook")
if hook.Exec.OnError == api.HookErrorModeFail {
@@ -142,12 +145,10 @@ func (h *defaultItemHookHandler) handleHooks(
}
const (
podBackupHookContainerAnnotationKey = "hook.backup.ark.heptio.com/container"
podBackupHookCommandAnnotationKey = "hook.backup.ark.heptio.com/command"
podBackupHookOnErrorAnnotationKey = "hook.backup.ark.heptio.com/on-error"
podBackupHookTimeoutAnnotationKey = "hook.backup.ark.heptio.com/timeout"
defaultHookOnError = api.HookErrorModeFail
defaultHookTimeout = 30 * time.Second
podBackupHookContainerAnnotationKey = "hook.backup.velero.io/container"
podBackupHookCommandAnnotationKey = "hook.backup.velero.io/command"
podBackupHookOnErrorAnnotationKey = "hook.backup.velero.io/on-error"
podBackupHookTimeoutAnnotationKey = "hook.backup.velero.io/timeout"
)
func phasedKey(phase hookPhase, key string) string {

View File

@@ -1,5 +1,5 @@
/*
Copyright 2017 the Heptio Ark contributors.
Copyright 2017 the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -21,9 +21,6 @@ import (
"testing"
"time"
"github.com/heptio/ark/pkg/apis/ark/v1"
"github.com/heptio/ark/pkg/util/collections"
arktest "github.com/heptio/ark/pkg/util/test"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
@@ -33,6 +30,10 @@ import (
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
v1 "github.com/heptio/velero/pkg/apis/velero/v1"
velerotest "github.com/heptio/velero/pkg/test"
"github.com/heptio/velero/pkg/util/collections"
)
type mockItemHookHandler struct {
@@ -57,7 +58,7 @@ func TestHandleHooksSkips(t *testing.T) {
},
{
name: "pod without annotation / no spec hooks",
item: unstructuredOrDie(
item: velerotest.UnstructuredOrDie(
`
{
"apiVersion": "v1",
@@ -73,7 +74,7 @@ func TestHandleHooksSkips(t *testing.T) {
{
name: "spec hooks not applicable",
groupResource: "pods",
item: unstructuredOrDie(
item: velerotest.UnstructuredOrDie(
`
{
"apiVersion": "v1",
@@ -114,7 +115,7 @@ func TestHandleHooksSkips(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
podCommandExecutor := &mockPodCommandExecutor{}
podCommandExecutor := &velerotest.MockPodCommandExecutor{}
defer podCommandExecutor.AssertExpectations(t)
h := &defaultItemHookHandler{
@@ -122,7 +123,7 @@ func TestHandleHooksSkips(t *testing.T) {
}
groupResource := schema.ParseGroupResource(test.groupResource)
err := h.handleHooks(arktest.NewLogger(), groupResource, test.item, test.hooks, hookPhasePre)
err := h.handleHooks(velerotest.NewLogger(), groupResource, test.item, test.hooks, hookPhasePre)
assert.NoError(t, err)
})
}
@@ -144,7 +145,7 @@ func TestHandleHooks(t *testing.T) {
name: "pod, no annotation, spec (multiple pre hooks) = run spec",
phase: hookPhasePre,
groupResource: "pods",
item: unstructuredOrDie(`
item: velerotest.UnstructuredOrDie(`
{
"apiVersion": "v1",
"kind": "Pod",
@@ -194,7 +195,7 @@ func TestHandleHooks(t *testing.T) {
name: "pod, no annotation, spec (multiple post hooks) = run spec",
phase: hookPhasePost,
groupResource: "pods",
item: unstructuredOrDie(`
item: velerotest.UnstructuredOrDie(`
{
"apiVersion": "v1",
"kind": "Pod",
@@ -244,7 +245,7 @@ func TestHandleHooks(t *testing.T) {
name: "pod, annotation (legacy), no spec = run annotation",
phase: hookPhasePre,
groupResource: "pods",
item: unstructuredOrDie(`
item: velerotest.UnstructuredOrDie(`
{
"apiVersion": "v1",
"kind": "Pod",
@@ -252,8 +253,8 @@ func TestHandleHooks(t *testing.T) {
"namespace": "ns",
"name": "name",
"annotations": {
"hook.backup.ark.heptio.com/container": "c",
"hook.backup.ark.heptio.com/command": "/bin/ls"
"hook.backup.velero.io/container": "c",
"hook.backup.velero.io/command": "/bin/ls"
}
}
}`),
@@ -266,7 +267,7 @@ func TestHandleHooks(t *testing.T) {
name: "pod, annotation (pre), no spec = run annotation",
phase: hookPhasePre,
groupResource: "pods",
item: unstructuredOrDie(`
item: velerotest.UnstructuredOrDie(`
{
"apiVersion": "v1",
"kind": "Pod",
@@ -274,8 +275,8 @@ func TestHandleHooks(t *testing.T) {
"namespace": "ns",
"name": "name",
"annotations": {
"pre.hook.backup.ark.heptio.com/container": "c",
"pre.hook.backup.ark.heptio.com/command": "/bin/ls"
"pre.hook.backup.velero.io/container": "c",
"pre.hook.backup.velero.io/command": "/bin/ls"
}
}
}`),
@@ -288,7 +289,7 @@ func TestHandleHooks(t *testing.T) {
name: "pod, annotation (post), no spec = run annotation",
phase: hookPhasePost,
groupResource: "pods",
item: unstructuredOrDie(`
item: velerotest.UnstructuredOrDie(`
{
"apiVersion": "v1",
"kind": "Pod",
@@ -296,8 +297,8 @@ func TestHandleHooks(t *testing.T) {
"namespace": "ns",
"name": "name",
"annotations": {
"post.hook.backup.ark.heptio.com/container": "c",
"post.hook.backup.ark.heptio.com/command": "/bin/ls"
"post.hook.backup.velero.io/container": "c",
"post.hook.backup.velero.io/command": "/bin/ls"
}
}
}`),
@@ -310,7 +311,7 @@ func TestHandleHooks(t *testing.T) {
name: "pod, annotation & spec = run annotation",
phase: hookPhasePre,
groupResource: "pods",
item: unstructuredOrDie(`
item: velerotest.UnstructuredOrDie(`
{
"apiVersion": "v1",
"kind": "Pod",
@@ -318,8 +319,8 @@ func TestHandleHooks(t *testing.T) {
"namespace": "ns",
"name": "name",
"annotations": {
"hook.backup.ark.heptio.com/container": "c",
"hook.backup.ark.heptio.com/command": "/bin/ls"
"hook.backup.velero.io/container": "c",
"hook.backup.velero.io/command": "/bin/ls"
}
}
}`),
@@ -345,7 +346,7 @@ func TestHandleHooks(t *testing.T) {
name: "pod, annotation, onError=fail = return error",
phase: hookPhasePre,
groupResource: "pods",
item: unstructuredOrDie(`
item: velerotest.UnstructuredOrDie(`
{
"apiVersion": "v1",
"kind": "Pod",
@@ -353,9 +354,9 @@ func TestHandleHooks(t *testing.T) {
"namespace": "ns",
"name": "name",
"annotations": {
"hook.backup.ark.heptio.com/container": "c",
"hook.backup.ark.heptio.com/command": "/bin/ls",
"hook.backup.ark.heptio.com/on-error": "Fail"
"hook.backup.velero.io/container": "c",
"hook.backup.velero.io/command": "/bin/ls",
"hook.backup.velero.io/on-error": "Fail"
}
}
}`),
@@ -371,7 +372,7 @@ func TestHandleHooks(t *testing.T) {
name: "pod, annotation, onError=continue = return nil",
phase: hookPhasePre,
groupResource: "pods",
item: unstructuredOrDie(`
item: velerotest.UnstructuredOrDie(`
{
"apiVersion": "v1",
"kind": "Pod",
@@ -379,9 +380,9 @@ func TestHandleHooks(t *testing.T) {
"namespace": "ns",
"name": "name",
"annotations": {
"hook.backup.ark.heptio.com/container": "c",
"hook.backup.ark.heptio.com/command": "/bin/ls",
"hook.backup.ark.heptio.com/on-error": "Continue"
"hook.backup.velero.io/container": "c",
"hook.backup.velero.io/command": "/bin/ls",
"hook.backup.velero.io/on-error": "Continue"
}
}
}`),
@@ -397,7 +398,7 @@ func TestHandleHooks(t *testing.T) {
name: "pod, spec, onError=fail = don't run other hooks",
phase: hookPhasePre,
groupResource: "pods",
item: unstructuredOrDie(`
item: velerotest.UnstructuredOrDie(`
{
"apiVersion": "v1",
"kind": "Pod",
@@ -459,7 +460,7 @@ func TestHandleHooks(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
podCommandExecutor := &mockPodCommandExecutor{}
podCommandExecutor := &velerotest.MockPodCommandExecutor{}
defer podCommandExecutor.AssertExpectations(t)
h := &defaultItemHookHandler{
@@ -467,20 +468,20 @@ func TestHandleHooks(t *testing.T) {
}
if test.expectedPodHook != nil {
podCommandExecutor.On("executePodCommand", mock.Anything, test.item.UnstructuredContent(), "ns", "name", "<from-annotation>", test.expectedPodHook).Return(test.expectedPodHookError)
podCommandExecutor.On("ExecutePodCommand", mock.Anything, test.item.UnstructuredContent(), "ns", "name", "<from-annotation>", test.expectedPodHook).Return(test.expectedPodHookError)
} else {
hookLoop:
for _, resourceHook := range test.hooks {
for _, hook := range resourceHook.pre {
hookError := test.hookErrorsByContainer[hook.Exec.Container]
podCommandExecutor.On("executePodCommand", mock.Anything, test.item.UnstructuredContent(), "ns", "name", resourceHook.name, hook.Exec).Return(hookError)
podCommandExecutor.On("ExecutePodCommand", mock.Anything, test.item.UnstructuredContent(), "ns", "name", resourceHook.name, hook.Exec).Return(hookError)
if hookError != nil && hook.Exec.OnError == v1.HookErrorModeFail {
break hookLoop
}
}
for _, hook := range resourceHook.post {
hookError := test.hookErrorsByContainer[hook.Exec.Container]
podCommandExecutor.On("executePodCommand", mock.Anything, test.item.UnstructuredContent(), "ns", "name", resourceHook.name, hook.Exec).Return(hookError)
podCommandExecutor.On("ExecutePodCommand", mock.Anything, test.item.UnstructuredContent(), "ns", "name", resourceHook.name, hook.Exec).Return(hookError)
if hookError != nil && hook.Exec.OnError == v1.HookErrorModeFail {
break hookLoop
}
@@ -489,7 +490,7 @@ func TestHandleHooks(t *testing.T) {
}
groupResource := schema.ParseGroupResource(test.groupResource)
err := h.handleHooks(arktest.NewLogger(), groupResource, test.item, test.hooks, test.phase)
err := h.handleHooks(velerotest.NewLogger(), groupResource, test.item, test.hooks, test.phase)
if test.expectedError != nil {
assert.EqualError(t, err, test.expectedError.Error())
@@ -693,3 +694,11 @@ func TestResourceHookApplicableTo(t *testing.T) {
})
}
}
func parseLabelSelectorOrDie(s string) labels.Selector {
ret, err := labels.Parse(s)
if err != nil {
panic(err)
}
return ret
}

Some files were not shown because too many files have changed in this diff Show More