Compare commits

..

657 Commits

Author SHA1 Message Date
Carlisia
659a852c8c Merge pull request #760 from skriss/v0.9.3-cherrypicks
V0.9.3 cherrypicks
2018-08-10 11:16:49 -07:00
Nolan Brubaker
ca8ae18020 Add v0.9.3 changelog entry
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-08-10 10:12:02 -07:00
Alex Lemaresquier
9f80f01c2a 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-08-10 10:11:42 -07:00
Carlisia
0acd368291 Merge pull request #707 from skriss/release-v0.9.2
Release v0.9.2
2018-07-26 14:19:04 -07:00
Steve Kriss
0640cdab06 update changelog for v0.9.2
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-26 14:06:57 -07:00
Steve Kriss
d21ce48db1 fix bug preventing backup item action item updates from saving
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-26 14:02:01 -07:00
Carlisia
10a1fe2bfa Merge pull request #695 from skriss/release-0.9
cherry-pick commits for v0.9.1
2018-07-23 13:37:00 -07:00
Steve Kriss
07ce4988e3 update CHANGELOG.md for v0.9.1
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-23 12:13:27 -07:00
Steve Kriss
89e4611d1b cleanup service account action log statement
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-23 12:13:20 -07:00
Nolan Brubaker
7d6bebadc4 Add RBAC support for 1.7 clusters
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-07-23 12:01:40 -07:00
Steve Kriss
84f872e4d5 delete old deletion requests for backup when processing a new one
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-23 10:43:39 -07:00
Steve Kriss
b566a7c101 return nil error if 404 encountered when deleting snapshots
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-23 10:43:32 -07:00
Steve Kriss
b4f8d7cb5f fix tagging latest by using make's ifeq
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-20 12:06:29 -07:00
Steve Kriss
c23d9dd7c5 exit server if not all Ark CRDs exist at startup
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-20 11:57:16 -07:00
Steve Kriss
400e8a165b require namespace for backups/etc. to exist at server startup
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-20 11:53:25 -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
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
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
Andy Goldstein
dc8c66b305 Merge pull request #447 from skriss/v0.8.1-changelog
changelog for v0.8.1
2018-04-23 16:07:56 -04:00
Steve Kriss
66646e6e03 changelog for v0.8.1
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-04-23 13:01:03 -07:00
Andy Goldstein
726d61fab4 Merge pull request #449 from skriss/azure-restore-fix
azure: pass full snapshot name when restoring disk
2018-04-23 15:58:50 -04:00
Steve Kriss
72d7e5e01d azure: pass full snapshot name when restoring disk
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-04-23 12:51:05 -07:00
Andy Goldstein
206bf3dfe3 Merge pull request #446 from skriss/azure-snapshot-uri-compat
add backwards-compatibility for azure snapshot ID
2018-04-23 14:39:40 -04:00
Steve Kriss
a466208975 add backwards-compatibility for azure snapshot ID
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-04-23 11:34:37 -07: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
Nolan Brubaker
9155baee7c Merge pull request #442 from ncdc/ns-docs-fix
Remove guidance to run Ark in a separate namespace
2018-04-20 10:50:10 -04:00
Andy Goldstein
d6436ad2b1 Merge pull request #438 from skriss/aws-doc-link
AWS: add missing link ref
2018-04-20 06:57:38 -04:00
Andy Goldstein
783bdb0455 Remove guidance to run Ark in a separate namespace
Now that we're no longer using a finalizer as part of backup deletion,
it's fine to run the Ark server in the same namespace as all of the
resources.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-04-20 06:54:28 -04:00
Steve Kriss
631f3d6acc add missing link ref
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-04-19 14:01:23 -07:00
Andy Goldstein
94309aa72e Merge pull request #435 from skriss/tag-push-latest
docker tag and push :latest when building a git tag
2018-04-19 13:36:06 -04:00
Steve Kriss
c1af90dcc8 docker tag and push :latest when building a git tag
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-04-19 10:19:35 -07:00
Nolan Brubaker
3be8d072ab Merge pull request #433 from skriss/v0.8.0-changelog
update changelog for v0.8.0
2018-04-19 12:30:38 -04:00
Steve Kriss
5c0e3a6715 update changelog for v0.8.0
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-04-19 08:37:06 -07:00
Steve Kriss
a9bd9a76cc Merge pull request #431 from nrb/clear-finalizer-on-sync
Remove finalizers from backups before syncing
2018-04-18 14:53:09 -07:00
Nolan Brubaker
300a010959 Remove finalizers from backups before syncing
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-04-18 17:32:39 -04:00
Andy Goldstein
5d7e467794 Merge pull request #432 from asenchi/fix-docker-push
Remove deprecated method for pushing images to GCR
2018-04-18 15:37:47 -04:00
Curt Micol
bdfdf8d38e Remove deprecated method for pushing images to GCR
Signed-off-by: Curt Micol <asenchi@heptio.com>
2018-04-18 15:28:08 -04:00
Nolan Brubaker
19c2fe3aaf Merge pull request #429 from skriss/minimal-gcp-policy
GCP: create/use IAM role with minimal set of permissions
2018-04-18 14:31:43 -04:00
Steve Kriss
6549ef8075 GCP: create/use IAM role with minimal set of permissions
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-04-17 11:22:35 -07:00
Andy Goldstein
1f6b496f5e Merge pull request #427 from containscafeine/add-common-deployment
Add examples/common/10-deployment.yaml back
2018-04-17 09:27:38 -04:00
Shubham
d47887a807 Remove references to common/10-deployment.yaml
The changes in 1db966bf3c (diff-c31a634b9c201723f2478087620b10c5) removed examples/common/10-deployment.yaml, which is listed in
README.md to start the server  at -
https://github.com/heptio/ark#set-up-server

This commit removes the references from the documentation.

Signed-off-by: Shubham <shubham@linux.com>
2018-04-17 18:37:28 +05:30
Andy Goldstein
71e1e2990e Merge pull request #425 from lypht/fix_gcp_ns
Reverting namespace to single namespace deployment
2018-04-13 09:23:49 -04:00
Josh Hull
e7098e5d88 Fixes the remaining three occurrences of the old namespace
Signed-off-by: Josh Hull <josh.hull@lypht.com>
2018-04-13 06:37:00 -05:00
Josh Hull
b446f66baa Reverting namespace to single namespace deployment
Signed-off-by: Josh Hull <josh.hull@lypht.com>
2018-04-13 06:25:15 -05:00
Nolan Brubaker
288ce9f33c Merge pull request #402 from domderen/kube2iam
Documentation on using ark with kube2iam
2018-04-12 14:20:19 -04:00
Dominik Deren
1db966bf3c Documentation on using ark with kube2iam
This PR updates the documentation & example deployment template to show how `ark` can be ran utilizing [https://github.com/jtblin/kube2iam](Kube2iam) for AWS IAM permissions, rather than using access key & secret key.

Signed-off-by: Dominik Deren <dominik.deren@live.com>
2018-04-12 10:53:23 -07:00
Andy Goldstein
2e08fd40a7 Merge pull request #419 from hopkinsth/fix/s3-perms
fix/s3-perms
2018-04-12 11:30:22 -04:00
Andy Goldstein
3a85f25e2b Merge pull request #415 from ffd2subroutine/add-node-selector
add nodeSelector so that ark server doesn't end up on a windows node …
2018-04-12 11:28:41 -04:00
Andy Goldstein
730ddb2113 Merge pull request #391 from containscafeine/handle-restore-missing-error
Introduce validation logic to `ark restore logs`
2018-04-12 11:07:29 -04:00
Andy Goldstein
e78c892a59 Merge pull request #384 from containscafeine/add-bash-zsh-completion
Add bash and zsh completion support
2018-04-12 11:00:53 -04:00
Shubham Minglani
7f3e88151b Add bash and zsh completion support
This commit adds support for auto completion for bash and zsh
shells. A new root level command called "completion" has been
introduced, and the user can get the auto completion code by
running `ark completion bash/zsh`.

For bash completion, the built-in GenBashCompletion() from cobra
has been used, but for zsh, the built-in GenZshCompletion() is
known to cause issues. The workaround has been copied from zsh
completion code of kubectl.

Signed-off-by: Shubham <shubham@linux.com>
2018-04-12 13:26:23 +05:30
Shubham
468c4faf1b Introduce validation logic to ark restore logs
This commit introduces validation logic to `ark restore logs`
command, the way it already exists in other commands like `ark
restore create`.

Before the logs for a restore are fetched from the server, the
server is contacted to check if the specified restore exists. If
it does not, it errors out.

Fixes #389

Signed-off-by: Shubham <shubham@linux.com>
2018-04-12 13:06:32 +05:30
Andy Goldstein
a48cc6ed23 Merge pull request #421 from skriss/changelog-typos
fix typos in changelog
2018-04-11 14:53:02 -04:00
Steve Kriss
352d667e13 fix typos in changelog
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-04-11 11:39:33 -07:00
Andy Goldstein
8a9fdc4316 Merge pull request #420 from skriss/v0.8.0-rc.1-changelog
update changelog for v0.8.0-rc.1
2018-04-11 13:56:30 -04:00
Steve Kriss
099f91f8fb update changelog for v0.8.0-rc.1
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-04-11 10:39:38 -07:00
Andy Goldstein
0998f6d8af Merge pull request #405 from nrb/ignore-duplicates
Compare for duplicates before logging object exists errors
2018-04-11 09:47:37 -04:00
Thomas Hopkins
612fe31bff move AbortMultipartUpload and ListMultipartUploadParts to the object-level IAM policy statement
Signed-off-by: Thomas Hopkins <hopkinsth@gmail.com>
2018-04-10 20:32:09 -04:00
Nolan Brubaker
33cc85cd0c Compare backup and cluster objects before logging
When restoring resources that raise an already exists error, check their
equality before logging a message on the restore. If they're the same
except for some metadata, don't generate a message.

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

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

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

Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-04-10 14:55:48 -04:00
Andy Goldstein
258f3e011e Merge pull request #409 from skriss/fix-398
get backup name from restore spec when handling restore DownloadRequests
2018-04-10 13:29:07 -04:00
Andy Goldstein
278c1c6087 Merge pull request #414 from skriss/unit-test-fix
add helper function to compare slices of actions reliably and fix test flake
2018-04-10 13:27:26 -04:00
Nolan Brubaker
b6b87668c0 Add equality dependency
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-04-10 12:27:54 -04:00
Steve Kriss
0d2b49acce get backup name from restore spec when handling restore DownloadRequests
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-04-09 10:50:10 -07:00
Steve Kriss
5bb47d2b7a extract a helper for comparing slices of Actions reliably
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-04-09 09:39:33 -07:00
ffd2subroutine
bcd63bf0e8 add nodeSelector so that ark server doesn't end up on a windows node when running a hybrid cluster
Signed-off-by: ffd2subroutine <ffd2subroutine@users.noreply.github.com>
2018-04-09 09:33:17 +02:00
Steve Kriss
25d46a709b Merge pull request #383 from ncdc/delete-backup-request
Switch from finalizer to DeleteBackupRequest for deleting backups
2018-04-06 12:24:35 -07:00
Andy Goldstein
3f2e222ae4 Don't allow deletion of in-progress backups
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-04-06 13:08:39 -04:00
Andy Goldstein
644a75e3c1 Set DeleteBackupRequest labels if missing
When the BackupDeletionController processes a request, set the request's
backup-name and backup-uid labels if they aren't currently set.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-04-05 15:38:44 -04:00
Andy Goldstein
ef57a44827 Require DeleteBackupRequest.Spec.BackupName
Make sure a DeleteBackupRequest has its Spec.BackupName filled in. If
not, record an error in the status and mark the request as processed.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-04-05 14:53:10 -04:00
Andy Goldstein
4328b67f93 backup delete/describe enhancements
Always request DeleteBackupRequests for a given backup so we can show
failed deletion attempts if you try to delete a backup that has PV
snapshots when Ark doesn't have a persistentVolumeProvider configured.

When creating a DeleteBackupRequest, include a label for the UID so we
can match based on name and UID when associated DeleteBackupRequests
with a given backup.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-04-05 14:21:45 -04:00
Andy Goldstein
a4d5061a02 Regen docs
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-04-05 11:19:11 -04:00
Andy Goldstein
1ae492da6c Expire processed deleted backup requests > 24hr
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-04-05 11:19:11 -04:00
Andy Goldstein
dd9b9f3bba Add DeleteBackupRequest CRD to 00-prereqs.yaml
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-04-05 11:19:11 -04:00
Andy Goldstein
1545406472 Switch back to heptio-ark for the server
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-04-05 11:19:11 -04:00
Andy Goldstein
74f60b1ee1 Switch backup finalizer to DeleteBackupRequest
We ran into a lot of problems using a finalizer on the backup to allow
the Ark server to clean up all associated backup data when deleting a
backup.

Users also found it less than desirable that deleting the heptio-ark
namespace resulted in all the backup data being deleted.

This removes the finalizer and replaces it with an explicit
DeleteBackupRequest that is created as a means of requesting the
deletion of a backup and all its associated data. This is what `ark
backup delete` does.

If you use kubectl to delete a backup or to delete the heptio-ark
namespace, this no longer deletes associated backups. Additionally, as
long as the heptio-ark namespace still exists, the Ark server's
BackupSyncController will continually sync backups into the heptio-ark
namespace from object storage.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-04-05 11:16:15 -04:00
Andy Goldstein
b0a2a0bf7b Remove k8s.io/code-generator dependency
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-04-04 16:44:16 -04:00
Andy Goldstein
1455d67152 Use a custom builder image
Use a custom builder image to do all of Ark's builds. This image now
contains k8s.io/code-generator for code generation.

Enable docker in travis to use the builder image.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-04-04 16:44:16 -04:00
Andy Goldstein
a5f2fec0a0 Update deps to pull in json-patch
Now that we've configured pruning for dep, this removes all unused
packages, all non-go files, and all tests from the vendor directory.

NOTE: due to a change in dep, it preserves anything that looks like a
license file. We'll be pulling in a few files we weren't previously
using - mostly license files. It's easier to just go with what dep does
than to try to exclude them after the fact.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-04-04 16:44:16 -04:00
Andy Goldstein
4d8fb900c6 Update dep info
- Add pruning settings to Gopkg.toml
- Update vendoring deps doc to point to dep installation instructions
  and to use dep instead of hack/dep-save.sh
- Remove hack/dep-save.sh

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-04-04 16:44:16 -04:00
Andy Goldstein
d1293825ef Merge pull request #412 from skriss/cmd-changes
use cobra's arg-count validation & call Complete() before Validate()
2018-04-04 16:39:48 -04:00
Steve Kriss
80b66434c0 move getting client into Complete()
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-04-03 20:43:42 -07:00
Steve Kriss
c60e47dedd use cobra's arg-count validation & call Complete() before Validate()
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-04-03 09:45:29 -07:00
Andy Goldstein
a2f5e14a32 Merge pull request #392 from containscafeine/prioritize-limitranges
Add limitranges to defaultResourcePriorities
2018-03-20 09:22:19 -04:00
Shubham
73499c2cff Add limitranges to defaultResourcePriorities
This commit adds limitranges to defaultResourcePriorities as
suggested in #385.

This is done so that pods are not restored before the LimitRange
objects, because that would lead to pods not honoring the requests
and limits set in LimitRange objects.

Fixes #385

Signed-off-by: Shubham <shubham@linux.com>
2018-03-17 21:13:44 +05:30
Andy Goldstein
3063d33d71 Merge pull request #388 from containscafeine/fix-error-typo
Fix typo: replace ; with :
2018-03-16 08:59:57 -04:00
Shubham
560f9504e1 Fix typo: replace ; with :
This commit replaces a ; with a : in an error message

Signed-off-by: Shubham <shubham@linux.com>
2018-03-16 18:24:34 +05:30
Andy Goldstein
db0a670c4a Merge pull request #386 from containscafeine/fix-minio-storage
Change minio volume to emptyDir from hostPath
2018-03-16 08:02:34 -04:00
Shubham Minglani
fd2bf9f03a Change minio volume to emptyDir from hostPath
This commit changes the type of volume mounted inside the minio pod
from hostPath to emptyDir. This is done because minio requires
at least 1Gi to start, but the default hostPath under /tmp in
minishift does not have enough capacity.

Fixes #382

Signed-off-by: Shubham <shubham@linux.com>
2018-03-16 14:40:35 +05:30
Andy Goldstein
3172e907a1 Merge pull request #341 from skriss/snapshot-tags
Add tags to snapshots, restored volumes
2018-03-14 12:50:40 -04:00
Andy Goldstein
07fcc927b7 Merge pull request #359 from skriss/reduce-azure-polling-interval
Azure: reduce client polling interval from default 60s to 5s
2018-03-14 12:17:54 -04:00
Steve Kriss
45cee7d222 Azure: reduce client polling interval from default 60s to 5s
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-03-14 09:07:20 -07:00
Andy Goldstein
bd505fb0ad Merge pull request #378 from skriss/fix-az-snap-deletion
Azure: fix bug preventing snapshot deletion
2018-03-14 06:53:28 -04:00
Steve Kriss
b2b16b3c85 Azure: fix bug preventing snapshot deletion
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-03-13 17:03:14 -07:00
Steve Kriss
0388845bca AWS: tag snapshots during create
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-03-13 12:17:50 -07:00
Steve Kriss
0dddfc3e0f update AWS SDK to 1.13.12, remove unused Azure package
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-03-13 12:17:50 -07:00
Steve Kriss
a05ae1a7cf add useful Ark tags to snapshots
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-03-13 12:17:50 -07:00
Steve Kriss
df985bca74 Azure: copy tags from volume to snapshot, and snapshot to volume
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-03-13 12:17:50 -07:00
Steve Kriss
cab904570f GCP: copy tags from volume to snapshot, and snapshot to volume
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-03-13 11:52:09 -07:00
Steve Kriss
9673e9d158 AWS: copy tags from volume to snapshot, and snapshot to volume
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-03-13 11:52:09 -07:00
Steve Kriss
51c546786e Merge pull request #374 from sanketjpatel/feat/exclude-events-restore
Add events to nonRestorableResources and cohabitatingResources
2018-03-13 11:23:17 -07:00
Andy Goldstein
f83b1de1dc Merge pull request #356 from skriss/store-azure-snapshot-uri
Azure: store snapshot URI to support cross-resource group restores
2018-03-13 13:45:48 -04:00
Steve Kriss
409f17361d Azure: store snapshot URI to support cross-resource group restores
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-03-13 09:18:20 -07:00
Sanket Patel
7257a75f82 Add events to nonRestorableResources and cohabitatingResources
Fixes #367
Fixes #368

Signed-off-by: Sanket Patel <sanketpatel.301090@gmail.com>
2018-03-12 19:55:32 -05:00
Andy Goldstein
8d8ae9c2df Merge pull request #363 from hopkinsth/master
add policy document for AWS with only necessary permissions
2018-03-08 13:24:13 -05:00
Thomas Hopkins
5b8a9d9632 add policy document for AWS with only necessary permissions
Signed-off-by: Thomas Hopkins <hopkinsth@gmail.com>
2018-03-08 13:07:48 -05:00
Andy Goldstein
178a007b70 Merge pull request #362 from skriss/tweak-hook-logging
during backup, only log if hooks are actually executing
2018-03-07 13:37:03 -05:00
Steve Kriss
26944cf9a2 only log if hooks are actually executing
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-03-07 09:29:27 -08:00
Andy Goldstein
7328fd0e10 Merge pull request #343 from skriss/gc-bug
add an AddFunc to handle finalizers in GC for initial lists/resyncs
2018-03-06 16:41:57 -05:00
Andy Goldstein
fd579f5f16 Merge pull request #321 from roytman/ibm-object-storage
Ibm object storage
2018-03-06 10:53:05 -05:00
roytman@il.ibm.com
5cc29e0db2 Add IBM Cloud Object Storage as Ark's backup destination
Signed-off-by: roytman@il.ibm.com <roytman@il.ibm.com>
2018-03-06 17:46:26 +02:00
Steve Kriss
973f630cc7 Merge pull request #344 from ncdc/remove-azure-location-requirement
Remove Azure location requirement
2018-03-05 12:35:06 -08:00
Andy Goldstein
331e0c28cc Remove Azure location requirement
Instead of requiring the Ark admin to specify a "location" in the azure
persistentVolumeProvider config (meaning only a single location is
supported), get info about the disk (for its location) when creating a
snapshot, and get info about the snapshot (for its location) when
creating a disk from a snapshot.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-03-05 15:20:58 -05:00
Andy Goldstein
7c7bfb06b4 Merge pull request #342 from skriss/refactor-restore-cmd
add --from-backup flag to ark restore create & allow restore naming
2018-03-05 13:24:29 -05:00
Steve Kriss
0c41688354 regen docs
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-03-05 10:06:43 -08:00
Steve Kriss
c281124cba add --from-backup flag to ark restore create & allow restore name
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-03-05 10:06:43 -08:00
Nolan Brubaker
f53d605e77 Merge pull request #349 from ncdc/fix-error-return
Fix incorrect return when err != nil
2018-03-05 11:10:38 -05:00
Andy Goldstein
6930c846e5 Fix incorrect return when err != nil
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-03-05 10:57:23 -05:00
Nolan Brubaker
9d03315558 Merge pull request #348 from ncdc/fix-readme-heptio-ark-server
Use correct namespace for ark server deployment
2018-03-05 10:53:20 -05:00
Andy Goldstein
d5cdbb0ab7 Use correct namespace for ark server deployment
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-03-05 10:39:32 -05:00
Andy Goldstein
cc9be4489a Merge pull request #345 from skriss/gcp-project
extract GCP project ID from creds file, remove from config
2018-03-05 10:35:39 -05:00
Steve Kriss
cbff5ef53b extract GCP project ID from creds file, remove from config
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-03-02 09:15:12 -08:00
Steve Kriss
509431909a add an AddFunc to handle finalizers in GC for initial lists/resyncs
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-02-28 16:56:23 -08:00
Steve Kriss
975dce929c Merge pull request #331 from lypht/schedule
Include cron examples for schedule creation
2018-02-28 15:32:28 -08:00
Josh Hull
f733869142 Include cron examples for schedule creation
Signed-off-by: Josh Hull <josh.hull@lypht.com>
2018-02-28 16:50:52 -06:00
Steve Kriss
52641e8e29 Merge pull request #334 from ncdc/run-ark-server-locally
Run ark server locally
2018-02-28 13:06:02 -08:00
Andy Goldstein
7de129e4a3 Merge pull request #335 from nrb/master
Update the ROADMAP to reflect 0.7.0 release
2018-02-27 17:02:38 -05:00
Nolan Brubaker
dc8bc5f486 Update the ROADMAP to reflect 0.7.0 release
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-02-27 16:46:51 -05:00
Andy Goldstein
e3c40a1de7 Regen docs
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-02-27 14:51:13 -05:00
Andy Goldstein
e618e0e456 server: allow configurable plugin dir
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-02-27 14:50:38 -05:00
Andy Goldstein
f13b0c00a3 server: don't assume /ark for internal plugins
If you want to test changes to the ark server without having to rebuild
and redeploy the ark container, this change allows you to do something
like this (assuming you've created your cloud credentials file):

AWS_SHARED_CREDENTIALS_FILE=credentials-minio ark server -n heptio-ark

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-02-27 14:32:45 -05:00
Nolan Brubaker
e73ba839f3 Merge pull request #296 from blakebarnett/bdb/add_kubecontext_flag
Adds a kubecontext global flag
2018-02-26 17:05:59 -05:00
Nolan Brubaker
abeeee6643 Merge pull request #333 from ncdc/add-force-delete-backup
Allow forced backup deletion
2018-02-26 16:44:37 -05:00
Andy Goldstein
d24fb232cc Allow forced backup deletion
Add --force and --confirm to `ark backup delete` to support forced
backup deletion. This forcibly removes the Ark GC finalizer (if it's
present) from a backup and will orphan any resources associated with the
backup, such as backup tarballs in object storage, persistent volume
snapshots, and restores for the backup.

If a backup has a deletion timestamp, display `Deleting` in `ark backup
describe` and `ark backup get`.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-02-26 16:25:22 -05:00
Blake
465c60b408 Add global kubecontext CLI flag
Signed-off-by: Blake <blake.barnett@postmates.com>
2018-02-26 10:47:39 -08:00
Nolan Brubaker
fcbc7bd570 Merge pull request #302 from ncdc/check-backup-before-creating-restore
Error if backup missing when creating a restore
2018-02-26 12:05:38 -05:00
Steve Kriss
530e22939d Merge pull request #326 from ncdc/changelog-0.7.1
Update changelog for v0.7.1
2018-02-22 17:55:52 -08:00
Andy Goldstein
22ec2a3d56 Update changelog for v0.7.1
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-02-22 20:51:58 -05:00
Jennifer Rondeau
7e0a629db1 Merge pull request #325 from Bradamant3/test-doc-paths
fix syntax for doc paths on GH
2018-02-21 14:45:55 -05:00
JENNIFER RONDEAU
41b1a80398 fix syntax for doc paths on GH
Signed-off-by: JENNIFER RONDEAU <jrondeau@heptio.com>
2018-02-21 14:29:17 -05:00
Andy Goldstein
601d9f2da1 Merge pull request #323 from Bradamant3/move-server-docs
edit troubleshooting, add links
2018-02-21 13:53:07 -05:00
JENNIFER RONDEAU
a289b1c645 edit per comments
Signed-off-by: JENNIFER RONDEAU <jrondeau@heptio.com>
2018-02-21 13:39:10 -05:00
JENNIFER RONDEAU
bc77307d75 edit troubleshooting, add links
Signed-off-by: JENNIFER RONDEAU <jrondeau@heptio.com>
2018-02-21 13:18:34 -05:00
Andy Goldstein
2bc8c52053 Merge pull request #322 from ncdc/run-server-in-separate-ns
Move ark server & minio to heptio-ark-server ns
2018-02-21 11:03:07 -05:00
Andy Goldstein
a0111d875f Add troubleshooting doc for backups stuck deleting
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-02-21 10:46:08 -05:00
Andy Goldstein
08d4fc8b88 Move ark server & minio to heptio-ark-server ns
Move ark server deployment & minio deployment to a separate namespace
from the backups/schedules/restores/config because backups now have a
finalizer. If everything lives in one namespace, you have to delete all
the backups and wait for the GC controller to process them and remove the
finalizer from each before deleting the namespace.

By moving the server into a separate namespace, users can now delete the
heptio-ark namespace the normal way (kubectl delete), and once that
namespace is fully removed, they can delete the heptio-ark-server
namespace.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-02-20 12:41:38 -05:00
Andy Goldstein
46adb6c6aa Merge pull request #319 from chasestarr/fix-cloud-provider-doc-links
fixes broken cloud provider doc links
2018-02-19 12:39:58 -05:00
Chase Starr
c417e30a07 fixes broken cloud provider doc links
Signed-off-by: Chase Starr <chasestarr@gmail.com>
2018-02-16 11:30:06 -08:00
Andy Goldstein
f449e238fc Merge pull request #313 from Bradamant3/0.7-doc-updates
Add doc changes for 0.7.0
2018-02-15 15:25:47 -05:00
Steve Kriss
dc5bbada36 Merge pull request #315 from ncdc/changelog-0.7.0
Update changelog for v0.7.0
2018-02-15 11:54:10 -08:00
Andy Goldstein
621d0fad4e Update changelog for v0.7.0
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-02-15 13:48:39 -05:00
JENNIFER RONDEAU
3b8e32facc add doc changes for 0.7.0
Signed-off-by: JENNIFER RONDEAU <jrondeau@heptio.com>
2018-02-15 13:25:18 -05:00
Steve Kriss
ac1f833415 Merge pull request #293 from ncdc/add-roadmap
Add initial ROADMAP.md
2018-02-05 19:02:37 -08:00
Andy Goldstein
cc4d2916fa Error if backup missing when creating a restore
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-02-05 13:29:48 -05:00
Steve Kriss
11f2be6254 Merge pull request #294 from ncdc/mkdir-p
Create the config directory in case it's missing
2018-02-02 13:07:45 -08:00
Andy Goldstein
b2cd8e1fe8 Create the config directory in case it's missing
Always try to create the config directory when saving the client config
in case it doesn't exist.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-02-02 16:01:52 -05:00
Andy Goldstein
262dd46d7a Add initial ROADMAP.md
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-02-02 15:23:05 -05:00
Andy Goldstein
8cf272473d Merge pull request #285 from lypht/improveLocationConstraint
Update s3 bucket creation docs for us-east-1
2018-01-17 11:28:29 -05:00
Josh Hull
50b5c0f8a6 Update s3 bucket creation docs for us-east-1
Signed-off-by: Josh Hull <josh.hull@lypht.com>

improve non-optional location-constraint verbiage

Signed-off-by: Josh Hull <josh.hull@lypht.com>

changing location-constraint to LocationConstraint

Signed-off-by: Josh Hull <josh.hull@lypht.com>

Zero assumptions are optimal

Signed-off-by: Josh Hull <josh.hull@lypht.com>
2018-01-17 10:12:09 -06:00
Andy Goldstein
6712e2a9ec Merge pull request #270 from nrb/fix-232
Clarify backup and restore creation messages
2018-01-11 12:22:11 -05:00
Andy Goldstein
f5f1dbac5d Merge pull request #271 from nrb/fix-246
Invalidate restores based on non-existent backups
2018-01-10 13:24:53 -05:00
Andy Goldstein
1035cf72ce Merge pull request #249 from skriss/update-gcp-lib
update GCP client libraries
2018-01-08 14:55:18 -05:00
Steve Kriss
af81f589f6 update GCP block store to use v1 library, and tag snapshots on create
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-01-08 09:23:32 -08:00
Steve Kriss
350fd894f3 vendor GCP compute v1 library
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-01-08 09:22:57 -08:00
Nolan Brubaker
37f498cd37 Clarify backup and restore creation messages
When running `ark <resource> create`, a request is sent to the server,
but the status is not immediately known. Inform the user that a request
was sent and provide a way to get more information on it.

Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-01-08 10:26:51 -05:00
Nolan Brubaker
bb7b0a3c33 Invalidate restores based on missing backups
When creating a restore based on a backup that doesn't exist, the
restore should be marked as invalid and the error clearly communicated
so the user understands why the restore wasn't made.

Previously, the restore was left as in progress with an error attached.

Since restores are CRDs and must be updated via a controller, there's
currently not a way to give the client immediate errors.

Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-01-08 10:10:01 -05:00
Steve Kriss
b53ee44176 update GCP object store to use new/recommended lib
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-01-05 14:21:13 -08:00
Steve Kriss
e130011d1e Merge pull request #272 from ncdc/arbitrary-namespaces
Support running in any namespace
2018-01-05 14:15:18 -08:00
Steve Kriss
4264abd77f Merge pull request #243 from ncdc/pre-post-hooks
Support both pre and post backup hooks
2018-01-05 14:03:48 -08:00
Andy Goldstein
47da01c0e9 Regen docs
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-01-05 16:52:53 -05:00
Andy Goldstein
816f14c0b4 Support running in any namespace
Add the ability for the Ark server to run in any namespace.

Add `ark client config get/set` for manipulating the new client
configuration file in $HOME/.config/ark/config.json. This holds client
defaults, such as the Ark server's namespace (to avoid having to specify
the --namespace flag all the time).

Add a --namespace flag to all client commands.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-01-05 16:51:59 -05:00
Andy Goldstein
326eb7a4e8 Merge pull request #273 from skriss/pv-annotations-docs-fix
remove outdated line about backups removing PV annotations
2018-01-05 15:10:16 -05:00
Steve Kriss
92a18f490b remove outdated line about backups removing PV annotations
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-01-05 10:30:41 -08:00
Andy Goldstein
de785af89d Support pre and post hooks.
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-01-05 10:47:34 -05:00
Andy Goldstein
d56b5f2b66 Updated generated CRD code
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-01-04 10:44:20 -05:00
Andy Goldstein
412793e809 Update client-go to v6.0.0
Also update:
- kubernetes to v1.9.0
- k8s.io/api, k8s.io/apimachinery, k8s.io/code-generator to kubernetes-1.9.0
- gengo to b58fc7edb82e0c6ffc9b8aef61813c7261b785d4 (to match code-generator)

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-01-04 10:44:19 -05:00
Steve Kriss
656428d0b9 Merge pull request #250 from ncdc/backup-controller-do-as-much-as-possible
BackupController: do as much as possible
2018-01-03 12:10:51 -08:00
Andy Goldstein
1b124a3146 Log backup item action error when it occurs
If a backup item action errors, log the error as soon as it occurs, so
it's clear when the error happened. Also include information about the
groupResource, namespace, and name of the item in the error.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-01-03 13:20:05 -05:00
Andy Goldstein
6b0b6373da Merge pull request #252 from skriss/delete-backup
add delete backup cmd using finalizer and simplify GC process
2018-01-02 14:26:03 -05:00
Andy Goldstein
56ca4bab2f Merge pull request #268 from skriss/2018
update copyright header to 2018 and make language/casing consistent
2018-01-02 14:16:26 -05:00
Steve Kriss
1503796419 make language and casing consistent across copyrights
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-01-02 10:51:49 -08:00
Steve Kriss
3b157afbbd update copyright year to 2018 for generated files
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-01-02 10:48:42 -08:00
Andy Goldstein
17fde8387a Merge pull request #263 from skriss/keep-pv-annotations
don't remove annotations from PVs on restore
2018-01-02 13:42:25 -05:00
Steve Kriss
1c974782fa disable GC and backup deletion if Kubernetes is less than v1.7.5
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-12-22 10:25:32 -08:00
Steve Kriss
8878ba860e don't remove annotations from PVs on restore
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-12-21 13:23:48 -08:00
Jennifer Rondeau
83e85ff2ab Merge pull request #259 from skriss/create-bucket-docs
add create bucket step to cloud provider docs, simplify example with PVs
2017-12-21 11:35:43 -08:00
Steve Kriss
cbc8a7927e remove tagging of PV from with PV example, backup by namespace
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-12-21 10:54:27 -08:00
Steve Kriss
8e5feec39c include restore & schedule under ark delete
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-12-21 10:47:37 -08:00
Steve Kriss
f5123794e0 add delete backup cmd using finalizer and simplify GC process
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-12-21 10:47:37 -08:00
Steve Kriss
5fc5bdbcf8 add create bucket step to cloud provider docs
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-12-21 09:26:14 -08:00
Andy Goldstein
0fc087c967 Flatten aggregated errors
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-12-21 11:56:33 -05:00
Jennifer Rondeau
7cc73fb9d2 Merge pull request #237 from nrb/gke-rbac
Document GKE cluster-admin step
2017-12-20 17:38:05 -08:00
Steve Kriss
732ba2f3e0 Merge pull request #258 from ncdc/prioritize-service-accounts
Add serviceaccounts to prioritized resources
2017-12-20 15:16:41 -08:00
Andy Goldstein
fbda5fe539 Add serviceaccounts to prioritized resources
Add serviceaccounts to the default list of prioritized resources used
when restoring.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-12-20 14:59:47 -05:00
Andy Goldstein
1e581f1ead BackupController: do as much as possible
When running a backup, try to do as much as possible, collecting errors
along the way, and return an aggregate at the end. This way, if a backup
fails for most reasons, we'll be able to upload the backup log file to
object storage, which wasn't happening before.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-12-20 14:49:27 -05:00
Andy Goldstein
fea701a03b Merge pull request #256 from skriss/unbound-pvc-fix
don't error if PVC is not bound to a PV
2017-12-19 19:37:28 -05:00
Andy Goldstein
1210cb36e1 Merge pull request #253 from skriss/update-license
Update all license headers
2017-12-19 19:26:54 -05:00
Steve Kriss
79c0e5a09a don't error if PVC is not bound to a PV
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-12-19 14:10:58 -08:00
Nolan Brubaker
7392cdf37b Clarify why cluster-admin is needed
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2017-12-19 15:40:22 -05:00
Nolan Brubaker
ccdbee6b16 Clarify different deployment options on GCP.
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2017-12-19 15:37:51 -05:00
Steve Kriss
3641c2c043 update all license headers
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-12-15 13:38:12 -08:00
Andy Goldstein
0045bb057d Merge pull request #241 from skriss/patch
switch from Update() to Patch()
2017-12-14 13:59:23 -05:00
Steve Kriss
56c9d68137 switch to logrus.FieldLogger and arktest.NewLogger() everywhere
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-12-13 09:38:00 -08:00
Steve Kriss
4aea9b9a2c switch from Update() to Patch()
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-12-12 15:23:45 -08:00
Nolan Brubaker
75fdf32e4c Document GKE cluster-admin step
When using GKE, an additional step is needed to become cluster admin.
Without this, generating the RBAC scaffolding will result in an error.

Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2017-12-07 11:59:11 -05:00
Nolan Brubaker
6d5eeb21f5 Merge pull request #236 from ncdc/makefile-pass-version-through
Pass VERSION all the way down during 'make release'
2017-12-04 12:01:52 -05:00
Andy Goldstein
a70addcaf7 Pass VERSION all the way down during 'make release'
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
(cherry picked from commit d053dc2914)
2017-12-04 11:56:14 -05:00
Steve Kriss
ee16aab378 Merge pull request #231 from ncdc/fix-changelog-links
Fix changelog links
2017-11-30 11:24:45 -08:00
Andy Goldstein
a4d3d333ee Fix changelog links
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-11-30 14:14:53 -05:00
Steve Kriss
632c90bd08 Merge pull request #230 from ncdc/changelog-0.6.0
Changelog for 0.6.0
2017-11-30 09:37:39 -08:00
Andy Goldstein
17fcedefae Changelog for 0.6.0
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-11-30 12:33:24 -05:00
Andy Goldstein
992940c55c Merge pull request #227 from skriss/plugin-logger-fix
Bug fixes: obj/block store plugin logging and remapped namespaces issue
2017-11-30 12:17:56 -05:00
Steve Kriss
121b7153a7 when restoring, don't restore the Namespaces cluster-scoped resource independently
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-11-30 09:07:38 -08:00
Andy Goldstein
bd8f433188 Merge pull request #229 from skriss/plugin-docs
add godoc for ResourceSelector
2017-11-30 11:25:53 -05:00
Steve Kriss
94ac3b3529 godoc for ResourceSelector
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-11-30 08:20:27 -08:00
Nolan Brubaker
41ec1c540c Merge pull request #218 from skriss/plugin-docs
add/update plugin documentation
2017-11-29 21:36:32 -05:00
Steve Kriss
8a0ac2117b give each plugin its own logrusAdapter
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-11-29 14:36:21 -08:00
Steve Kriss
cbcd15d603 add/update documentation for plugins
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-11-29 14:24:23 -08:00
Andy Goldstein
3100e856a0 Merge pull request #226 from skriss/plugin-tweaks
Remove obsolete plugin function and rename NewPluginLogger function
2017-11-29 17:22:12 -05:00
Steve Kriss
b66efd9416 rename NewPluginLogger to NewLogger
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-11-29 14:01:31 -08:00
Steve Kriss
038fa39451 remove ListSnapshots and GetAllSnapshots
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-11-29 13:59:29 -08:00
Andy Goldstein
7e3fc0884e Merge pull request #217 from skriss/plugin-cmd
add plugin add/remove commands
2017-11-29 15:31:44 -05:00
Steve Kriss
995050390c add plugin add/remove commands
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-11-29 12:22:30 -08:00
Steve Kriss
0b6e78145c Merge pull request #223 from ncdc/simplify-plugin-serve
Simplify serving plugins for external developers
2017-11-29 11:09:22 -08:00
Steve Kriss
5b8562e73c Merge pull request #222 from ncdc/fix-log-location-hook
Fix log location hook prefix stripping
2017-11-29 11:07:43 -08:00
Andy Goldstein
dc484d1566 Set logger for cloudprovider plugin
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-11-29 13:54:20 -05:00
Andy Goldstein
1f7e9b65e8 Simply serving plugins for external developers
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-11-29 13:42:53 -05:00
Steve Kriss
c129d1cec3 Merge pull request #215 from ncdc/support-custom-snapshots
Support custom volume snapshots & restores
2017-11-29 10:34:06 -08:00
Andy Goldstein
c700455272 Support custom volume snapshots & restores
The main Ark code was hard-coding specific support for AWS, GCE, and
Azure volume snapshots and restores, and anything else was considered
unsupported.

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

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-11-29 13:19:40 -05:00
Andy Goldstein
99f67db39d Fix log location hook prefix stripping
The log location hook was matching github.com/heptio/ark and stripping
off that + 1 more char. This meant that
github.com/heptio/ark-plugin-example/foo.go was being listed as
plugin-example/foo.go instead of
github.com/heptio/ark-plugin-example/foo.go.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-11-29 12:56:01 -05:00
Andy Goldstein
526b604237 Add boolptr helper package
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-11-29 12:25:10 -05:00
Nolan Brubaker
8e740faafc Merge pull request #216 from ncdc/azure-docs
Update Azure specifics
2017-11-29 10:06:39 -05:00
Andy Goldstein
0c092eaa17 Update Azure specifics
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-11-29 08:58:56 -05:00
Andy Goldstein
f0b35cc45a Merge pull request #213 from skriss/restore-action-plugins
Convert restorers to plugins
2017-11-28 14:50:41 -05:00
Steve Kriss
179b95c81d convert restorers to plugins
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-11-28 10:58:12 -08:00
Andy Goldstein
98d370f84d Merge pull request #196 from ncdc/describe
Add describers for backups, schedules
2017-11-27 16:29:30 -05:00
Andy Goldstein
5dc50e4974 Regen docs
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-11-27 15:22:35 -05:00
Andy Goldstein
c2dc41efd8 Add backup & schedule describers
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-11-27 15:22:20 -05:00
Andy Goldstein
062a5d7557 Remove fmt target as it's handled by update
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-11-27 14:30:26 -05:00
Andy Goldstein
ad47513170 Change minio s3 url to minio.heptio-ark.svc
If you have "cluster.local" as a search domain in /etc/resolv.conf and
you have DNS set up so it can resolve cluster.local queries (e.g.
with dnsmasq), this makes commands such as `ark restore logs` work
correctly outside of the cluster.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-11-27 14:30:26 -05:00
Andy Goldstein
932b8259ae Merge pull request #206 from skriss/action-plugins
Backup ItemAction plugins
2017-11-21 16:46:44 -05:00
Steve Kriss
0f2d1ab82b migrate backup actions to plugins
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-11-21 10:03:03 -08:00
Nolan Brubaker
2ce15de2f8 Merge pull request #202 from ncdc/fix-debugging-restores-info
Update restore debugging info
2017-11-17 10:15:18 -05:00
Steve Kriss
fc6da9b3db Merge pull request #203 from ncdc/log-server-version
Log server version at startup
2017-11-15 12:13:59 -08:00
Andy Goldstein
0d42815d31 Merge pull request #204 from nrb/extend-ttl
Update default TTL to 30 days
2017-11-15 07:03:35 -05:00
Nolan Brubaker
194d21c6a3 Update default TTL to 30 days
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2017-11-14 17:03:30 -05:00
Andy Goldstein
c57a9b94b9 Log server version at startup
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-11-14 16:58:14 -05:00
Andy Goldstein
c2fa812ffb Update restore debugging info
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-11-14 15:10:13 -05:00
Steve Kriss
9996eec6be Merge pull request #201 from ncdc/restore-results-file-seek
Seek to 0 before uploading restore results
2017-11-14 11:45:03 -08:00
Andy Goldstein
b184c0b348 Seek to 0 before uploading restore results
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-11-14 14:39:42 -05:00
Steve Kriss
01e9c86a01 Merge pull request #199 from ncdc/log-enhancements
Log enhancements
2017-11-14 11:29:04 -08:00
Andy Goldstein
eb6f1a7b5c Fix minio config
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-11-14 14:24:33 -05:00
Andy Goldstein
4c481f4d23 Make logSource more concise
Strip off leading .../github.com/heptio/ark/

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-11-14 14:21:19 -05:00
Andy Goldstein
af189fd5f4 Add error & logSource hooks to backup & restore loggers
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-11-14 14:19:52 -05:00
Andy Goldstein
34a6f492e5 Log restore start/end
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-11-14 14:19:52 -05:00
Andy Goldstein
38aa43885b Log when starting a backup
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-11-14 14:19:52 -05:00
Andy Goldstein
015869cc29 Merge pull request #188 from skriss/cloudprovider-plugins
Convert existing cloudproviders to plugins
2017-11-14 14:17:38 -05:00
Steve Kriss
7fb507689f update docs and examples
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-11-14 10:38:26 -08:00
Steve Kriss
8ba5a29679 add a logger that can be used within plugins to emit logs into Ark server
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-11-14 10:38:26 -08:00
Steve Kriss
24ce316788 switch built-in cloud providers to run as plugins
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-11-14 09:47:36 -08:00
Steve Kriss
3975187d57 add .proto files, generated code, and gen script for object/block stores
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-11-13 15:43:14 -08:00
Steve Kriss
cb49c62aaf implement stream reader for gRPC byte streams
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-11-13 15:43:13 -08:00
Steve Kriss
35b46e392c add github.com/hashicorp/go-plugin dependency
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-11-08 16:58:47 -08:00
Steve Kriss
21e2019540 rename Block/ObjectStoreAdapter -> Block/ObjectStore
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-11-08 16:58:47 -08:00
Steve Kriss
71bb702297 Merge pull request #191 from ncdc/improve-logging
Add more group-resource level logging
2017-11-08 15:15:26 -08:00
Steve Kriss
e21c66c494 Merge pull request #186 from ncdc/version-edits
Include git describe info in binary names.
2017-11-08 15:12:53 -08:00
Andy Goldstein
737b6d932a Add more group-resource level logging
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-11-08 12:08:57 -05:00
Andy Goldstein
3f840d4ce5 Merge pull request #187 from lukepatrick/master
Debug typo
2017-11-07 06:26:51 -05:00
lukepatrick
390e47b08b Debug typo
Signed-off-by: lukepatrick <lukephilips@gmail.com>
2017-11-06 15:59:45 -07:00
Andy Goldstein
962ea4708e Include git describe info in binary names.
New format now looks like this:
ark-v0.5.0-44-g72b0bdd-dirty-linux-amd64.tar.gz

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-11-06 16:21:09 -05:00
Nolan Brubaker
72b0bdde70 Merge pull request #184 from ncdc/master-changelog-051
Add 0.5.1 to changelog
2017-11-06 07:41:02 -08:00
Andy Goldstein
4ee6b81647 Add 0.5.1 to changelog
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
(cherry picked from commit e4e6a31a58)
2017-11-06 10:36:12 -05:00
Steve Kriss
5e4fc8f84a Merge pull request #182 from ncdc/include-namespace
Fix missing namespace resource when backing up namespaces with auto cluster resources
2017-11-03 13:56:11 -07:00
Andy Goldstein
efa4e57d1e More namespace special casing
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-11-03 16:34:07 -04:00
Devan Goodwin
9471f9da3c Fix missing namespace metadata after restore.
If backing up specific namespaces with "auto" cluster resources, the
actual namespace objects themselves were not being included in the
backup. Restore would create them but any labels or metadata would be
lost.

Instead handle the special case of namespace as a cluster level resource
we may still need, even if excluding most cluster level resources.

Signed-off-by: Devan Goodwin <dgoodwin@redhat.com>
2017-11-03 12:12:03 -03:00
Steve Kriss
8b25114047 Merge pull request #173 from ncdc/move-restore-warnings-errors-to-files
Move restore status warnings/errors to object storage; add restore describe command
2017-11-02 12:58:24 -07:00
Andy Goldstein
b2d80471ac Move restore warnings/errors to object storage
If you have a large number of warnings and/or errors, the restore
object's size can exceed the maximum allowed by etcd. Move them to
object storage, and add a new describe command to fetch and display them
on the fly.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-11-02 15:53:59 -04:00
Andy Goldstein
203a9c6e05 Merge pull request #179 from skriss/fix-ns-mapping
Fix restore namespace remapping bug
2017-11-02 14:00:15 -04:00
Steve Kriss
55c038afa0 fix restore namespace remapping bug
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-11-02 10:39:54 -07:00
Andy Goldstein
7f959f0184 Merge pull request #174 from skriss/obj-store-reader
Switch PutObject to take an io.Reader rather than an io.ReadSeeker
2017-11-02 12:57:09 -04:00
Steve Kriss
c49d11f17a Merge pull request #171 from nrb/168-fix
Don't delete 'headless' services
2017-11-01 16:30:32 -07:00
Steve Kriss
e7703d88ec switch UploadBackup, UploadRestoreLog, PutObject to take io.Reader
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-11-01 15:48:13 -07:00
Steve Kriss
f28d008017 update dependencies
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-11-01 15:48:13 -07:00
Nolan Brubaker
d87e8ee16e Don't delete 'headless' services
Deleting the clusterIP field when the service should be headless will
cause it to be assigned a new IP on restore; instead it should retain
the headless state after restoration.

Fixes #168

Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2017-11-01 14:47:08 -07:00
Steve Kriss
4f59b19cdc Merge pull request #169 from nrb/160-fix
Use label selector in backup, restore, schedule lists
2017-10-31 16:38:07 -07:00
Nolan Brubaker
36a40a0cd3 Use provided options when getting lists
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2017-10-31 16:13:28 -07:00
Steve Kriss
073795715e Merge pull request #154 from ncdc/backup-download-remove-file-on-error
backup download: remove file if there's an error
2017-10-30 18:49:57 -07:00
Steve Kriss
7f78d5cbbc Merge pull request #166 from ncdc/travis-badge
Switch build status badge to travis
2017-10-30 13:04:51 -07:00
Andy Goldstein
9401ca3c1a Switch build status badge to travis
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-30 15:49:03 -04:00
Steve Kriss
93b2f30e32 Merge pull request #157 from ncdc/client-go-5
Upgrade to client-go v5.0.1, kubernetes v1.8.2
2017-10-30 12:34:16 -07:00
Andy Goldstein
9c3d7f9098 Merge pull request #163 from lli-hiya/master
update config definition for KMS key alias support
2017-10-30 14:43:16 -04:00
Andy Goldstein
0fab2e5e89 Stop passing encoder/decoder to NewHumanReadablePrinter
We only need them if we've got unstructured/unknown data and we want to
convert it to typed objects.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-30 14:07:58 -04:00
Andy Goldstein
39f0a4e561 Install goimports if needed (travis)
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-30 13:51:04 -04:00
Andy Goldstein
c1bc52eb65 Update gofmt
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-30 13:31:03 -04:00
Andy Goldstein
64632e29f8 Tweak test, update-fmt, add verify-fmt
Remove verifying gofmt from hack/test.sh.
Make sure hack/update-fmt.sh ignores zz_generated files.
Enable code simplification for gofmt.
Add hack/verify-fmt.sh.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-30 13:31:03 -04:00
Andy Goldstein
78dc641b15 Add k8s.io/apimachinery/pkg/apimachinery/registered to required imports
The generated clientsets use this package, but there are no explicit
imports, so we have to manually require it.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-30 13:31:03 -04:00
Andy Goldstein
eaf84eafb6 Bump client-go to v5.0.1
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-30 13:31:03 -04:00
Andy Goldstein
b8cd614122 Remove Gopkg.toml required/ignores hacks
These were for the upgrade from client-go v4.x to v5.x.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-30 13:31:03 -04:00
Andy Goldstein
aa253bf016 Use generated deep copy functions
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-30 13:31:03 -04:00
Andy Goldstein
293674c40e React to upstream spdy executor changes
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-30 13:31:03 -04:00
Andy Goldstein
322cbc19e6 dynamicResourceClient: fix resourceClient type
dynamicClient.Resource() now returns an interface

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-30 13:31:03 -04:00
Andy Goldstein
15fe87aea3 Fix clientset imports
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-30 13:31:03 -04:00
Andy Goldstein
4957dfce61 Regenerate code
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-30 13:31:03 -04:00
Andy Goldstein
9249a13661 Switch to k8s.io/code-generator script
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-30 13:31:03 -04:00
Andy Goldstein
843345f728 Prep types for 1.8 code-generator
Fix genclient tags
Add deepcopy-gen interfaces to top level types

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-30 13:30:27 -04:00
Andy Goldstein
43449885a1 React to move to k8s.io/api
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-30 13:30:27 -04:00
Andy Goldstein
18eafd5606 Update k8s, client-go, apimachinery deps
Update k8s.io/kubernetes to v1.8.
Update k8s.io/client-go to v5.0.0
Update k8s.io/apimachinery to match
Pull in k8s.io/api release-1.8 branch
Pull in k8s.io/code-generator release-1.8 branch

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-30 13:30:27 -04:00
Andy Goldstein
e5c8d3316f Add go boilerplate file
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-30 13:30:26 -04:00
Steve Kriss
c3feb0489f Merge pull request #165 from ncdc/travis
Add travis support
2017-10-30 10:04:25 -07:00
Andy Goldstein
1af01e28ef Add travis support
Remove realpath as Travis doesn't have it
Use bash instead of sh for build + test

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-30 12:58:45 -04:00
Liang
67811606c0 update config definition for KMS key alias support
Signed-off-by: Liang <lli@hiya.com>
2017-10-27 16:40:45 -07:00
Andy Goldstein
2cdd8448c2 Merge pull request #156 from athampy/master
Fix #137. Remove clock from volume_snapshot_action
2017-10-26 15:01:24 -04:00
Akhil Thampy
1ac0303283 Fix #137. Remove clock from volume_snapshot_action.
Signed-off-by: Akhil Thampy <akhilthampy@yahoo.com>
2017-10-26 13:53:52 -05:00
Steve Kriss
0c13ef06ea Merge pull request #153 from ncdc/make-release
Add 'make release'
2017-10-26 08:25:24 -07:00
Andy Goldstein
8a53cef7e6 backup download: remove file if there's an error
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-26 11:09:35 -04:00
Andy Goldstein
81d47887ae Add 'make release'
Add 'make release' that automatically creates tarballs for all CLI
platforms in _output/release. It also creates a CHECKSUM file using
sha256 sums. Finally, it displays the contents of the CHECKSUM file as
well as the sha256sum of the CHECKSUM file.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-26 10:47:36 -04:00
Andy Goldstein
a3302d3d85 Merge pull request #151 from skriss/v0.5.0-changelog
add changelog for v0.5.0
2017-10-26 07:27:39 -04:00
Steve Kriss
1cfb326685 add changelog for v0.5.0
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-10-25 17:27:33 -07:00
Steve Kriss
900a53137b Merge pull request #150 from ncdc/readd-apk-certs
Restore ca-certificates to image
2017-10-25 09:01:23 -07:00
Andy Goldstein
ce60e53e4b Restore ca-certificates to image
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-25 09:53:43 -04:00
Steve Kriss
710e537dd3 Merge pull request #148 from ncdc/binary-clients
Support cross-compiling for clients
2017-10-24 11:58:28 -07:00
Andy Goldstein
d7c00c199e Replace ark alias with installing in $PATH
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-24 13:59:43 -04:00
Andy Goldstein
0f9acf716b Update docs on building
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-24 13:49:15 -04:00
Andy Goldstein
e38b6d0f4c Support cross-compiling for clients
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-24 12:26:26 -04:00
Andy Goldstein
a1b43c43ad Merge pull request #147 from skriss/restore-inc-cluster-resources-flag
Add --include-cluster-resources flag for restores
2017-10-23 13:55:27 -04:00
Steve Kriss
a7cc58730e add --include-cluster-resources flag to restores (optional, default true)
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-10-23 10:51:07 -07:00
Steve Kriss
e460199536 fix restore log statement
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-10-23 10:50:55 -07:00
Steve Kriss
0729872797 Merge pull request #146 from ncdc/hooks-docs
Add initial doc on hooks.
2017-10-20 12:38:29 -07:00
Andy Goldstein
9b6c34319a Add initial doc on hooks.
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-20 15:31:34 -04:00
Steve Kriss
16b0888894 Merge pull request #143 from ncdc/backup-api-docs
Add docs on Backup API type
2017-10-20 12:08:25 -07:00
Andy Goldstein
3f453d154f Merge pull request #145 from skriss/cluster-admin
give ark cluster-admin privileges
2017-10-20 15:06:43 -04:00
Andy Goldstein
5bcd6de411 Add docs on Backup API type
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-20 15:02:32 -04:00
Steve Kriss
737e00c2e9 give ark cluster-admin privileges
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-10-20 12:00:01 -07:00
Steve Kriss
c7a298c508 Merge pull request #144 from ncdc/fix-version-makefile
Pass VERSION to cbuild so it's resolved correctly
2017-10-20 11:09:55 -07:00
Steve Kriss
d562022030 Merge pull request #81 from ncdc/verb-noun
Add verb-noun command aliases
2017-10-20 11:05:59 -07:00
Andy Goldstein
eaed15cbce Pass VERSION to cbuild so it's resolved correctly
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-20 14:03:29 -04:00
Andy Goldstein
28e7f0851a Add verb-noun command aliases
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-20 13:26:34 -04:00
Steve Kriss
40fff6e3ee Merge pull request #112 from ncdc/hooks-exec
Add backup pod exec hooks
2017-10-20 09:00:24 -07:00
Andy Goldstein
901f8e1302 Add pod exec backup hooks
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-20 10:20:59 -04:00
Steve Kriss
b7c35551d7 Merge pull request #141 from lli-hiya/config-definition-update
kmsKeyID should be kmsKeyId
2017-10-19 16:04:41 -07:00
Liang
df31561c6c kmsKeyID should be kmsKeyId
Signed-off-by: Liang <lli@hiya.com>
2017-10-19 15:51:14 -07:00
Andy Goldstein
efcb32059a Update to latest stretchr/testify master
Need to pick up the mock spewconfig settings to ignore pointer address
differences.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-19 13:22:03 -04:00
Andy Goldstein
09c802e501 Vendor kube pod exec code
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-19 13:22:03 -04:00
Andy Goldstein
bb5088f515 Merge pull request #132 from dgoodwin/ordering
Restructure backup format for resource prioritization
2017-10-17 14:17:48 -04:00
Devan Goodwin
ed0194c09b Restructure backups for resource prioritization.
Previously the directory structure separated resources depending on
whether or not they were cluster or namespace scoped. All cluster
resources were restored first, then all namespace resources. Priority
did not apply across both and you could not order any namespace
resources before any cluster resources.

This restructure sorts firstly on resource type.

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

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

Signed-off-by: Devan Goodwin <dgoodwin@redhat.com>
2017-10-17 08:49:05 -03:00
Andy Goldstein
4fe50ed782 Merge pull request #128 from skriss/include-cluster-resources
add --include-cluster-resources flag to "ark backup create"
2017-10-12 10:42:54 -04:00
Steve Kriss
4085e473e1 additional deployment/networkpolicy cases for TestBackupResource
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-10-11 15:05:12 -07:00
Steve Kriss
07b33ace57 add --include-cluster-resources flag to backup create cmd
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-10-11 15:05:12 -07:00
Andy Goldstein
12cf05568b Merge pull request #129 from abiogenesis-now/jyao/reword-contributors
[license] Reword authors in contributors.md
2017-10-11 15:23:31 -04:00
Jessica Yao
ec34204cba reword authors in contributors.md
Signed-off-by: Jessica Yao <jessica@heptio.com>
2017-10-11 12:20:17 -07:00
Andy Goldstein
2a975a2547 Merge pull request #65 from skriss/cluster-resource-selection
when backing up PVCs, also back up claimed PVs
2017-10-11 13:22:42 -04:00
Steve Kriss
9438a8670a when backing up PVCs, also back up claimed PVs
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-10-11 09:54:57 -07:00
Andy Goldstein
388be34a04 Merge pull request #127 from abiogenesis-now/jyao/contributing/typo-fix
[license] Fix typo in contributing.md
2017-10-11 12:35:11 -04:00
Jessica Yao
1ba2d4613d fix typo in contributing.md
Signed-off-by: Jessica Yao <jessica@heptio.com>
2017-10-11 09:29:42 -07:00
Andy Goldstein
2abeae911a Merge pull request #123 from skriss/switch-backup-restore-log-impl
switch per-backup/restore logs to use logrus
2017-10-10 17:17:26 -04:00
Steve Kriss
fa427ebcfd switch to logrus for per-backup/restore logs
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-10-10 14:11:21 -07:00
Andy Goldstein
df3c51416a Merge pull request #122 from skriss/logging-fixes
logging improvements
2017-10-10 16:18:55 -04:00
Steve Kriss
7c0d9dcfce add missing licenses
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-10-10 13:14:03 -07:00
Steve Kriss
e7c62b5f38 add file/line numbers to logs
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-10-10 13:14:03 -07:00
Steve Kriss
9f3ce8ab1a add log-level flag to server command
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-10-10 13:14:03 -07:00
Steve Kriss
6cf60e5344 remove verbose/stderr glog flags
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-10-10 12:10:42 -07:00
Andy Goldstein
76c1f5e469 Merge pull request #126 from skriss/snapshot-logging-tweaks
tweak volume snapshot action logging messages
2017-10-10 14:19:39 -04:00
Steve Kriss
82655b8359 tweak volume snapshot action logging messages
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-10-10 11:10:50 -07:00
Steve Kriss
d042fe3ebe Merge pull request #125 from ncdc/faq-followup
FAQ follow-up
2017-10-10 10:16:40 -07:00
Steve Kriss
d27b16370c Merge pull request #102 from ashish-amarnath/support-multi-az-pvs
Preserve AWS & GCP volume AZ when snapshotting and restoring PVs.
2017-10-10 10:08:57 -07:00
Andy Goldstein
2b82c96f26 FAQ follow-up
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-10 11:00:44 -04:00
Andy Goldstein
a85a991b0e Merge pull request #113 from julia-stripe/faq
Add a FAQ
2017-10-10 10:53:40 -04:00
ashish-amarnath
6dc81b42f5 Merge branch 'master' into support-multi-az-pvs
Signed-off-by: Ashish Amarnath <ashish.amarnath@gmail.com>
2017-10-06 23:24:41 -07:00
Ashish Amarnath
9fc9dbb413 Preserve PV's AZ info when snapshotting and restoring PVs.
- Read PV's AZ info from fault-domain label of the PV object for snapshotting.
- Store PV's AZ info in the VolumeInfo.
- Add tests for reading the label from the PV object.
- Remove availability zone validation in AWS and GCP BlockStorageAdaptor.
- Add volumeAZ as a parameter to methods in the BlockStorageAdapter interface.
- Get AZ from VolumeInfo when restoring PV snapshot.
- Remove references to PV availability zone in docs.

Signed-off-by: Ashish Amarnath <ashish.amarnath@gmail.com>
2017-10-06 23:24:41 -07:00
Andy Goldstein
9f9908f9cd Merge pull request #99 from jrnt30/non-restorable-resources
Excluding nodes from restoration
2017-10-06 12:02:01 -04:00
Justin Nauman
1fd1e8deaa Excluding nodes and endpoints from restoration
- Introduced a blacklist of resources that are non-restorable.  The
goal being that the backup can still include these resources for
logging/auditing purposes but they are explicitly added to
ExcludedResources in the RestorController's "defaulting" logic
to ensure that if someone were to explicitly ask for nodes
that they would be expressly denied.

Signed-off-by: Justin Nauman <justin.r.nauman@gmail.com>
2017-10-05 22:37:29 -05:00
Andy Goldstein
87f60ed853 Merge pull request #98 from skriss/logrus
migrate from glog to logrus and errors to pkg/errors
2017-10-05 12:06:47 -04:00
Steve Kriss
9ac71b03cc add logrus hook to log error file/line/function from stack traces
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-10-05 08:49:33 -07:00
Steve Kriss
914165095a switch logging to logrus and errors to pkg/errors
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-10-05 08:49:33 -07:00
Steve Kriss
791a06d6d4 vendor pkg/errors
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-10-05 08:46:49 -07:00
Julia Evans
36d5d501f6 reword again
Signed-off-by: Julia Evans <julia@stripe.com>
2017-10-04 14:04:26 -07:00
Julia Evans
cf71544276 fix typo
Signed-off-by: Julia Evans <julia@stripe.com>
2017-10-04 13:54:42 -07:00
Julia Evans
bbef7a3e33 address comments
Signed-off-by: Julia Evans <julia@stripe.com>
2017-10-04 13:42:36 -07:00
Julia Evans
62b32dad1d Add a FAQ
Signed-off-by: Julia Evans <julia@stripe.com>
2017-10-04 13:37:11 -07:00
Steve Kriss
2683ead44e vendor logrus
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-09-25 10:23:35 -07:00
Andy Goldstein
62ab21f849 Merge pull request #100 from timoreimann/patch-1
README: Mention Ark Slack channel.
2017-09-21 06:10:05 -07:00
Timo Reimann
d4244b3d9e README: Mention Ark Slack channel.
Signed-off-by: Timo Reimann <ttr314@googlemail.com>
2017-09-21 07:15:33 +02:00
Steve Kriss
a5d4d138b2 Merge pull request #96 from ncdc/fix-config-watch
Make config change detection more robust
2017-09-19 09:57:52 -07:00
Andy Goldstein
024f65579c Merge pull request #69 from jrnt30/user-agent
Adding in customized user-agent
2017-09-19 09:51:57 -07:00
Justin Nauman
97f8f2426f Addressing PR feedback and adding tests
Signed-off-by: Justin Nauman <justin.r.nauman@gmail.com>
2017-09-18 17:42:16 -05:00
Andy Goldstein
84fa48d57a Make config change detection more robust
Fix 2 issues with config change detection:
- Objects received via Get() don't have kind and apiVersion set, while
those from Watch() do, leading to false positives.
- Compare the unmodified config (prior to applying defaults) to the
updated one from Watch().

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-09-14 17:12:32 -04:00
Steve Kriss
36b1d9378e Merge pull request #91 from ncdc/tag-v0.4.0
Bump to v0.4.0
2017-09-14 08:32:21 -07:00
Andy Goldstein
eef6e0e2c3 Bump to v0.4.0
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-09-14 11:29:01 -04:00
Andy Goldstein
609bf80f9e Merge pull request #90 from skriss/change-azure-apitimeout
change Azure API timeout default to 2m
2017-09-14 09:38:09 -04:00
Andy Goldstein
47a6e71b1f Merge pull request #89 from skriss/set-azuredisk-uri
for azureDisk restores, update the diskURI in addition to diskName
2017-09-14 09:37:40 -04:00
Steve Kriss
5424eba417 change Azure API timeout default to 2m
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-09-13 16:20:12 -07:00
Steve Kriss
acb3babb87 when restoring azureDisk from snapshot, update the diskURI with the new diskName
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-09-13 16:10:30 -07:00
Justin Nauman
d76ed7b49e Adding in customized user-agent
Signed-off-by: Justin Nauman <justin.r.nauman@gmail.com>
2017-09-13 16:35:45 -05:00
Steve Kriss
5405067a2e Merge pull request #88 from ncdc/fix-restore-logs-when-backup-name-has-dash
Support restore logs when backup name has -
2017-09-13 14:14:55 -07:00
Steve Kriss
f31af75dc3 Merge pull request #82 from ncdc/tweak-version-output
Tweak version display
2017-09-13 14:14:44 -07:00
Andy Goldstein
136b8f200d Support restore logs when backup name has -
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-09-13 16:04:46 -04:00
Steve Kriss
40b8d1879b Merge pull request #79 from ncdc/restore-logs
Add per-restore logs
2017-09-13 09:41:42 -07:00
Steve Kriss
a3cfc6fb2d Merge pull request #83 from ncdc/fix-jenkins-badge
Fix jenkins badge to display master branch status
2017-09-13 09:24:58 -07:00
Andy Goldstein
ecd9133e15 Fix jenkins badge to display master branch status
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-09-13 10:19:26 -04:00
Andy Goldstein
81fda27440 Tweak version display
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-09-13 10:16:16 -04:00
Andy Goldstein
b43b65b7bf Revert to prior name format for tarballs
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-09-13 09:51:40 -04:00
Andy Goldstein
7b892b63ed make update
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-09-13 09:51:40 -04:00
Andy Goldstein
e8a88747eb Use pointers when printing schema.GroupResource
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-09-13 09:51:40 -04:00
Andy Goldstein
9deb4d4cae backup download: switch to --output as full path
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-09-13 09:51:40 -04:00
Andy Goldstein
28fac1b156 Don't unzip backup data when streaming
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-09-13 09:51:40 -04:00
Andy Goldstein
273b563c86 Add per-restore logs
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-09-13 09:51:40 -04:00
Andy Goldstein
d0b7880881 Merge pull request #78 from skriss/restore-resource-inc-exc
Add --include-resources, --exclude-resources for restore operations
2017-09-12 15:53:21 -04:00
Andy Goldstein
5899beaec7 Merge pull request #50 from jrnt30/backup-download-option
Adding in support for backup download
2017-09-12 15:52:42 -04:00
Steve Kriss
307cb71e02 update docs for resource includes/excludes for restores
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-09-12 12:43:23 -07:00
Steve Kriss
4dfce17de5 add resource includes/excludes for Restores
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-09-12 12:43:23 -07:00
Justin Nauman
98d4660d27 Adding in support for backup download
- Adding in support for a new `download` subcommand of backup
- Adjusted signing to allow for multiple types
- Adding in git sha version during build more granular version
  debugging

Signed-off-by: Justin Nauman <justin.r.nauman@gmail.com>
2017-09-11 20:17:33 -05:00
Steve Kriss
907ae6c5b0 move groupresource resolution into discovery helper
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-09-11 14:41:50 -07:00
Steve Kriss
f438c226e3 Merge pull request #40 from ncdc/backup-logs
Save logs per backup
2017-09-11 13:31:17 -07:00
Andy Goldstein
ab99fcc2e2 Update backup and log file name formats
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-09-11 15:40:49 -04:00
Andy Goldstein
3bb02ac949 Use ioutil.Discard in unit test
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-09-11 15:40:49 -04:00
Andy Goldstein
71fadf381e Clarify Backup() param names
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-09-11 15:40:49 -04:00
Andy Goldstein
a583f22ea9 Add ActionContext so backup actions can log
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-09-11 15:40:48 -04:00
Andy Goldstein
50a95d052e Delete all objects in backup dir
Delete all objects in backup "dir" when deleting a backup, instead of
hard-coding individual file names/types. This way, we'll be able to
delete log files and anything else we add without having to update our
deletion code.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-09-11 15:40:48 -04:00
Andy Goldstein
193000e487 Add ListObjects (for backup dir deletions)
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-09-11 15:40:48 -04:00
Andy Goldstein
5c9ffae88f Renerate files
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-09-11 15:40:48 -04:00
Andy Goldstein
ee38a9471a Regen docs last
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-09-11 15:40:48 -04:00
Andy Goldstein
03dde45c09 Add 'ark backup logs' command for retrieval
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-09-11 15:40:48 -04:00
Andy Goldstein
9848a7a55b Save backup log file to object storage
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-09-11 15:40:48 -04:00
Andy Goldstein
b50a78cf7b Work around glog flag.Parse issue
Due to a change in glog, if you don't call flag.Parse, every log line
prints out 'ERROR: logging before flag.Parse'. This works around that
change. Ultimately we need to switch to a different logging library.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-09-11 15:40:47 -04:00
Andy Goldstein
860eb7e845 Match Azure sdk changes
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-09-11 15:40:47 -04:00
Andy Goldstein
742f45849f Switch to dep & update dependencies
Switch to dep.

Update the following:
- azure-sdk-for-go to 10.2.1-beta
- go-autorest to 8.1.1
- client-go to 4.0.0

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-09-06 13:41:25 -04:00
Andy Goldstein
3c945e3416 Remove hack/godep-save.sh
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-09-06 13:41:23 -04:00
Andy Goldstein
ac8dc5ecc9 Doc dep mgmt
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-09-06 13:41:23 -04:00
Andy Goldstein
31102923cb Add script for dep
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-09-06 13:41:23 -04:00
Andy Goldstein
b7265a59f2 Merge pull request #63 from skriss/gc_restores
GC restores along with backups; de-dupe GC controller code
2017-09-06 13:37:18 -04:00
Steve Kriss
7648155c9a delete restores when GC'ing backups & don't orphan cloud resources
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-09-06 10:34:08 -07:00
Andy Goldstein
305e7fcea0 Merge pull request #59 from jrnt30/explicit-includes-excludes-restore
Allows explicit include/exclude of namespaces on restores
2017-09-06 11:21:24 -04:00
Andy Goldstein
56c680f991 Merge pull request #62 from jrnt30/default-home-resolution
Allow default kubeconfig resolution
2017-09-06 11:16:10 -04:00
Justin Nauman
2d084c4348 Removing instead of deprecating Namespace attr
- Per discussion, there is no reason to deal
with the complexity of backwards compatibility
with the Namespace attribute on the Restore
domain.

- Also noticed there was an error on the
validation of the BackupController where
the message would actually just be the index
of the error and not the contents of the message
itself.

Signed-off-by: Justin Nauman <justin.r.nauman@gmail.com>
2017-09-05 17:38:32 -05:00
Justin Nauman
2457d8f116 Removing instead of deprecating Namespace attr
- Per discussion, there is no reason to deal
with the complexity of backwards compatibility
with the Namespace attribute on the Restore
domain.

- Also noticed there was an error on the
validation of the BackupController where
the message would actually just be the index
of the error and not the contents of the message
itself.

Signed-off-by: Justin Nauman <justin.r.nauman@gmail.com>
2017-09-05 17:18:10 -05:00
Justin Nauman
b50a046370 Additional Validation on Include/Exclude
- Adding in additional test to ensure *Namespaces attributes
don't directly conflict logically with one another
- Additional PR changes around naming/typos

Signed-off-by: Justin Nauman <justin.r.nauman@gmail.com>
2017-09-05 17:17:46 -05:00
Justin Nauman
af2a792a9a Allows explicit include/exclude of namespaces on restores
- Introduces similar Include/Exclude declaration on the Restore
resource and cli flags
- Kept support for legacy Namespaces attribute until it could be
deprecating.  Defining both IncludeNamespaces and Namespaces results
in a validation error and the Restore will not be processed (shouldn't
be able to occur)

Signed-off-by: Justin Nauman <justin.r.nauman@gmail.com>
2017-09-05 17:17:41 -05:00
Andy Goldstein
4e596852b5 Merge pull request #66 from skriss/getallbackups-fix
in GetAllBackups don't error if single backup is unreadable
2017-09-05 13:02:56 -04:00
Steve Kriss
ba299f880f in GetAllBackups don't error if single backup is unreadable
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-09-05 09:56:37 -07:00
Andy Goldstein
43c74e33c2 Merge pull request #57 from skriss/restore_missing_backup_fix
during restore, try to get backup directly from obj storage if not in cache/API
2017-09-05 12:47:13 -04:00
Andy Goldstein
7ec0407756 Merge pull request #61 from jrnt30/aws-paging
AWS Paging Support
2017-09-05 12:46:05 -04:00
Steve Kriss
f07a70c604 during restore, try to get backup directly from obj storage if not in cache/API
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-09-05 09:25:39 -07:00
Justin Nauman
c0e94a4c1a Allow default kubeconfig resolution
- Changed the default kubeconfig loading to utilize
the client-go's loader strategy.  This allows users
to use the Ark client without having to explicitly
define a KUBECONFIG env var or argument.

This more closely resemebles how Kubectl works and users
are probably more used to while preserving the
current rules.

Signed-off-by: Justin Nauman <justin.r.nauman@gmail.com>
2017-08-28 07:56:57 -05:00
Justin Nauman
f017a23d41 AWS Paging Support
- Adding in paging support for the S3 and Snapshot
AWS integration.

As a testing note, you can add in a a MaxKeys to the S3
request as an easy way to ensure that paging is working
properly without having to creation over 1k backups.

Signed-off-by: Justin Nauman <justin.r.nauman@gmail.com>
2017-08-28 05:49:39 -05:00
Andy Goldstein
b20feee7f9 Merge pull request #43 from skriss/pvprovider_optional
make PVProvider optional in server config; disallow snap/restore PVs …
2017-08-23 12:59:59 -04:00
Steve Kriss
768aed4ddd make --snapshot-volumes, --restore-volumes optional with sensible default behavior based on PVProvider existence
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-08-23 09:47:52 -07:00
Steve Kriss
8d5c8ffcbb get rid of StorageAdapter structs and move validation into block/object
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-08-23 09:46:15 -07:00
Steve Kriss
ebc06fd632 make PVProvider optional in server config; disallow snap/restore PVs when not provided
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-08-23 09:46:15 -07:00
Andy Goldstein
3ca085eb58 Merge pull request #45 from jrnt30/snapshot-restore-defaults
Snapshot and restore volumes by default
2017-08-22 09:08:03 -04:00
Justin Nauman
618de63d23 Doc updates where volume flags are concered
Signed-off-by: Justin Nauman <justin.r.nauman@gmail.com>
2017-08-21 09:48:07 -05:00
Justin Nauman
d39d6f96fa Adjusting docs and example
- Removed explicit setting of snapshot flags
- Removed node selector on replicaset to reduce manual steps for users

Signed-off-by: Justin Nauman <justin.r.nauman@gmail.com>
2017-08-21 09:47:42 -05:00
Justin Nauman
fc8f27c997 Adjusting PV example to only one replica
- The two replicas contend for single PVC with the defined toplogy.  Could adjust to SS but kept it simple for now

Signed-off-by: Justin Nauman <justin.r.nauman@gmail.com>
2017-08-21 09:47:11 -05:00
Justin Nauman
3ea9899140 Adding in defaults for backup creation and restore
Signed-off-by: Justin Nauman <justin.r.nauman@gmail.com>
2017-08-21 09:47:11 -05:00
Jessica Yao
e993dd0cbd Merge pull request #47 from abiogenesis-now/jyao/add-release-doc-warning
[docs] Add warnings about doc changes between releases
2017-08-18 14:46:50 -07:00
Jessica Yao
e793aa1626 Merge pull request #51 from skriss/azure-docs-typo
fix mismatch between created and referenced SP name
2017-08-17 16:20:40 -07:00
Steve Kriss
80032639f1 fix mismatch between created and referenced SP name
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-08-17 15:37:38 -07:00
Jessica Yao
ef9eafacb4 address comments
Signed-off-by: Jessica Yao <jessica@heptio.com>
2017-08-16 14:03:05 -07:00
Jessica Yao
e19d964042 simplify local build instructions
Signed-off-by: Jessica Yao <jessica@heptio.com>
2017-08-16 10:36:31 -07:00
Jessica Yao
a57bd1698b add comment about local images and container tags
Signed-off-by: Jessica Yao <jessica@heptio.com>
2017-08-16 09:35:24 -07:00
Jessica Yao
462e5443a8 use same versioning warning across the board
Signed-off-by: Jessica Yao <jessica@heptio.com>
2017-08-15 13:03:30 -07:00
Jessica Yao
91ba076cce add warnings about doc changes between releases
Signed-off-by: Jessica Yao <jessica@heptio.com>
2017-08-15 10:18:31 -07:00
Andy Goldstein
c088470ba5 Merge pull request #35 from skriss/server_config_validation
validate cloud-provider config at startup & make PVProvider optional
2017-08-14 16:03:15 -04:00
Steve Kriss
726bbbb393 add zone/location validation to cloudprovider constructors
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-08-14 12:56:12 -07:00
Andy Goldstein
a865cb87ee Merge pull request #37 from skriss/iops_fix
only save/use iops for io1 volumes
2017-08-14 15:24:30 -04:00
Andy Goldstein
41e7861558 Merge pull request #29 from DG-i/feature/s3-ss3-kms-support
Add support for S3 SSE with KMS
2017-08-14 15:12:29 -04:00
Steve Kriss
c2271776cc remove unused params from GCP objectStorageAdapter
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-08-14 10:56:05 -07:00
Steve Kriss
3ba422af58 update Godeps/vendor (add Azure subscriptions API)
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-08-14 10:56:05 -07:00
Steve Kriss
aff57e0571 switch to int64 for iops val
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-08-14 09:42:43 -07:00
Mathias Merscher
df320d7bf3 adds support for S3 SSE with KMS
Signed-off-by: Mathias Merscher <Mathias.Merscher@dg-i.net>
2017-08-14 18:18:19 +02:00
Andy Goldstein
e966eb9ab0 Merge pull request #38 from skriss/cluster-only-restore-err
check for namespaces/ dir before reading it
2017-08-14 09:46:50 -04:00
Steve Kriss
49809b0a59 check for namespaces/ dir before reading it
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-08-11 14:05:06 -07:00
Steve Kriss
c41c958777 only save/use iops for io1 volumes
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-08-11 13:33:01 -07:00
Steve Kriss
bc08174e10 Merge pull request #31 from ncdc/cron-parse-standard
Schedules: treat 1st cron field as minutes
2017-08-10 09:55:42 -07:00
Andy Goldstein
973968fedd Prep for v0.3.3
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-08-10 12:45:25 -04:00
Andy Goldstein
680e17815b Schedules: treat 1st cron field as minutes
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-08-10 12:44:00 -04:00
2894 changed files with 578293 additions and 534228 deletions

11
.gitignore vendored
View File

@@ -27,3 +27,14 @@ _testmain.go
debug
/ark
.idea/
.container-*
.vimrc
.go
.DS_Store
.push-*
.vscode
*.diff
_site/

11
.travis.yml Normal file
View File

@@ -0,0 +1,11 @@
language: go
go:
- 1.10.x
sudo: required
services:
- docker
script: make ci

View File

@@ -1,10 +1,265 @@
# Changelog
#### v0.3.2 - 2017-08-07
#### [v0.9.3](https://github.com/heptio/ark/releases/tag/v0.9.3) - 2018-08-10
#### Bug Fixes
* Initalize Prometheus metrics when creating a new schedule (#689, @lemaral)
#### [v0.9.2](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](https://github.com/heptio/ark/releases/tag/v0.9.1) - 2018-07-23
##### 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](https://github.com/heptio/ark/releases/tag/v0.9.0) - 2018-07-06
##### 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
#### [v0.8.3](https://github.com/heptio/ark/releases/tag/v0.8.3) - 2018-06-29
##### 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 persistent volume claim 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)
#### [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 - 2017-08-03
#### [v0.3.1](https://github.com/heptio/ark/tree/v0.3.1) - 2017-08-03
* Fix Makefile VERSION
#### v0.3.0 - 2017-08-03
#### [v0.3.0](https://github.com/heptio/ark/tree/v0.3.0) - 2017-08-03
* Initial Release

View File

@@ -3,10 +3,9 @@
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 acknowldge this by signing their work.
everyone to acknowledge this by signing their work.
Any copyright notices in this repos should specify the authors as "The
heptio/aws-quickstart authors".
Any copyright notices in this repo should specify the authors as "the Heptio Ark project contributors".
To sign your work, just add a line like this at the end of your commit message:

View File

@@ -1,24 +0,0 @@
# Copyright 2017 Heptio Inc.
#
# 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 alpine:3.6
MAINTAINER Andy Goldstein "andy@heptio.com"
RUN apk add --no-cache ca-certificates && \
adduser -S -D -H -u 1000 ark
ADD _output/bin/ark /ark
USER ark
ENTRYPOINT ["/ark"]

View File

@@ -0,0 +1,23 @@
# 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.
FROM alpine:3.7
MAINTAINER Steve Kriss <steve@heptio.com>
ADD /bin/linux/amd64/ark-restic-restore-helper .
USER nobody:nobody
ENTRYPOINT [ "/ark-restic-restore-helper" ]

31
Dockerfile-ark.alpine Normal file
View File

@@ -0,0 +1,31 @@
# 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.
FROM alpine:3.7
MAINTAINER Andy Goldstein <andy@heptio.com>
RUN apk add --no-cache ca-certificates
RUN apk add --update --no-cache bzip2 && \
wget --quiet https://github.com/restic/restic/releases/download/v0.9.1/restic_0.9.1_linux_amd64.bz2 && \
bunzip2 restic_0.9.1_linux_amd64.bz2 && \
mv restic_0.9.1_linux_amd64 /usr/bin/restic && \
chmod +x /usr/bin/restic
ADD /bin/linux/amd64/ark /ark
USER nobody:nobody
ENTRYPOINT ["/ark"]

1249
Godeps/Godeps.json generated

File diff suppressed because it is too large Load Diff

5
Godeps/Readme generated
View File

@@ -1,5 +0,0 @@
This directory tree is generated automatically by godep.
Please do not edit.
See https://github.com/tools/godep for more information.

749
Gopkg.lock generated Normal file
View File

@@ -0,0 +1,749 @@
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "cloud.google.com/go"
packages = [
"compute/metadata",
"iam",
"internal",
"internal/optional",
"internal/version",
"storage"
]
revision = "44bcd0b2078ba5e7fedbeb36808d1ed893534750"
version = "v0.11.0"
[[projects]]
name = "github.com/Azure/azure-sdk-for-go"
packages = [
"arm/disk",
"arm/examples/helpers",
"storage"
]
revision = "2d49bb8f2cee530cc16f1f1a9f0aae763dee257d"
version = "v10.2.1-beta"
[[projects]]
name = "github.com/Azure/go-autorest"
packages = [
"autorest",
"autorest/adal",
"autorest/azure",
"autorest/date",
"autorest/to",
"autorest/validation"
]
revision = "f6e08fe5e4d45c9a66e40196d3fed5f37331d224"
version = "v8.1.1"
[[projects]]
name = "github.com/aws/aws-sdk-go"
packages = [
"aws",
"aws/awserr",
"aws/awsutil",
"aws/client",
"aws/client/metadata",
"aws/corehandlers",
"aws/credentials",
"aws/credentials/ec2rolecreds",
"aws/credentials/endpointcreds",
"aws/credentials/stscreds",
"aws/defaults",
"aws/ec2metadata",
"aws/endpoints",
"aws/request",
"aws/session",
"aws/signer/v4",
"internal/sdkio",
"internal/sdkrand",
"internal/shareddefaults",
"private/protocol",
"private/protocol/ec2query",
"private/protocol/query",
"private/protocol/query/queryutil",
"private/protocol/rest",
"private/protocol/restxml",
"private/protocol/xml/xmlutil",
"service/ec2",
"service/s3",
"service/s3/s3iface",
"service/s3/s3manager",
"service/sts"
]
revision = "1f8fb9d0919e5a58992207db9512a03f76ab0274"
version = "v1.13.12"
[[projects]]
branch = "master"
name = "github.com/beorn7/perks"
packages = ["quantile"]
revision = "3a771d992973f24aa725d07868b467d1ddfceafb"
[[projects]]
name = "github.com/cpuguy83/go-md2man"
packages = ["md2man"]
revision = "a65d4d2de4d5f7c74868dfa9b202a3c8be315aaa"
version = "v1.0.6"
[[projects]]
name = "github.com/davecgh/go-spew"
packages = ["spew"]
revision = "346938d642f2ec3594ed81d874461961cd0faa76"
version = "v1.1.0"
[[projects]]
name = "github.com/dgrijalva/jwt-go"
packages = ["."]
revision = "d2709f9f1f31ebcda9651b03077758c1f3a0018c"
version = "v3.0.0"
[[projects]]
branch = "master"
name = "github.com/docker/spdystream"
packages = [
".",
"spdy"
]
revision = "bc6354cbbc295e925e4c611ffe90c1f287ee54db"
[[projects]]
branch = "master"
name = "github.com/evanphx/json-patch"
packages = ["."]
revision = "944e07253867aacae43c04b2e6a239005443f33a"
[[projects]]
name = "github.com/ghodss/yaml"
packages = ["."]
revision = "0ca9ea5df5451ffdf184b4428c902747c2c11cd7"
version = "v1.0.0"
[[projects]]
name = "github.com/go-ini/ini"
packages = ["."]
revision = "20b96f641a5ea98f2f8619ff4f3e061cff4833bd"
version = "v1.28.2"
[[projects]]
name = "github.com/gogo/protobuf"
packages = [
"proto",
"sortkeys"
]
revision = "100ba4e885062801d56799d78530b73b178a78f3"
version = "v0.4"
[[projects]]
branch = "master"
name = "github.com/golang/glog"
packages = ["."]
revision = "23def4e6c14b4da8ac2ed8007337bc5eb5007998"
[[projects]]
branch = "master"
name = "github.com/golang/protobuf"
packages = [
"proto",
"protoc-gen-go/descriptor",
"ptypes",
"ptypes/any",
"ptypes/duration",
"ptypes/timestamp"
]
revision = "ab9f9a6dab164b7d1246e0e688b0ab7b94d8553e"
[[projects]]
branch = "master"
name = "github.com/google/gofuzz"
packages = ["."]
revision = "24818f796faf91cd76ec7bddd72458fbced7a6c1"
[[projects]]
branch = "master"
name = "github.com/googleapis/gax-go"
packages = ["."]
revision = "84ed26760e7f6f80887a2fbfb50db3cc415d2cea"
[[projects]]
name = "github.com/googleapis/gnostic"
packages = [
"OpenAPIv2",
"compiler",
"extensions"
]
revision = "ee43cbb60db7bd22502942cccbc39059117352ab"
version = "v0.1.0"
[[projects]]
branch = "master"
name = "github.com/hashicorp/go-hclog"
packages = ["."]
revision = "ca137eb4b4389c9bc6f1a6d887f056bf16c00510"
[[projects]]
branch = "master"
name = "github.com/hashicorp/go-plugin"
packages = ["."]
revision = "e2fbc6864d18d3c37b6cde4297ec9fca266d28f1"
[[projects]]
branch = "master"
name = "github.com/hashicorp/golang-lru"
packages = [
".",
"simplelru"
]
revision = "0a025b7e63adc15a622f29b0b2c4c3848243bbf6"
[[projects]]
branch = "master"
name = "github.com/hashicorp/yamux"
packages = ["."]
revision = "f5742cb6b85602e7fa834e9d5d91a7d7fa850824"
[[projects]]
branch = "master"
name = "github.com/howeyc/gopass"
packages = ["."]
revision = "bf9dde6d0d2c004a008c27aaee91170c786f6db8"
[[projects]]
name = "github.com/imdario/mergo"
packages = ["."]
revision = "3e95a51e0639b4cf372f2ccf74c86749d747fbdc"
version = "0.2.2"
[[projects]]
name = "github.com/inconshreveable/mousetrap"
packages = ["."]
revision = "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75"
version = "v1.0"
[[projects]]
name = "github.com/jmespath/go-jmespath"
packages = ["."]
revision = "0b12d6b5"
[[projects]]
name = "github.com/json-iterator/go"
packages = ["."]
revision = "6240e1e7983a85228f7fd9c3e1b6932d46ec58e2"
version = "1.0.3"
[[projects]]
name = "github.com/matttproud/golang_protobuf_extensions"
packages = ["pbutil"]
revision = "c12348ce28de40eed0136aa2b644d0ee0650e56c"
version = "v1.0.1"
[[projects]]
branch = "master"
name = "github.com/mitchellh/go-testing-interface"
packages = ["."]
revision = "a61a99592b77c9ba629d254a693acffaeb4b7e28"
[[projects]]
name = "github.com/pkg/errors"
packages = ["."]
revision = "645ef00459ed84a119197bfb8d8205042c6df63d"
version = "v0.8.0"
[[projects]]
name = "github.com/pmezard/go-difflib"
packages = ["difflib"]
revision = "792786c7400a136282c1664665ae0a8db921c6c2"
version = "v1.0.0"
[[projects]]
name = "github.com/prometheus/client_golang"
packages = [
"prometheus",
"prometheus/promhttp"
]
revision = "c5b7fccd204277076155f10851dad72b76a49317"
version = "v0.8.0"
[[projects]]
branch = "master"
name = "github.com/prometheus/client_model"
packages = ["go"]
revision = "99fa1f4be8e564e8a6b613da7fa6f46c9edafc6c"
[[projects]]
branch = "master"
name = "github.com/prometheus/common"
packages = [
"expfmt",
"internal/bitbucket.org/ww/goautoneg",
"model"
]
revision = "7600349dcfe1abd18d72d3a1770870d9800a7801"
[[projects]]
branch = "master"
name = "github.com/prometheus/procfs"
packages = [
".",
"internal/util",
"nfs",
"xfs"
]
revision = "94663424ae5ae9856b40a9f170762b4197024661"
[[projects]]
name = "github.com/robfig/cron"
packages = ["."]
revision = "df38d32658d8788cd446ba74db4bb5375c4b0cb3"
[[projects]]
name = "github.com/russross/blackfriday"
packages = ["."]
revision = "93622da34e54fb6529bfb7c57e710f37a8d9cbd8"
[[projects]]
name = "github.com/satori/uuid"
packages = ["."]
revision = "879c5887cd475cd7864858769793b2ceb0d44feb"
version = "v1.1.0"
[[projects]]
branch = "master"
name = "github.com/shurcooL/sanitized_anchor_name"
packages = ["."]
revision = "541ff5ee47f1dddf6a5281af78307d921524bcb5"
[[projects]]
name = "github.com/sirupsen/logrus"
packages = ["."]
revision = "f006c2ac4710855cf0f916dd6b77acf6b048dc6e"
version = "v1.0.3"
[[projects]]
branch = "master"
name = "github.com/spf13/afero"
packages = [
".",
"mem"
]
revision = "9be650865eab0c12963d8753212f4f9c66cdcf12"
[[projects]]
branch = "master"
name = "github.com/spf13/cobra"
packages = [
".",
"doc"
]
revision = "cb731b898346822cc0c225c28550a8a29d93c732"
[[projects]]
name = "github.com/spf13/pflag"
packages = ["."]
revision = "e57e3eeb33f795204c1ca35f56c44f83227c6e66"
version = "v1.0.0"
[[projects]]
branch = "master"
name = "github.com/stretchr/objx"
packages = ["."]
revision = "1a9d0bb9f541897e62256577b352fdbc1fb4fd94"
[[projects]]
branch = "master"
name = "github.com/stretchr/testify"
packages = [
"assert",
"mock",
"require"
]
revision = "890a5c3458b43e6104ff5da8dfa139d013d77544"
[[projects]]
branch = "master"
name = "golang.org/x/crypto"
packages = ["ssh/terminal"]
revision = "eb71ad9bd329b5ac0fd0148dd99bd62e8be8e035"
[[projects]]
branch = "master"
name = "golang.org/x/net"
packages = [
"context",
"context/ctxhttp",
"http2",
"http2/hpack",
"idna",
"internal/timeseries",
"lex/httplex",
"trace"
]
revision = "1c05540f6879653db88113bc4a2b70aec4bd491f"
[[projects]]
branch = "master"
name = "golang.org/x/oauth2"
packages = [
".",
"google",
"internal",
"jws",
"jwt"
]
revision = "9a379c6b3e95a790ffc43293c2a78dee0d7b6e20"
[[projects]]
branch = "master"
name = "golang.org/x/sys"
packages = [
"unix",
"windows"
]
revision = "43e60d72a8e2bd92ee98319ba9a384a0e9837c08"
[[projects]]
branch = "master"
name = "golang.org/x/text"
packages = [
"internal/gen",
"internal/triegen",
"internal/ucd",
"secure/bidirule",
"transform",
"unicode/bidi",
"unicode/cldr",
"unicode/norm",
"unicode/rangetable"
]
revision = "e56139fd9c5bc7244c76116c68e500765bb6db6b"
[[projects]]
branch = "master"
name = "golang.org/x/time"
packages = ["rate"]
revision = "26559e0f760e39c24d730d3224364aef164ee23f"
[[projects]]
branch = "master"
name = "google.golang.org/api"
packages = [
"compute/v1",
"gensupport",
"googleapi",
"googleapi/internal/uritemplates",
"googleapi/transport",
"internal",
"iterator",
"option",
"storage/v1",
"transport/http"
]
revision = "ed10e890a8366167a7ce33fac2b12447987bcb1c"
[[projects]]
name = "google.golang.org/appengine"
packages = [
".",
"internal",
"internal/app_identity",
"internal/base",
"internal/datastore",
"internal/log",
"internal/modules",
"internal/remote_api",
"internal/urlfetch",
"urlfetch"
]
revision = "150dc57a1b433e64154302bdc40b6bb8aefa313a"
version = "v1.0.0"
[[projects]]
branch = "master"
name = "google.golang.org/genproto"
packages = [
"googleapis/api/annotations",
"googleapis/iam/v1",
"googleapis/rpc/status"
]
revision = "ee236bd376b077c7a89f260c026c4735b195e459"
[[projects]]
name = "google.golang.org/grpc"
packages = [
".",
"codes",
"connectivity",
"credentials",
"grpclb/grpc_lb_v1",
"grpclog",
"health",
"health/grpc_health_v1",
"internal",
"keepalive",
"metadata",
"naming",
"peer",
"stats",
"status",
"tap",
"transport"
]
revision = "b3ddf786825de56a4178401b7e174ee332173b66"
version = "v1.5.2"
[[projects]]
name = "gopkg.in/inf.v0"
packages = ["."]
revision = "3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4"
version = "v0.9.0"
[[projects]]
branch = "v2"
name = "gopkg.in/yaml.v2"
packages = ["."]
revision = "eb3733d160e74a9c7e442f435eb3bea458e1d19f"
[[projects]]
name = "k8s.io/api"
packages = [
"admissionregistration/v1alpha1",
"admissionregistration/v1beta1",
"apps/v1",
"apps/v1beta1",
"apps/v1beta2",
"authentication/v1",
"authentication/v1beta1",
"authorization/v1",
"authorization/v1beta1",
"autoscaling/v1",
"autoscaling/v2beta1",
"batch/v1",
"batch/v1beta1",
"batch/v2alpha1",
"certificates/v1beta1",
"core/v1",
"events/v1beta1",
"extensions/v1beta1",
"networking/v1",
"policy/v1beta1",
"rbac/v1",
"rbac/v1alpha1",
"rbac/v1beta1",
"scheduling/v1alpha1",
"settings/v1alpha1",
"storage/v1",
"storage/v1alpha1",
"storage/v1beta1"
]
revision = "73d903622b7391f3312dcbac6483fed484e185f8"
version = "kubernetes-1.10.0"
[[projects]]
branch = "master"
name = "k8s.io/apiextensions-apiserver"
packages = [
"pkg/apis/apiextensions",
"pkg/apis/apiextensions/v1beta1"
]
revision = "07bbbb7a28a34c56bf9d1b192a88cc9b2350095e"
[[projects]]
name = "k8s.io/apimachinery"
packages = [
"pkg/api/equality",
"pkg/api/errors",
"pkg/api/meta",
"pkg/api/resource",
"pkg/apis/meta/internalversion",
"pkg/apis/meta/v1",
"pkg/apis/meta/v1/unstructured",
"pkg/apis/meta/v1beta1",
"pkg/conversion",
"pkg/conversion/queryparams",
"pkg/fields",
"pkg/labels",
"pkg/runtime",
"pkg/runtime/schema",
"pkg/runtime/serializer",
"pkg/runtime/serializer/json",
"pkg/runtime/serializer/protobuf",
"pkg/runtime/serializer/recognizer",
"pkg/runtime/serializer/streaming",
"pkg/runtime/serializer/versioning",
"pkg/selection",
"pkg/types",
"pkg/util/cache",
"pkg/util/clock",
"pkg/util/diff",
"pkg/util/duration",
"pkg/util/errors",
"pkg/util/framer",
"pkg/util/httpstream",
"pkg/util/httpstream/spdy",
"pkg/util/intstr",
"pkg/util/json",
"pkg/util/net",
"pkg/util/remotecommand",
"pkg/util/runtime",
"pkg/util/sets",
"pkg/util/validation",
"pkg/util/validation/field",
"pkg/util/wait",
"pkg/util/yaml",
"pkg/version",
"pkg/watch",
"third_party/forked/golang/netutil",
"third_party/forked/golang/reflect"
]
revision = "302974c03f7e50f16561ba237db776ab93594ef6"
version = "kubernetes-1.10.0"
[[projects]]
name = "k8s.io/client-go"
packages = [
"discovery",
"discovery/fake",
"dynamic",
"informers",
"informers/admissionregistration",
"informers/admissionregistration/v1alpha1",
"informers/admissionregistration/v1beta1",
"informers/apps",
"informers/apps/v1",
"informers/apps/v1beta1",
"informers/apps/v1beta2",
"informers/autoscaling",
"informers/autoscaling/v1",
"informers/autoscaling/v2beta1",
"informers/batch",
"informers/batch/v1",
"informers/batch/v1beta1",
"informers/batch/v2alpha1",
"informers/certificates",
"informers/certificates/v1beta1",
"informers/core",
"informers/core/v1",
"informers/events",
"informers/events/v1beta1",
"informers/extensions",
"informers/extensions/v1beta1",
"informers/internalinterfaces",
"informers/networking",
"informers/networking/v1",
"informers/policy",
"informers/policy/v1beta1",
"informers/rbac",
"informers/rbac/v1",
"informers/rbac/v1alpha1",
"informers/rbac/v1beta1",
"informers/scheduling",
"informers/scheduling/v1alpha1",
"informers/settings",
"informers/settings/v1alpha1",
"informers/storage",
"informers/storage/v1",
"informers/storage/v1alpha1",
"informers/storage/v1beta1",
"kubernetes",
"kubernetes/scheme",
"kubernetes/typed/admissionregistration/v1alpha1",
"kubernetes/typed/admissionregistration/v1beta1",
"kubernetes/typed/apps/v1",
"kubernetes/typed/apps/v1beta1",
"kubernetes/typed/apps/v1beta2",
"kubernetes/typed/authentication/v1",
"kubernetes/typed/authentication/v1beta1",
"kubernetes/typed/authorization/v1",
"kubernetes/typed/authorization/v1beta1",
"kubernetes/typed/autoscaling/v1",
"kubernetes/typed/autoscaling/v2beta1",
"kubernetes/typed/batch/v1",
"kubernetes/typed/batch/v1beta1",
"kubernetes/typed/batch/v2alpha1",
"kubernetes/typed/certificates/v1beta1",
"kubernetes/typed/core/v1",
"kubernetes/typed/events/v1beta1",
"kubernetes/typed/extensions/v1beta1",
"kubernetes/typed/networking/v1",
"kubernetes/typed/policy/v1beta1",
"kubernetes/typed/rbac/v1",
"kubernetes/typed/rbac/v1alpha1",
"kubernetes/typed/rbac/v1beta1",
"kubernetes/typed/scheduling/v1alpha1",
"kubernetes/typed/settings/v1alpha1",
"kubernetes/typed/storage/v1",
"kubernetes/typed/storage/v1alpha1",
"kubernetes/typed/storage/v1beta1",
"listers/admissionregistration/v1alpha1",
"listers/admissionregistration/v1beta1",
"listers/apps/v1",
"listers/apps/v1beta1",
"listers/apps/v1beta2",
"listers/autoscaling/v1",
"listers/autoscaling/v2beta1",
"listers/batch/v1",
"listers/batch/v1beta1",
"listers/batch/v2alpha1",
"listers/certificates/v1beta1",
"listers/core/v1",
"listers/events/v1beta1",
"listers/extensions/v1beta1",
"listers/networking/v1",
"listers/policy/v1beta1",
"listers/rbac/v1",
"listers/rbac/v1alpha1",
"listers/rbac/v1beta1",
"listers/scheduling/v1alpha1",
"listers/settings/v1alpha1",
"listers/storage/v1",
"listers/storage/v1alpha1",
"listers/storage/v1beta1",
"pkg/apis/clientauthentication",
"pkg/apis/clientauthentication/v1alpha1",
"pkg/version",
"plugin/pkg/client/auth/azure",
"plugin/pkg/client/auth/exec",
"plugin/pkg/client/auth/gcp",
"plugin/pkg/client/auth/oidc",
"rest",
"rest/watch",
"testing",
"third_party/forked/golang/template",
"tools/auth",
"tools/cache",
"tools/clientcmd",
"tools/clientcmd/api",
"tools/clientcmd/api/latest",
"tools/clientcmd/api/v1",
"tools/metrics",
"tools/pager",
"tools/reference",
"tools/remotecommand",
"transport",
"transport/spdy",
"util/buffer",
"util/cert",
"util/exec",
"util/flowcontrol",
"util/homedir",
"util/integer",
"util/jsonpath",
"util/retry",
"util/workqueue"
]
revision = "23781f4d6632d88e869066eaebb743857aa1ef9b"
version = "v7.0.0"
[[projects]]
name = "k8s.io/kubernetes"
packages = ["pkg/printers"]
revision = "fc32d2f3698e36b93322a3465f63a14e9f0eaead"
version = "v1.10.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "a8e66580a3332bbe5ce086af0530dbab49bc5018f0d44b156e61bc404456a0ab"
solver-name = "gps-cdcl"
solver-version = 1

114
Gopkg.toml Normal file
View File

@@ -0,0 +1,114 @@
# Gopkg.toml example
#
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
[prune]
unused-packages = true
non-go = true
go-tests = true
#
# Kubernetes packages
#
[[constraint]]
name = "k8s.io/kubernetes"
version = "~1.10"
[[constraint]]
name = "k8s.io/client-go"
version = "~7.0"
[[constraint]]
name = "k8s.io/apimachinery"
version = "kubernetes-1.10.0"
[[constraint]]
name = "k8s.io/api"
version = "kubernetes-1.10.0"
#
# Cloud provider packages
#
[[constraint]]
name = "github.com/aws/aws-sdk-go"
version = "1.13.12"
[[constraint]]
name = "github.com/Azure/azure-sdk-for-go"
version = "~10.2.1-beta"
[[constraint]]
name = "github.com/Azure/go-autorest"
version = "~8.1.x"
[[constraint]]
name = "cloud.google.com/go"
version = "0.11.0"
[[constraint]]
name = "google.golang.org/api"
branch = "master"
[[constraint]]
name = "golang.org/x/oauth2"
branch = "master"
#
# Third party packages
#
[[constraint]]
name = "github.com/golang/glog"
branch = "master"
[[constraint]]
name = "github.com/robfig/cron"
revision = "df38d32658d8788cd446ba74db4bb5375c4b0cb3"
# TODO(1.0) this repo is a redirect to github.com/satori/go.uuid. Our
# current version of azure-sdk-for-go references this redirect, so
# use it so we don't get a duplicate copy of this dependency.
# Once our azure-sdk-for-go is updated to a newer version (where
# their dependency has changed to .../go.uuid), switch this to
# github.com/satori/go.uuid
[[constraint]]
name = "github.com/satori/uuid"
version = "1.1.0"
[[constraint]]
name = "github.com/spf13/afero"
branch = "master"
[[constraint]]
name = "github.com/spf13/cobra"
branch = "master"
[[constraint]]
name = "github.com/spf13/pflag"
version = "1.0.0"
[[constraint]]
name = "github.com/stretchr/testify"
branch = "master"
[[constraint]]
name = "github.com/hashicorp/go-plugin"
branch = "master"

221
Makefile
View File

@@ -1,4 +1,6 @@
# Copyright 2017 Heptio Inc.
# Copyright 2016 The Kubernetes Authors.
#
# Modifications 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.
@@ -12,76 +14,187 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# project related vars
ROOT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
PROJECT = ark
VERSION ?= v0.3.2
GOTARGET = github.com/heptio/$(PROJECT)
OUTPUT_DIR = $(ROOT_DIR)/_output
BIN_DIR = $(OUTPUT_DIR)/bin
# The binary to build (just the basename).
BIN ?= ark
# docker related vars
DOCKER ?= docker
# This repo's root import path (under GOPATH).
PKG := github.com/heptio/ark
# Where to push the docker image.
REGISTRY ?= gcr.io/heptio-images
BUILD_IMAGE ?= $(REGISTRY)/golang:1.8-alpine3.6
# go build -i installs compiled packages so they can be reused later.
# This speeds up recompiles.
BUILDCMD = go build -i -v -ldflags "-X $(GOTARGET)/pkg/buildinfo.Version=$(VERSION) -X $(GOTARGET)/pkg/buildinfo.DockerImage=$(REGISTRY)/$(PROJECT)"
BUILDMNT = /go/src/$(GOTARGET)
EXTRA_MNTS ?=
# test related vars
TESTARGS ?= -timeout 60s
TEST_PKGS ?= ./cmd/... ./pkg/...
# Which architecture to build - see $(ALL_ARCH) for options.
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
platform_temp = $(subst -, ,$(ARCH))
GOOS = $(word 1, $(platform_temp))
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-$(BIN).alpine
endif
#ifeq ($(GOARCH),arm)
# DOCKERFILE ?= Dockerfile.arm #armel/busybox
#endif
#ifeq ($(GOARCH),arm64)
# DOCKERFILE ?= Dockerfile.arm64 #aarch64/busybox
#endif
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:
@$(MAKE) build
@$(MAKE) build BIN=ark-restic-restore-helper
build-%:
@$(MAKE) --no-print-directory ARCH=$* build
#container-%:
# @$(MAKE) --no-print-directory ARCH=$* container
#push-%:
# @$(MAKE) --no-print-directory ARCH=$* push
all-build: $(addprefix build-, $(CLI_PLATFORMS))
#all-container: $(addprefix container-, $(CONTAINER_PLATFORMS))
#all-push: $(addprefix push-, $(CONTAINER_PLATFORMS))
build: _output/bin/$(GOOS)/$(GOARCH)/$(BIN)
_output/bin/$(GOOS)/$(GOARCH)/$(BIN): build-dirs
@echo "building: $@"
$(MAKE) shell CMD="-c '\
GOOS=$(GOOS) \
GOARCH=$(GOARCH) \
VERSION=$(VERSION) \
PKG=$(PKG) \
BIN=$(BIN) \
OUTPUT_DIR=/output/$(GOOS)/$(GOARCH) \
./hack/build.sh'"
TTY := $(shell tty -s && echo "-t")
BUILDER_IMAGE := ark-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 \
-i $(TTY) \
--rm \
-u $$(id -u):$$(id -g) \
-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))
all-containers:
$(MAKE) container
$(MAKE) container BIN=ark-restic-restore-helper
container: verify test .container-$(DOTFILE_IMAGE) container-name
.container-$(DOTFILE_IMAGE): _output/bin/$(GOOS)/$(GOARCH)/$(BIN) $(DOCKERFILE)
@cp $(DOCKERFILE) _output/.dockerfile-$(BIN)-$(GOOS)-$(GOARCH)
@docker build -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=ark-restic-restore-helper
push: .push-$(DOTFILE_IMAGE) push-name
.push-$(DOTFILE_IMAGE): .container-$(DOTFILE_IMAGE)
@docker push $(IMAGE):$(VERSION)
ifeq ($(TAG_LATEST), true)
docker tag $(IMAGE):$(VERSION) $(IMAGE):latest
docker push $(IMAGE):latest
endif
@docker images -q $(IMAGE):$(VERSION) > $@
push-name:
@echo "pushed: $(IMAGE):$(VERSION)"
SKIP_TESTS ?=
# what we're building
BINARIES = ark
local: $(BINARIES)
$(BINARIES):
mkdir -p $(BIN_DIR)
$(BUILDCMD) -o $(BIN_DIR)/$@ $(GOTARGET)/cmd/$@
test:
test: build-dirs
ifneq ($(SKIP_TESTS), 1)
# go test -i installs compiled packages so they can be reused later
# This speeds up retests.
go test -i -v $(TEST_PKGS)
go test $(TEST_PKGS) $(TESTARGS)
@$(MAKE) shell CMD="-c 'hack/test.sh $(SRC_DIRS)'"
endif
verify:
ifneq ($(SKIP_TESTS), 1)
${ROOT_DIR}/hack/verify-generated-docs.sh
${ROOT_DIR}/hack/verify-generated-clientsets.sh
${ROOT_DIR}/hack/verify-generated-listers.sh
${ROOT_DIR}/hack/verify-generated-informers.sh
@$(MAKE) shell CMD="-c 'hack/verify-all.sh'"
endif
update:
${ROOT_DIR}/hack/update-generated-docs.sh
${ROOT_DIR}/hack/update-generated-clientsets.sh
${ROOT_DIR}/hack/update-generated-listers.sh
${ROOT_DIR}/hack/update-generated-informers.sh
@$(MAKE) shell CMD="-c 'hack/update-all.sh'"
all: cbuild container
release: all-tar-bin checksum
cbuild:
$(DOCKER) run --rm -v $(ROOT_DIR):$(BUILDMNT) $(EXTRA_MNTS) -w $(BUILDMNT) -e SKIP_TESTS=$(SKIP_TESTS) $(BUILD_IMAGE) /bin/sh -c 'make local verify test'
checksum:
@cd _output/release; \
sha256sum *.tar.gz > CHECKSUM; \
cat CHECKSUM; \
sha256sum CHECKSUM
container: cbuild
$(DOCKER) build -t $(REGISTRY)/$(PROJECT):latest -t $(REGISTRY)/$(PROJECT):$(VERSION) .
all-tar-bin: $(addprefix tar-bin-, $(CLI_PLATFORMS))
container-local: $(BINARIES)
$(DOCKER) build -t $(REGISTRY)/$(PROJECT):latest -t $(REGISTRY)/$(PROJECT):$(VERSION) .
tar-bin-%:
$(MAKE) ARCH=$* VERSION=$(VERSION) tar-bin
push:
docker -- push $(REGISTRY)/$(PROJECT):$(VERSION)
GIT_DESCRIBE = $(shell git describe --tags --always --dirty)
tar-bin: build
mkdir -p _output/release
.PHONY: all local container cbuild push test verify update $(BINARIES)
# 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) .go/go-build
build-image:
cd hack/build-image && docker build -t $(BUILDER_IMAGE) .
clean:
rm -rf $(OUTPUT_DIR)
$(DOCKER) rmi $(REGISTRY)/$(PROJECT):latest $(REGISTRY)/$(PROJECT):$(VERSION) 2>/dev/null || :
rm -rf .container-* _output/.dockerfile-* .push-*
rm -rf .go _output
docker rmi $(BUILDER_IMAGE)
ci: all verify test

193
README.md
View File

@@ -5,162 +5,25 @@
[![Build Status][1]][2]
## Overview
Heptio Ark is a utility for managing disaster recovery, specifically for your [Kubernetes][14] cluster resources and persistent volumes. It provides a simple, configurable, and operationally robust way to back up and restore applications and PVs from a series of checkpoints. This allows you to better automate in the following scenarios:
* **Disaster recovery** with reduced TTR (time to respond), in the case of:
* Infrastructure loss
* Data corruption
* Service outages
Ark gives you tools to back up and restore your Kubernetes cluster resources and persistent volumes. Ark lets you:
* **Cross-cloud-provider migration** for Kubernetes API objects (cross-cloud-provider migration of persistent volume snapshots not yet supported)
* 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.
* **Dev and testing environment setup (+ CI)**, via replication of prod environment
Ark consists of:
More concretely, Heptio Ark combines an in-cluster service with a CLI that allows you to record both:
1. *Configurable subsets of Kubernetes API objects* -- as tarballs stored in object storage
2. *Disk snapshots of Persistent Volumes* -- via the cloud provider APIs
* A server that runs on your cluster
* A command-line client that runs locally
Heptio Ark currently supports the [AWS][15], [GCP][16], and [Azure][17] cloud provider platforms.
## More information
## Quickstart
This guide gets Ark up and running on your cluster, and goes through an example using the following:
* **Minio, an S3-compatible storage service** that runs locally on your cluster. This is the storage service where backup files are uploaded. *Note that Ark is intended to run on a cloud provider--we are using Minio here to keep the example convenient and self-contained.*
* **A sample nginx app** under the `nginx-example` namespace, used to demonstrate Ark's backup and restore functionality.
Note that this example *does not* include a demonstration of PV disk snapshots, because that feature requires integration with a cloud provider API. For snapshotting examples and instructions specific to AWS, GCP, and Azure, see [Cloud Provider Specifics][23].
### 0. Prerequisites
* *You should have access to an up-and-running Kubernetes cluster (minimum version 1.7).* If you do not have a cluster, [choose a setup solution][9] from the official Kubernetes docs.
* *You will need to have a DNS server set up on your cluster for the example files to work.* You can check this with `kubectl get svc -l k8s-app=kube-dns --namespace=kube-system`. If said service does not exist, [these instructions][12] may help.
* *You should have `kubectl` installed.* If not, follow the instructions for [installing via Homebrew (MacOS)][10] or [building the binary (Linux)][11].
### 1. Download
Clone or fork the Heptio Ark repo:
```
git clone git@github.com:heptio/ark.git
```
### 2. Setup
There are two types of Ark instances that work in tandem:
1. **Ark server**: Runs persistently on the cluster.
2. **Ark client**: Launched by the user whenever they want to initiate an operation (e.g. a backup).
To get the server started on your cluster (as well as the local storage service), execute the following commands in Ark's root directory:
```
kubectl apply -f examples/common/00-prereqs.yaml
kubectl apply -f examples/minio/
kubectl apply -f examples/common/10-deployment.yaml
```
*NOTE: If you encounter an error related to Config creation, wait for a minute and run the command again. (The Config CRD does not always finish registering in time.)*
Now deploy the example nginx app:
```
kubectl apply -f examples/nginx-app/base.yaml
```
Check to see that both the Ark and nginx deployments have been successfully created:
```
kubectl get deployments -l component=ark --namespace=heptio-ark
kubectl get deployments --namespace=nginx-example
```
Finally, create an alias for the Ark client's Docker executable. (Make sure that your `KUBECONFIG` environment variable is pointing at the proper config first). This will save a lot of future typing:
```
alias ark='docker run --rm -u $(id -u) -v $(dirname $KUBECONFIG):/kubeconfig -e KUBECONFIG=/kubeconfig/$(basename $KUBECONFIG) gcr.io/heptio-images/ark:latest'
```
*NOTE*: Depending on how your Kubeconfig is written--if it refers to the Kubernetes API server using the host machine's `localhost`, for instance--you may need to add an additional `--net="host"` flag to the `docker run` command.
### 3. Back up and restore
First, create a backup specifically for any object matching the `app=nginx` label selector:
```
ark backup create nginx-backup --selector app=nginx
```
Now you can mimic a disaster with the following:
```
kubectl delete namespace nginx-example
```
Oh no! The nginx deployment and service are both gone, as you can see (though you may have to wait a minute or two for the namespace be fully cleaned up):
```
kubectl get deployments --namespace=nginx-example
kubectl get services --namespace=nginx-example
```
Neither commands should yield any results. However, because Ark has your back(up), you can run this command:
```
ark restore create nginx-backup
```
To check on the status of the Restore:
```
ark restore get
```
The output should look something like the table below:
```
NAME BACKUP STATUS WARNINGS ERRORS CREATED SELECTOR
nginx-backup-20170727200524 nginx-backup Completed 0 0 2017-07-27 20:05:24 +0000 UTC <none>
```
If the Restore's `STATUS` column is "Completed", and `WARNINGS` and `ERRORS` are both zero, the restore is a success. All of the objects in the `nginx-example` namespace should be just as they were before.
Otherwise, if there are warnings or errors indicated, you can run the following command to look at them in more detail:
```
ark restore get <RESTORE NAME> -o yaml
```
See the [debugging documentation][18] for more details.
*NOTE*: In the example files, the `storage` volume is defined via `hostPath` for better visibility. If you're curious to see the [structure of the backup files][13] firsthand, you can find the compressed results in `/tmp/minio/ark/nginx-backup`.
### 4. Tear Down
Using the following command, you can remove all Kubernetes objects associated with this example:
```
kubectl delete -f examples/common/
kubectl delete -f examples/minio/
kubectl delete -f examples/nginx-app/base.yaml
```
## Architecture
Each of Heptio Ark's operations (Backups, Schedules, and Restores) are custom resources themselves, defined using [CRDs][20]. Their accompanying [custom controllers][21] handle them when they are submitted to the Kubernetes API server.
As mentioned before, Ark runs in two different modes:
* **Ark client**: Allows you to query, create, and delete the Ark resources as desired.
* **Ark server**: Runs all of the Ark controllers. Each controller watches its respective custom resource for API operations, performs validation, and handles the majority of the cloud API logic (e.g. interfacing with object storage and persistent volumes).
Looking at a specific example--an `ark backup create test-backup --snapshot-volumes` command triggers the following operations:
![19]
1. The *ark client* makes a call to the Kubernetes API server, creating a `Backup` custom resource (which is stored in [etcd][22]).
2. The `BackupController` sees that a new `Backup` has been created, and validates it.
3. Once validation passes, the `BackupController` begins the backup process. It collects data by querying the Kubernetes API Server for resources.
4. Once the data has been aggregated, the `BackupController` makes a call to the object storage service (e.g. Amazon S3) to upload the backup file.
5. If the `--snapshot-volumes` flag is specified, Ark also makes disk snapshots of any persistent volumes, using the appropriate cloud service API.
## Further documentation
To learn more about Heptio Ark operations and their applications, see the [`/docs` directory][3].
[The documentation][29] provides a getting started guide, plus information about building from source, architecture, extending Ark, and more.
## Troubleshooting
If you encounter any problems that the documentation does not address, [file an issue][4].
If you encounter issues, review the [troubleshooting docs][30], [file an issue][4], or talk to us on the [#ark-dr channel][25] on the Kubernetes Slack server.
## Contributing
@@ -168,42 +31,38 @@ Thanks for taking the time to join our community and start contributing!
Feedback and discussion is 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.
#### Pull requests
### Pull requests
* We welcome pull requests. Feel free to dig through the [issues][4] and jump in.
## Changelog
See [the list of releases][6] to find out about feature changes.
[0]: https://github.com/heptio
[1]: https://jenkins.i.heptio.com/buildStatus/icon?job=ark-prbuilder
[2]: https://jenkins.i.heptio.com/job/ark-prbuilder/
[3]: /docs
[1]: https://travis-ci.org/heptio/ark.svg?branch=master
[2]: https://travis-ci.org/heptio/ark
[4]: https://github.com/heptio/ark/issues
[5]: /CONTRIBUTING.md
[6]: /CHANGELOG.md
[7]: /docs/build-from-scratch.md
[8]: /CODE_OF_CONDUCT.md
[5]: https://github.com/heptio/ark/blob/master/CONTRIBUTING.md
[6]: https://github.com/heptio/ark/releases
[8]: https://github.com/heptio/ark/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
[23]: /docs/cloud-provider-specifics.md
[24]: http://j.hept.io/ark-list
[25]: https://kubernetes.slack.com/messages/ark-dr
[29]: https://heptio.github.io/ark/
[30]: /docs/troubleshooting.md

40
ROADMAP.md Normal file
View File

@@ -0,0 +1,40 @@
# 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

@@ -0,0 +1,77 @@
/*
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.
*/
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 .ark/ 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(), ".ark", 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 Heptio Inc.
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.

View File

@@ -1,29 +0,0 @@
# Table of Contents
## User Guide
* [Concepts][1]
* [Build from scratch][0]
* [Cloud provider specifics][9]
* [Debugging restores][4]
## Reference
* [CLI reference][2]
* [Config definition][5]
* [Output file format][6]
* [Sample YAML files][3]
## Scenarios
* [Disaster recovery][7]
* [Cluster migration][8]
[0]: build-from-scratch.md
[1]: concepts.md
[2]: cli-reference
[3]: /examples
[4]: debugging-restores.md
[5]: config-definition.md
[6]: output-file-format.md
[7]: use-cases.md#disaster-recovery
[8]: use-cases.md#cluster-migration
[9]: cloud-provider-specifics.md

71
docs/about.md Normal file
View File

@@ -0,0 +1,71 @@
# How Ark Works
Each Ark operation -- on-demand backup, scheduled backup, restore -- is a custom resource, defined with a Kubernetes [Custom Resource Definition (CRD)][20] and stored in [etcd][22]. The config custom resource specifies core information and options such as cloud provider settings. Ark also includes controllers that process the custom resources to perform backups, restores, and all related operations.
You can back up or restore all objects in your cluster, or you can filter objects by type, namespace, and/or label.
Ark is ideal for the disaster recovery use case, as well as for snapshotting your application state, prior to performing system operations on your cluster (e.g. upgrades).
## On-demand backups
The **backup** operation:
1. Uploads a tarball of copied Kubernetes objects into cloud object storage.
1. Calls the cloud provider API to make disk snapshots of persistent volumes, if specified.
You can optionally specify hooks to be executed during the backup. For example, you might
need to tell a database to flush its in-memory buffers to disk before taking a snapshot. [More about hooks][10].
Note that cluster backups are not strictly atomic. If Kubernetes objects are being created or edited at the time of backup, they might not be included in the backup. The odds of capturing inconsistent information are low, but it is possible.
## Scheduled backups
The **schedule** operation allows you to back up your data at recurring intervals. The first backup is performed when the schedule is first created, and subsequent backups happen at the schedule's specified interval. These intervals are specified by a Cron expression.
Scheduled backups are saved with the name `<SCHEDULE NAME>-<TIMESTAMP>`, where `<TIMESTAMP>` is formatted as *YYYYMMDDhhmmss*.
## Restores
The **restore** operation allows you to restore all of the objects and persistent volumes from a previously created backup. You can also restore only a filtered subset of objects and persistent volumes. Ark supports multiple namespace remapping--for example, in a single restore, objects in namespace "abc" can be recreated under namespace "def", and the objects in namespace "123" under "456".
The default name of a restore is `<BACKUP NAME>-<TIMESTAMP>`, where `<TIMESTAMP>` is formatted as *YYYYMMDDhhmmss*. You can also specify a custom name. A restored object also includes a label with key `ark-restore` and value `<RESTORE NAME>`.
You can also run the Ark server in restore-only mode, which disables backup, schedule, and garbage collection functionality during disaster recovery.
## Backup workflow
When you run `ark backup create test-backup`:
1. The Ark client makes a call to the Kubernetes API server to create a `Backup` object.
1. The `BackupController` notices the new `Backup` object and performs validation.
1. The `BackupController` begins the backup process. It collects the data to back up by querying the API server for resources.
1. The `BackupController` makes a call to the object storage service -- for example, AWS S3 -- to upload the backup file.
By default, `ark backup create` makes disk snapshots of any persistent volumes. You can adjust the snapshots by specifying additional flags. See [the CLI help][30] for more information. Snapshots can be disabled with the option `--snapshot-volumes=false`.
![19]
## Set a backup to expire
When you create a backup, you can specify a TTL by adding the flag `--ttl <DURATION>`. If Ark sees that an existing backup resource is expired, it removes:
* The backup resource
* The backup file from cloud object storage
* All PersistentVolume snapshots
* All associated Restores
## Object storage sync
Heptio Ark treats object storage as the source of truth. It continuously checks to see that the correct backup resources are always present. If there is a properly formatted backup file in the storage bucket, but no corresponding backup resource in the Kubernetes API, Ark synchronizes the information from object storage to Kubernetes.
This allows restore functionality to work in a cluster migration scenario, where the original backup objects do not exist in the new cluster.
[19]: /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
[30]: https://github.com/heptio/ark/blob/master/docs/cli-reference/ark_create_backup.md

7
docs/api-types/README.md Normal file
View File

@@ -0,0 +1,7 @@
# Table of Contents
## API types
* [Backup][1]
[1]: backup.md

138
docs/api-types/backup.md Normal file
View File

@@ -0,0 +1,138 @@
# Backup API Type
## Use
The `Backup` API type is used as a request for the Ark Server to perform a backup. Once created, the
Ark Server immediately starts the backup process.
## API GroupVersion
Backup belongs to the API group version `ark.heptio.com/v1`.
## Definition
Here is a sample `Backup` object with each of the fields documented:
```yaml
# Standard Kubernetes API Version declaration. Required.
apiVersion: ark.heptio.com/v1
# Standard Kubernetes Kind declaration. Required.
kind: Backup
# Standard Kubernetes metadata. Required.
metadata:
# Backup name. May be any valid Kubernetes object name. Required.
name: a
# Backup namespace. Required. In version 0.7.0 and later, can be any string. Must be the namespace of the Ark server.
namespace: heptio-ark
# Parameters about the backup. Required.
spec:
# Array of namespaces to include in the backup. If unspecified, all namespaces are included.
# Optional.
includedNamespaces:
- '*'
# Array of namespaces to exclude from the backup. Optional.
excludedNamespaces:
- some-namespace
# Array of resources to include in the backup. Resources may be shortcuts (e.g. 'po' for 'pods')
# or fully-qualified. If unspecified, all resources are included. Optional.
includedResources:
- '*'
# Array of resources to exclude from the backup. Resources may be shortcuts (e.g. 'po' for 'pods')
# or fully-qualified. Optional.
excludedResources:
- storageclasses.storage.k8s.io
# Whether or not to include cluster-scoped resources. Valid values are true, false, and
# null/unset. If true, all cluster-scoped resources are included (subject to included/excluded
# resources and the label selector). If false, no cluster-scoped resources are included. If unset,
# all cluster-scoped resources are included if and only if all namespaces are included and there are
# no excluded namespaces. Otherwise, if there is at least one namespace specified in either
# includedNamespaces or excludedNamespaces, then the only cluster-scoped resources that are backed
# up are those associated with namespace-scoped resources included in the backup. For example, if a
# PersistentVolumeClaim is included in the backup, its associated PersistentVolume (which is
# cluster-scoped) would also be backed up.
includeClusterResources: null
# Individual objects must match this label selector to be included in the backup. Optional.
labelSelector:
matchLabels:
app: ark
component: server
# Whether or not to snapshot volumes. This only applies to PersistentVolumes for Azure, GCE, and
# AWS. Valid values are true, false, and null/unset. If unset, Ark performs snapshots as long as
# a persistent volume provider is configured for Ark.
snapshotVolumes: null
# The amount of time before this backup is eligible for garbage collection.
ttl: 24h0m0s
# Actions to perform at different times during a backup. The only hook currently supported is
# executing a command in a container in a pod using the pod exec API. Optional.
hooks:
# Array of hooks that are applicable to specific resources. Optional.
resources:
-
# Name of the hook. Will be displayed in backup log.
name: my-hook
# Array of namespaces to which this hook applies. If unspecified, the hook applies to all
# namespaces. Optional.
includedNamespaces:
- '*'
# Array of namespaces to which this hook does not apply. Optional.
excludedNamespaces:
- some-namespace
# Array of resources to which this hook applies. The only resource supported at this time is
# pods.
includedResources:
- pods
# Array of resources to which this hook does not apply. Optional.
excludedResources: []
# This hook only applies to objects matching this label selector. Optional.
labelSelector:
matchLabels:
app: ark
component: server
# An array of hooks to run before executing custom actions. Currently only "exec" hooks are supported.
# DEPRECATED. Use pre instead.
hooks:
# Same content as pre below.
# An array of hooks to run before executing custom actions. Currently only "exec" hooks are supported.
pre:
-
# The type of hook. This must be "exec".
exec:
# The name of the container where the command will be executed. If unspecified, the
# first container in the pod will be used. Optional.
container: my-container
# The command to execute, specified as an array. Required.
command:
- /bin/uname
- -a
# How to handle an error executing the command. Valid values are Fail and Continue.
# Defaults to Fail. Optional.
onError: Fail
# How long to wait for the command to finish executing. Defaults to 30 seconds. Optional.
timeout: 10s
# An array of hooks to run after all custom actions and additional items have been
# processed. Currently only "exec" hooks are supported.
post:
# Same content as pre above.
# Status about the Backup. Users should not set any data here.
status:
# The date and time when the Backup is eligible for garbage collection.
expiration: null
# The current phase. Valid values are New, FailedValidation, InProgress, Completed, Failed.
phase: ""
# An array of any validation errors encountered.
validationErrors: null
# The version of this Backup. The only version currently supported is 1.
version: 1
# Information about PersistentVolumes needed during restores.
volumeBackups:
# Each key is the name of a PersistentVolume.
some-pv-name:
# The ID used by the cloud provider for the snapshot created for this Backup.
snapshotID: snap-1234
# The type of the volume in the cloud provider API.
type: io1
# The availability zone where the volume resides in the cloud provider.
availabilityZone: my-zone
# The amount of provisioned IOPS for the volume. Optional.
iops: 10000
```

273
docs/aws-config.md Normal file
View File

@@ -0,0 +1,273 @@
# Run Ark on AWS
To set up Ark on AWS, you:
* Create your S3 bucket
* Create an AWS IAM user for Ark
* Configure the server
* Create a Secret for your credentials
If you do not have the `aws` CLI locally installed, follow the [user guide][5] to set it up.
## Create S3 bucket
Heptio Ark requires an object storage bucket to store backups in. Create an S3 bucket, replacing placeholders appropriately:
```bash
aws s3api create-bucket \
--bucket <YOUR_BUCKET> \
--region <YOUR_REGION> \
--create-bucket-configuration LocationConstraint=<YOUR_REGION>
```
NOTE: us-east-1 does not support a `LocationConstraint`. If your region is `us-east-1`, omit the bucket configuration:
```bash
aws s3api create-bucket \
--bucket <YOUR_BUCKET> \
--region us-east-1
```
## Create IAM user
For more information, see [the AWS documentation on IAM users][14].
1. Create the IAM user:
```bash
aws iam create-user --user-name heptio-ark
```
2. Attach policies to give `heptio-ark` the necessary permissions:
```bash
BUCKET=<YOUR_BUCKET>
cat > heptio-ark-policy.json <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:DescribeVolumes",
"ec2:DescribeSnapshots",
"ec2:CreateTags",
"ec2:CreateVolume",
"ec2:CreateSnapshot",
"ec2:DeleteSnapshot"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:DeleteObject",
"s3:PutObject",
"s3:AbortMultipartUpload",
"s3:ListMultipartUploadParts"
],
"Resource": [
"arn:aws:s3:::${BUCKET}/*"
]
},
{
"Effect": "Allow",
"Action": [
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::${BUCKET}"
]
}
]
}
EOF
aws iam put-user-policy \
--user-name heptio-ark \
--policy-name heptio-ark \
--policy-document file://heptio-ark-policy.json
```
3. Create an access key for the user:
```bash
aws iam create-access-key --user-name heptio-ark
```
The result should look like:
```json
{
"AccessKey": {
"UserName": "heptio-ark",
"Status": "Active",
"CreateDate": "2017-07-31T22:24:41.576Z",
"SecretAccessKey": <AWS_SECRET_ACCESS_KEY>,
"AccessKeyId": <AWS_ACCESS_KEY_ID>
}
}
```
4. Create an Ark-specific credentials file (`credentials-ark`) in your local directory:
```
[default]
aws_access_key_id=<AWS_ACCESS_KEY_ID>
aws_secret_access_key=<AWS_SECRET_ACCESS_KEY>
```
where the access key id and secret are the values returned from the `create-access-key` request.
## Credentials and configuration
In the Ark root directory, run the following to first set up namespaces, RBAC, and other scaffolding. To run in a custom namespace, make sure that you have edited the YAML files to specify the namespace. See [Run in custom namespace][0].
```bash
kubectl apply -f examples/common/00-prereqs.yaml
```
Create a Secret. In the directory of the credentials file you just created, run:
```bash
kubectl create secret generic cloud-credentials \
--namespace <ARK_NAMESPACE> \
--from-file cloud=credentials-ark
```
Specify the following values in the example files:
* In `examples/aws/00-ark-config.yaml`:
* Replace `<YOUR_BUCKET>` and `<YOUR_REGION>` (for S3, region is optional and will be queried from the AWS S3 API if not provided). See the [Config definition][6] for details.
* (Optional) If you run the nginx example, in file `examples/nginx-app/with-pv.yaml`:
* Replace `<YOUR_STORAGE_CLASS_NAME>` with `gp2`. This is AWS's default `StorageClass` name.
## Start the server
In the root of your Ark directory, run:
```bash
kubectl apply -f examples/aws/00-ark-config.yaml
kubectl apply -f examples/aws/10-deployment.yaml
```
## ALTERNATIVE: Setup permissions using kube2iam
[Kube2iam](https://github.com/jtblin/kube2iam) is a Kubernetes application that allows managing AWS IAM permissions for pod via annotations rather than operating on API keys.
> This path assumes you have `kube2iam` already running in your Kubernetes cluster. If that is not the case, please install it first, following the docs here: https://github.com/jtblin/kube2iam
It can be set up for Ark by creating a role that will have required permissions, and later by adding the permissions annotation on the ark deployment to define which role it should use internally.
1. Create a Trust Policy document to allow the role being used for EC2 management & assume kube2iam role:
```bash
cat > heptio-ark-trust-policy.json <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "ec2.amazonaws.com"
},
"Action": "sts:AssumeRole"
},
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::<AWS_ACCOUNT_ID>:role/<ROLE_CREATED_WHEN_INITIALIZING_KUBE2IAM>"
},
"Action": "sts:AssumeRole"
}
]
}
EOF
```
2. Create the IAM role:
```bash
aws iam create-role --role-name heptio-ark --assume-role-policy-document file://./heptio-ark-trust-policy.json
```
3. Attach policies to give `heptio-ark` the necessary permissions:
```bash
BUCKET=<YOUR_BUCKET>
cat > heptio-ark-policy.json <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:DescribeVolumes",
"ec2:DescribeSnapshots",
"ec2:CreateTags",
"ec2:CreateVolume",
"ec2:CreateSnapshot",
"ec2:DeleteSnapshot"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:DeleteObject",
"s3:PutObject",
"s3:AbortMultipartUpload",
"s3:ListMultipartUploadParts"
],
"Resource": [
"arn:aws:s3:::${BUCKET}/*"
]
},
{
"Effect": "Allow",
"Action": [
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::${BUCKET}"
]
}
]
}
EOF
aws iam put-role-policy \
--role-name heptio-ark \
--policy-name heptio-ark-policy \
--policy-document file://./heptio-ark-policy.json
```
4. Update AWS_ACCOUNT_ID & HEPTIO_ARK_ROLE_NAME in the file `examples/aws/10-deployment-kube2iam.yaml`:
```
---
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
...
```
5. Run Ark deployment using the file `examples/aws/10-deployment-kube2iam.yaml`.
[0]: namespace.md
[5]: https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html
[6]: config-definition.md#aws
[14]: http://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html

168
docs/azure-config.md Normal file
View File

@@ -0,0 +1,168 @@
# Run Ark on Azure
To configure Ark on Azure, you:
* Create your Azure storage account and blob container
* Create Azure service principal for Ark
* Configure the server
* Create a Secret for your credentials
If you do not have the `az` Azure CLI 2.0 installed locally, follow the [install guide][18] to set it up.
Run:
```bash
az login
```
## Kubernetes cluster prerequisites
Ensure that the VMs for your agent pool allow Managed Disks. If I/O performance is critical,
consider using Premium Managed Disks, which are SSD backed.
## Create Azure storage account and blob container
Heptio Ark requires a storage account and blob container in which to store backups.
The storage account can be created in the same Resource Group as your Kubernetes cluster or
separated into its own Resource Group. The example below shows the storage account created in a
separate `Ark_Backups` Resource Group.
The storage account needs to be created with a globally unique id since this is used for dns. In
the sample script below, we're generating a random name using `uuidgen`, but you can come up with
this name however you'd like, following the [Azure naming rules for storage accounts][19]. The
storage account is created with encryption at rest capabilities (Microsoft managed keys) and is
configured to only allow access via https.
```bash
# Create a resource group for the backups storage account. Change the location as needed.
AZURE_BACKUP_RESOURCE_GROUP=Ark_Backups
az group create -n $AZURE_BACKUP_RESOURCE_GROUP --location WestUS
# Create the storage account
AZURE_STORAGE_ACCOUNT_ID="ark$(uuidgen | cut -d '-' -f5 | tr '[A-Z]' '[a-z]')"
az storage account create \
--name $AZURE_STORAGE_ACCOUNT_ID \
--resource-group $AZURE_BACKUP_RESOURCE_GROUP \
--sku Standard_GRS \
--encryption-services blob \
--https-only true \
--kind BlobStorage \
--access-tier Hot
# Create the blob container named "ark". Feel free to use a different name; you'll need to
# adjust the `bucket` field under `backupStorageProvider` in the Ark Config accordingly if you do.
az storage container create -n ark --public-access off --account-name $AZURE_STORAGE_ACCOUNT_ID
# Obtain the storage access key for the storage account just created
AZURE_STORAGE_KEY=`az storage account keys list \
--account-name $AZURE_STORAGE_ACCOUNT_ID \
--resource-group $AZURE_BACKUP_RESOURCE_GROUP \
--query '[0].value' \
-o tsv`
```
## Create service principal
To integrate Ark with Azure, you must create an Ark-specific [service principal][17]. Note that seven environment variables must be set for Ark to work properly.
1. Obtain your Azure Account Subscription ID and Tenant ID:
```bash
AZURE_SUBSCRIPTION_ID=`az account list --query '[?isDefault].id' -o tsv`
AZURE_TENANT_ID=`az account list --query '[?isDefault].tenantId' -o tsv`
```
1. Set the name of the Resource Group that contains your Kubernetes cluster.
```bash
# Make sure this is the name of the second resource group. See warning.
AZURE_RESOURCE_GROUP=<NAME_OF_RESOURCE_GROUP_2>
```
WARNING: `AZURE_RESOURCE_GROUP` must be set to the name of the second resource group that is created when you provision your cluster in Azure. Your cluster is provisioned in the resource group that you specified when you created the cluster. Your disks, however, are provisioned in the second resource group.
If you are unsure of the Resource Group name, run the following command to get a list that you can select from. Then set the `AZURE_RESOURCE_GROUP` environment variable to the appropriate value.
```bash
az group list --query '[].{ ResourceGroup: name, Location:location }'
```
Get your cluster's Resource Group name from the `ResourceGroup` value in the response, and use it to set `$AZURE_RESOURCE_GROUP`.
1. Create a service principal with `Contributor` role. This will have subscription-wide access, so protect this credential. You can specify a password or let the `az ad sp create-for-rbac` command create one for you.
```bash
# Create service principal and specify your own password
AZURE_CLIENT_SECRET=super_secret_and_high_entropy_password_replace_me_with_your_own
az ad sp create-for-rbac --name "heptio-ark" --role "Contributor" --password $AZURE_CLIENT_SECRET
# Or create service principal and let the CLI generate a password for you. Make sure to capture the password.
AZURE_CLIENT_SECRET=`az ad sp create-for-rbac --name "heptio-ark" --role "Contributor" --query 'password' -o tsv`
# After creating the service principal, obtain the client id
AZURE_CLIENT_ID=`az ad sp list --display-name "heptio-ark" --query '[0].appId' -o tsv`
```
## Credentials and configuration
In the Ark root directory, run the following to first set up namespaces, RBAC, and other scaffolding. To run in a custom namespace, make sure that you have edited the YAML file to specify the namespace. See [Run in custom namespace][0].
```bash
kubectl apply -f examples/common/00-prereqs.yaml
```
Now you need to create a Secret that contains all the seven environment variables you just set. The command looks like the following:
```bash
kubectl create secret generic cloud-credentials \
--namespace <ARK_NAMESPACE> \
--from-literal AZURE_SUBSCRIPTION_ID=${AZURE_SUBSCRIPTION_ID} \
--from-literal AZURE_TENANT_ID=${AZURE_TENANT_ID} \
--from-literal AZURE_RESOURCE_GROUP=${AZURE_RESOURCE_GROUP} \
--from-literal AZURE_CLIENT_ID=${AZURE_CLIENT_ID} \
--from-literal AZURE_CLIENT_SECRET=${AZURE_CLIENT_SECRET} \
--from-literal AZURE_STORAGE_ACCOUNT_ID=${AZURE_STORAGE_ACCOUNT_ID} \
--from-literal AZURE_STORAGE_KEY=${AZURE_STORAGE_KEY}
```
Now that you have your Azure credentials stored in a Secret, you need to replace some placeholder values in the template files. Specifically, you need to change the following:
* In file `examples/azure/10-ark-config.yaml`:
* Replace `<YOUR_BUCKET>` and `<YOUR_TIMEOUT>`. See the [Config definition][8] for details.
Here is an example of a completed file.
```yaml
apiVersion: ark.heptio.com/v1
kind: Config
metadata:
namespace: heptio-ark
name: default
persistentVolumeProvider:
name: azure
config:
apiTimeout: 15m
backupStorageProvider:
name: azure
bucket: ark
backupSyncPeriod: 30m
gcSyncPeriod: 30m
scheduleSyncPeriod: 1m
restoreOnlyMode: false
```
## Start the server
In the root of your Ark directory, run:
```bash
kubectl apply -f examples/azure/
```
[0]: namespace.md
[8]: config-definition.md#azure
[17]: https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-application-objects
[18]: https://docs.microsoft.com/en-us/cli/azure/install-azure-cli
[19]: https://docs.microsoft.com/en-us/azure/architecture/best-practices/naming-conventions#storage

View File

@@ -1,17 +1,20 @@
# Build From Scratch
# Build from source
While the [README][0] pulls from the Heptio image registry, you can also build your own Heptio Ark container with the following steps:
* [Prerequisites][1]
* [Download][2]
* [Build][3]
* [Test][12]
* [Run][7]
* [Vendoring dependencies][10]
* [0. Prerequisites][1]
* [1. Download][2]
* [2. Build][3]
* [3. Run][7]
## Prerequisites
## 0. 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
* [Go][5] installed (minimum version 1.8)
In addition to the handling the prerequisites mentioned in the [Quickstart][4], you should have [Go][5] installed (minimum version 1.8).
## 1. Download
## Download
Install with go:
```
@@ -19,38 +22,99 @@ go get github.com/heptio/ark
```
The files are installed in `$GOPATH/src/github.com/heptio/ark`.
## 2. Build
## Build
Set the `$REGISTRY` environment variable (used in the `Makefile`) if you want to push the Heptio Ark images to your own registry. This allows any node in your cluster to pull your locally built image.
You can build your Ark image locally on the machine where you run your cluster, or you can push it to a private registry. This section covers both workflows.
`$PROJECT` and `$VERSION` environment variables are also specified in the `Makefile`, and can be similarly modified as desired.
Set the `$REGISTRY` environment variable (used in the `Makefile`) to push the Heptio Ark images to your own registry. This allows any node in your cluster to pull your locally built image.
In the Ark root directory, to build your container with the tag `$REGISTRY/ark:$VERSION`, run:
Run the following in the Ark root directory to build your container with the tag `$REGISTRY/$PROJECT:$VERSION`:
```
sudo make all
make container
```
To push your image to a registry, use `make push`.
## 3. Run
### Update generated files
The following files are automatically generated from the source code:
* The clientset
* Listers
* Shared informers
* Documentation
* Protobuf/gRPC types
If you make any of the following changes, you must run `make update` to regenerate
the files:
* Add/edit/remove command line flags and/or their help text
* Add/edit/remove commands or subcommands
* Add new API types
If you make the following change, you must run [generate-proto.sh][13] to regenerate files:
* Add/edit/remove protobuf message or service definitions. These changes require the [proto compiler][14].
### Cross compiling
By default, `make` builds an `ark` binary that runs on your host operating system and architecture.
To build for another platform, run `make build-<GOOS>-<GOARCH`.
For example, to build for the Mac, run `make build-darwin-amd64`.
All binaries are placed in `_output/bin/<GOOS>/<GOARCH>`-- for example, `_output/bin/darwin/amd64/ark`.
Ark's `Makefile` has a convenience target, `all-build`, that builds the following platforms:
* linux-amd64
* linux-arm
* linux-arm64
* darwin-amd64
* windows-amd64
## 3. Test
To run unit tests, use `make test`. You can also run `make verify` to ensure that all generated
files (clientset, listers, shared informers, docs) are up to date.
## 4. Run
When running Heptio Ark, you will need to account for the following (all of which are handled in the [`/examples`][6] manifests):
* Appropriate RBAC permissions in the cluster
* *Read access* for all data from the source cluster and namespaces
* *Write access* to the target cluster and namespaces
* Read access for all data from the source cluster and namespaces
* Write access to the target cluster and namespaces
* Cloud provider credentials
* *Read/write access* to volumes
* *Read/write access* to object storage for backup data
* Read/write access to volumes
* Read/write access to object storage for backup data
* A [Config object][8] definition for the Ark server
See [Cloud Provider Specifics][9] for a more detailed guide.
See [Cloud Provider Specifics][9] for more details.
### Specifying your image
When your Ark deployment is up and running, you must replace the Heptio-provided Ark image with the image that you built. Run:
```
kubectl set image deployment/ark ark=$REGISTRY/ark:$VERSION
```
where `$REGISTRY` and `$VERSION` are the values that you built with.
## 5. Vendoring dependencies
If you need to add or update the vendored dependencies, see [Vendoring dependencies][11].
[0]: ../README.md
[1]: #0-prerequisites
[2]: #1-download
[3]: #2-build
[1]: #prerequisites
[2]: #download
[3]: #build
[4]: ../README.md#quickstart
[5]: https://golang.org/doc/install
[6]: /examples
[7]: #3-run
[8]: reference.md#ark-config-definition
[9]: cloud-provider-specifics.md
[6]: https://github.com/heptio/ark/tree/master/examples
[7]: #run
[8]: config-definition.md
[9]: cloud-common.md
[10]: #vendoring-dependencies
[11]: vendoring-dependencies.md
[12]: #test
[13]: https://github.com/heptio/ark/blob/master/hack/generate-proto.sh
[14]: https://grpc.io/docs/quickstart/go.html#install-protocol-buffers-v3

View File

@@ -2,20 +2,19 @@
The Ark client provides a CLI that allows you to initiate ad-hoc backups, scheduled backups, or restores.
*The files in this directory enumerate each of the possible `ark` commands and their flags. Note that you can also find this info with the CLI itself, using the `--help` flag.*
[The files in the CLI reference directory][1] in the repository enumerate each of the possible `ark` commands and their flags.
This information is available in the CLI, using the `--help` flag.
## Running the client
While it is possible to build and run the `ark` executable yourself, it is recommended to use the containerized version. Use the alias described in the quickstart:
```
alias ark='docker run --rm -u $(id -u) -v $(dirname $KUBECONFIG):/kubeconfig -e KUBECONFIG=/kubeconfig/$(basename $KUBECONFIG) gcr.io/heptio-images/ark:latest'
```
Assuming that your `KUBECONFIG` variable is set, this alias takes care of specifying the appropriate Kubernetes cluster credentials for you.
We recommend that you [download a pre-built release][26], but you can also build and run the `ark` executable.
## Kubernetes cluster credentials
In general, Ark will search for your cluster credentials in the following order:
* `--kubeconfig` command line flag
* `$KUBECONFIG` environment variable
* In-cluster credentials--this only works when you are running Ark in a pod
[1]: https://github.com/heptio/ark/tree/master/docs/cli-reference
[26]: https://github.com/heptio/ark/releases

View File

@@ -5,19 +5,25 @@ Back up and restore Kubernetes cluster resources.
### Synopsis
Heptio Ark is a tool for managing disaster recovery, specifically for
Kubernetes cluster resources. It provides a simple, configurable,
and operationally robust way to back up your application state and
associated data.
Heptio Ark is a tool for managing disaster recovery, specifically for Kubernetes
cluster resources. It provides a simple, configurable, and operationally robust
way to back up your application state and associated data.
If you're familiar with kubectl, Ark supports a similar model, allowing you to
execute commands such as 'ark get backup' and 'ark create schedule'. The same
operations can also be performed as 'ark backup get' and 'ark schedule create'.
### Options
```
--alsologtostderr log to standard error as well as files
-h, --help help for ark
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
@@ -25,6 +31,14 @@ associated data.
### SEE ALSO
* [ark backup](ark_backup.md) - Work with backups
* [ark client](ark_client.md) - Ark client related commands
* [ark completion](ark_completion.md) - Output shell completion code for the specified shell (bash or zsh)
* [ark create](ark_create.md) - Create ark resources
* [ark delete](ark_delete.md) - Delete ark resources
* [ark describe](ark_describe.md) - Describe ark resources
* [ark get](ark_get.md) - Get ark resources
* [ark plugin](ark_plugin.md) - Work with plugins
* [ark restic](ark_restic.md) - Work with restic
* [ark restore](ark_restore.md) - Work with restores
* [ark schedule](ark_schedule.md) - Work with schedules
* [ark server](ark_server.md) - Run the ark server

View File

@@ -7,14 +7,22 @@ Work with backups
Work with backups
### Options
```
-h, --help help for backup
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
@@ -23,5 +31,9 @@ Work with backups
### SEE ALSO
* [ark](ark.md) - Back up and restore Kubernetes cluster resources.
* [ark backup create](ark_backup_create.md) - Create a backup
* [ark backup delete](ark_backup_delete.md) - Delete a backup
* [ark backup describe](ark_backup_describe.md) - Describe backups
* [ark backup download](ark_backup_download.md) - Download a backup
* [ark backup get](ark_backup_get.md) - Get backups
* [ark backup logs](ark_backup_logs.md) - Get backup logs

View File

@@ -8,23 +8,25 @@ Create a backup
Create a backup
```
ark backup create NAME
ark backup create NAME [flags]
```
### Options
```
--exclude-namespaces stringArray namespaces to exclude from the backup
--exclude-resources stringArray resources to exclude from the backup, formatted as resource.group, such as storageclasses.storage.k8s.io
--include-namespaces stringArray namespaces to include in the backup (use '*' for all namespaces) (default *)
--include-resources stringArray resources to include in the backup, formatted as resource.group, such as storageclasses.storage.k8s.io (use '*' for all resources)
--label-columns stringArray a comma-separated list of labels to be displayed as columns
--labels mapStringString labels to apply to the backup
-o, --output string Output display format. For create commands, display the object but do not send it to the server. Valid formats are 'table', 'json', and 'yaml'.
-l, --selector labelSelector only back up resources matching this label selector (default <none>)
--show-labels show labels in the last column
--snapshot-volumes take snapshots of PersistentVolumes as part of the backup
--ttl duration how long before the backup can be garbage collected (default 24h0m0s)
--exclude-namespaces stringArray namespaces to exclude from the backup
--exclude-resources stringArray resources to exclude from the backup, formatted as resource.group, such as storageclasses.storage.k8s.io
-h, --help help for create
--include-cluster-resources optionalBool[=true] include cluster-scoped resources in the backup
--include-namespaces stringArray namespaces to include in the backup (use '*' for all namespaces) (default *)
--include-resources stringArray resources to include in the backup, formatted as resource.group, such as storageclasses.storage.k8s.io (use '*' for all resources)
--label-columns stringArray a comma-separated list of labels to be displayed as columns
--labels mapStringString labels to apply to the backup
-o, --output string Output display format. For create commands, display the object but do not send it to the server. Valid formats are 'table', 'json', and 'yaml'.
-l, --selector labelSelector only back up resources matching this label selector (default <none>)
--show-labels show labels in the last column
--snapshot-volumes optionalBool[=true] take snapshots of PersistentVolumes as part of the backup
--ttl duration how long before the backup can be garbage collected (default 720h0m0s)
```
### Options inherited from parent commands
@@ -32,9 +34,11 @@ ark backup create NAME
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging

View File

@@ -0,0 +1,38 @@
## ark backup delete
Delete a backup
### Synopsis
Delete a backup
```
ark backup delete NAME [flags]
```
### Options
```
--confirm Confirm deletion
-h, --help help for delete
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark backup](ark_backup.md) - Work with backups

View File

@@ -0,0 +1,39 @@
## ark backup describe
Describe backups
### Synopsis
Describe backups
```
ark backup describe [NAME1] [NAME2] [NAME...] [flags]
```
### Options
```
-h, --help help for describe
-l, --selector string only show items matching this label selector
--volume-details display details of restic volume backups
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark backup](ark_backup.md) - Work with backups

View File

@@ -0,0 +1,40 @@
## ark backup download
Download a backup
### Synopsis
Download a backup
```
ark backup download NAME [flags]
```
### Options
```
--force forces the download and will overwrite file if it exists already
-h, --help help for download
-o, --output string path to output file. Defaults to <NAME>-data.tar.gz in the current directory
--timeout duration maximum time to wait to process download request (default 1m0s)
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark backup](ark_backup.md) - Work with backups

View File

@@ -8,12 +8,13 @@ Get backups
Get backups
```
ark backup get
ark backup get [flags]
```
### Options
```
-h, --help help for get
--label-columns stringArray a comma-separated list of labels to be displayed as columns
-o, --output string Output display format. For create commands, display the object but do not send it to the server. Valid formats are 'table', 'json', and 'yaml'. (default "table")
-l, --selector string only show items matching this label selector
@@ -25,9 +26,11 @@ ark backup get
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging

View File

@@ -0,0 +1,38 @@
## ark backup logs
Get backup logs
### Synopsis
Get backup logs
```
ark backup logs BACKUP [flags]
```
### Options
```
-h, --help help for logs
--timeout duration how long to wait to receive logs (default 1m0s)
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark backup](ark_backup.md) - Work with backups

View File

@@ -0,0 +1,34 @@
## ark client
Ark client related commands
### Synopsis
Ark client related commands
### Options
```
-h, --help help for client
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark](ark.md) - Back up and restore Kubernetes cluster resources.
* [ark client config](ark_client_config.md) - Get and set client configuration file values

View File

@@ -0,0 +1,35 @@
## ark client config
Get and set client configuration file values
### Synopsis
Get and set client configuration file values
### Options
```
-h, --help help for config
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark client](ark_client.md) - Ark client related commands
* [ark client config get](ark_client_config_get.md) - Get client configuration file values
* [ark client config set](ark_client_config_set.md) - Set client configuration file values

View File

@@ -0,0 +1,37 @@
## ark client config get
Get client configuration file values
### Synopsis
Get client configuration file values
```
ark client config get [KEY 1] [KEY 2] [...] [flags]
```
### Options
```
-h, --help help for get
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark client config](ark_client_config.md) - Get and set client configuration file values

View File

@@ -0,0 +1,37 @@
## ark client config set
Set client configuration file values
### Synopsis
Set client configuration file values
```
ark client config set KEY=VALUE [KEY=VALUE]... [flags]
```
### Options
```
-h, --help help for set
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark client config](ark_client_config.md) - Get and set client configuration file values

View File

@@ -0,0 +1,46 @@
## ark completion
Output shell completion code for the specified shell (bash or zsh)
### Synopsis
Generate shell completion code.
Auto completion supports both bash and zsh. Output is to STDOUT.
Load the ark completion code for bash into the current shell -
source <(ark completion bash)
Load the ark completion code for zsh into the current shell -
source <(ark completion zsh)
```
ark completion SHELL [flags]
```
### Options
```
-h, --help help for completion
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark](ark.md) - Back up and restore Kubernetes cluster resources.

View File

@@ -0,0 +1,36 @@
## ark create
Create ark resources
### Synopsis
Create ark resources
### Options
```
-h, --help help for create
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark](ark.md) - Back up and restore Kubernetes cluster resources.
* [ark create backup](ark_create_backup.md) - Create a backup
* [ark create restore](ark_create_restore.md) - Create a restore
* [ark create schedule](ark_create_schedule.md) - Create a schedule

View File

@@ -0,0 +1,49 @@
## ark create backup
Create a backup
### Synopsis
Create a backup
```
ark create backup NAME [flags]
```
### Options
```
--exclude-namespaces stringArray namespaces to exclude from the backup
--exclude-resources stringArray resources to exclude from the backup, formatted as resource.group, such as storageclasses.storage.k8s.io
-h, --help help for backup
--include-cluster-resources optionalBool[=true] include cluster-scoped resources in the backup
--include-namespaces stringArray namespaces to include in the backup (use '*' for all namespaces) (default *)
--include-resources stringArray resources to include in the backup, formatted as resource.group, such as storageclasses.storage.k8s.io (use '*' for all resources)
--label-columns stringArray a comma-separated list of labels to be displayed as columns
--labels mapStringString labels to apply to the backup
-o, --output string Output display format. For create commands, display the object but do not send it to the server. Valid formats are 'table', 'json', and 'yaml'.
-l, --selector labelSelector only back up resources matching this label selector (default <none>)
--show-labels show labels in the last column
--snapshot-volumes optionalBool[=true] take snapshots of PersistentVolumes as part of the backup
--ttl duration how long before the backup can be garbage collected (default 720h0m0s)
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark create](ark_create.md) - Create ark resources

View File

@@ -0,0 +1,60 @@
## ark create restore
Create a restore
### Synopsis
Create a restore
```
ark create restore [RESTORE_NAME] --from-backup BACKUP_NAME [flags]
```
### Examples
```
# create a restore named "restore-1" from backup "backup-1"
ark restore create restore-1 --from-backup backup-1
# create a restore with a default name ("backup-1-<timestamp>") from backup "backup-1"
ark restore create --from-backup backup-1
```
### Options
```
--exclude-namespaces stringArray namespaces to exclude from the restore
--exclude-resources stringArray resources to exclude from the restore, formatted as resource.group, such as storageclasses.storage.k8s.io
--from-backup string backup to restore from
-h, --help help for restore
--include-cluster-resources optionalBool[=true] include cluster-scoped resources in the restore
--include-namespaces stringArray namespaces to include in the restore (use '*' for all namespaces) (default *)
--include-resources stringArray resources to include in the restore, formatted as resource.group, such as storageclasses.storage.k8s.io (use '*' for all resources)
--label-columns stringArray a comma-separated list of labels to be displayed as columns
--labels mapStringString labels to apply to the restore
--namespace-mappings mapStringString namespace mappings from name in the backup to desired restored name in the form src1:dst1,src2:dst2,...
-o, --output string Output display format. For create commands, display the object but do not send it to the server. Valid formats are 'table', 'json', and 'yaml'.
--restore-volumes optionalBool[=true] whether to restore volumes from snapshots
-l, --selector labelSelector only restore resources matching this label selector (default <none>)
--show-labels show labels in the last column
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark create](ark_create.md) - Create ark resources

View File

@@ -0,0 +1,64 @@
## ark create schedule
Create a schedule
### Synopsis
The --schedule flag is required, in cron notation:
| Character Position | Character Period | Acceptable Values |
| -------------------|:----------------:| -----------------:|
| 1 | Minute | 0-59,* |
| 2 | Hour | 0-23,* |
| 3 | Day of Month | 1-31,* |
| 4 | Month | 1-12,* |
| 5 | Day of Week | 0-7,* |
```
ark create schedule NAME --schedule [flags]
```
### Examples
```
ark create schedule NAME --schedule="0 */6 * * *"
```
### Options
```
--exclude-namespaces stringArray namespaces to exclude from the backup
--exclude-resources stringArray resources to exclude from the backup, formatted as resource.group, such as storageclasses.storage.k8s.io
-h, --help help for schedule
--include-cluster-resources optionalBool[=true] include cluster-scoped resources in the backup
--include-namespaces stringArray namespaces to include in the backup (use '*' for all namespaces) (default *)
--include-resources stringArray resources to include in the backup, formatted as resource.group, such as storageclasses.storage.k8s.io (use '*' for all resources)
--label-columns stringArray a comma-separated list of labels to be displayed as columns
--labels mapStringString labels to apply to the backup
-o, --output string Output display format. For create commands, display the object but do not send it to the server. Valid formats are 'table', 'json', and 'yaml'.
--schedule string a cron expression specifying a recurring schedule for this backup to run
-l, --selector labelSelector only back up resources matching this label selector (default <none>)
--show-labels show labels in the last column
--snapshot-volumes optionalBool[=true] take snapshots of PersistentVolumes as part of the backup
--ttl duration how long before the backup can be garbage collected (default 720h0m0s)
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark create](ark_create.md) - Create ark resources

View File

@@ -0,0 +1,36 @@
## ark delete
Delete ark resources
### Synopsis
Delete ark resources
### Options
```
-h, --help help for delete
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark](ark.md) - Back up and restore Kubernetes cluster resources.
* [ark delete backup](ark_delete_backup.md) - Delete a backup
* [ark delete restore](ark_delete_restore.md) - Delete a restore
* [ark delete schedule](ark_delete_schedule.md) - Delete a schedule

View File

@@ -0,0 +1,38 @@
## ark delete backup
Delete a backup
### Synopsis
Delete a backup
```
ark delete backup NAME [flags]
```
### Options
```
--confirm Confirm deletion
-h, --help help for backup
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark delete](ark_delete.md) - Delete ark resources

View File

@@ -0,0 +1,37 @@
## ark delete restore
Delete a restore
### Synopsis
Delete a restore
```
ark delete restore NAME [flags]
```
### Options
```
-h, --help help for restore
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark delete](ark_delete.md) - Delete ark resources

View File

@@ -0,0 +1,37 @@
## ark delete schedule
Delete a schedule
### Synopsis
Delete a schedule
```
ark delete schedule NAME [flags]
```
### Options
```
-h, --help help for schedule
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark delete](ark_delete.md) - Delete ark resources

View File

@@ -0,0 +1,36 @@
## ark describe
Describe ark resources
### Synopsis
Describe ark resources
### Options
```
-h, --help help for describe
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark](ark.md) - Back up and restore Kubernetes cluster resources.
* [ark describe backups](ark_describe_backups.md) - Describe backups
* [ark describe restores](ark_describe_restores.md) - Describe restores
* [ark describe schedules](ark_describe_schedules.md) - Describe schedules

View File

@@ -0,0 +1,39 @@
## ark describe backups
Describe backups
### Synopsis
Describe backups
```
ark describe backups [NAME1] [NAME2] [NAME...] [flags]
```
### Options
```
-h, --help help for backups
-l, --selector string only show items matching this label selector
--volume-details display details of restic volume backups
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark describe](ark_describe.md) - Describe ark resources

View File

@@ -0,0 +1,39 @@
## ark describe restores
Describe restores
### Synopsis
Describe restores
```
ark describe restores [NAME1] [NAME2] [NAME...] [flags]
```
### Options
```
-h, --help help for restores
-l, --selector string only show items matching this label selector
--volume-details display details of restic volume restores
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark describe](ark_describe.md) - Describe ark resources

View File

@@ -0,0 +1,38 @@
## ark describe schedules
Describe schedules
### Synopsis
Describe schedules
```
ark describe schedules [NAME1] [NAME2] [NAME...] [flags]
```
### Options
```
-h, --help help for schedules
-l, --selector string only show items matching this label selector
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark describe](ark_describe.md) - Describe ark resources

View File

@@ -0,0 +1,36 @@
## ark get
Get ark resources
### Synopsis
Get ark resources
### Options
```
-h, --help help for get
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark](ark.md) - Back up and restore Kubernetes cluster resources.
* [ark get backups](ark_get_backups.md) - Get backups
* [ark get restores](ark_get_restores.md) - Get restores
* [ark get schedules](ark_get_schedules.md) - Get schedules

View File

@@ -0,0 +1,41 @@
## ark get backups
Get backups
### Synopsis
Get backups
```
ark get backups [flags]
```
### Options
```
-h, --help help for backups
--label-columns stringArray a comma-separated list of labels to be displayed as columns
-o, --output string Output display format. For create commands, display the object but do not send it to the server. Valid formats are 'table', 'json', and 'yaml'. (default "table")
-l, --selector string only show items matching this label selector
--show-labels show labels in the last column
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark get](ark_get.md) - Get ark resources

View File

@@ -0,0 +1,41 @@
## ark get restores
Get restores
### Synopsis
Get restores
```
ark get restores [flags]
```
### Options
```
-h, --help help for restores
--label-columns stringArray a comma-separated list of labels to be displayed as columns
-o, --output string Output display format. For create commands, display the object but do not send it to the server. Valid formats are 'table', 'json', and 'yaml'. (default "table")
-l, --selector string only show items matching this label selector
--show-labels show labels in the last column
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark get](ark_get.md) - Get ark resources

View File

@@ -0,0 +1,41 @@
## ark get schedules
Get schedules
### Synopsis
Get schedules
```
ark get schedules [flags]
```
### Options
```
-h, --help help for schedules
--label-columns stringArray a comma-separated list of labels to be displayed as columns
-o, --output string Output display format. For create commands, display the object but do not send it to the server. Valid formats are 'table', 'json', and 'yaml'. (default "table")
-l, --selector string only show items matching this label selector
--show-labels show labels in the last column
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark get](ark_get.md) - Get ark resources

View File

@@ -0,0 +1,35 @@
## ark plugin
Work with plugins
### Synopsis
Work with plugins
### Options
```
-h, --help help for plugin
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark](ark.md) - Back up and restore Kubernetes cluster resources.
* [ark plugin add](ark_plugin_add.md) - Add a plugin
* [ark plugin remove](ark_plugin_remove.md) - Remove a plugin

View File

@@ -0,0 +1,38 @@
## ark plugin add
Add a plugin
### Synopsis
Add a plugin
```
ark plugin add IMAGE [flags]
```
### Options
```
-h, --help help for add
--image-pull-policy the imagePullPolicy for the plugin container. Valid values are Always, IfNotPresent, Never. (default IfNotPresent)
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark plugin](ark_plugin.md) - Work with plugins

View File

@@ -0,0 +1,37 @@
## ark plugin remove
Remove a plugin
### Synopsis
Remove a plugin
```
ark plugin remove [NAME | IMAGE] [flags]
```
### Options
```
-h, --help help for remove
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark plugin](ark_plugin.md) - Work with plugins

View File

@@ -0,0 +1,35 @@
## ark restic
Work with restic
### Synopsis
Work with restic
### Options
```
-h, --help help for restic
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark](ark.md) - Back up and restore Kubernetes cluster resources.
* [ark restic repo](ark_restic_repo.md) - Work with restic repositories
* [ark restic server](ark_restic_server.md) - Run the ark restic server

View File

@@ -0,0 +1,34 @@
## ark restic repo
Work with restic repositories
### Synopsis
Work with restic repositories
### Options
```
-h, --help help for repo
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark restic](ark_restic.md) - Work with restic
* [ark restic repo get](ark_restic_repo_get.md) - Get restic repositories

View File

@@ -0,0 +1,41 @@
## ark restic repo get
Get restic repositories
### Synopsis
Get restic repositories
```
ark restic repo get [flags]
```
### Options
```
-h, --help help for get
--label-columns stringArray a comma-separated list of labels to be displayed as columns
-o, --output string Output display format. For create commands, display the object but do not send it to the server. Valid formats are 'table', 'json', and 'yaml'. (default "table")
-l, --selector string only show items matching this label selector
--show-labels show labels in the last column
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark restic repo](ark_restic_repo.md) - Work with restic repositories

View File

@@ -0,0 +1,38 @@
## ark restic server
Run the ark restic server
### Synopsis
Run the ark restic server
```
ark restic server [flags]
```
### Options
```
-h, --help help for server
--log-level the level at which to log. Valid values are debug, info, warning, error, fatal, panic. (default info)
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark restic](ark_restic.md) - Work with restic

View File

@@ -7,14 +7,22 @@ Work with restores
Work with restores
### Options
```
-h, --help help for restore
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
@@ -24,5 +32,7 @@ Work with restores
* [ark](ark.md) - Back up and restore Kubernetes cluster resources.
* [ark restore create](ark_restore_create.md) - Create a restore
* [ark restore delete](ark_restore_delete.md) - Delete a restore
* [ark restore get](ark_restore_get.md) - get restores
* [ark restore describe](ark_restore_describe.md) - Describe restores
* [ark restore get](ark_restore_get.md) - Get restores
* [ark restore logs](ark_restore_logs.md) - Get restore logs

View File

@@ -8,20 +8,36 @@ Create a restore
Create a restore
```
ark restore create BACKUP
ark restore create [RESTORE_NAME] --from-backup BACKUP_NAME [flags]
```
### Examples
```
# create a restore named "restore-1" from backup "backup-1"
ark restore create restore-1 --from-backup backup-1
# create a restore with a default name ("backup-1-<timestamp>") from backup "backup-1"
ark restore create --from-backup backup-1
```
### Options
```
--label-columns stringArray a comma-separated list of labels to be displayed as columns
--labels mapStringString labels to apply to the restore
--namespace-mappings mapStringString namespace mappings from name in the backup to desired restored name in the form src1:dst1,src2:dst2,...
--namespaces stringArray comma-separated list of namespaces to restore
-o, --output string Output display format. For create commands, display the object but do not send it to the server. Valid formats are 'table', 'json', and 'yaml'.
--restore-volumes whether to restore volumes from snapshots
-l, --selector labelSelector only restore resources matching this label selector (default <none>)
--show-labels show labels in the last column
--exclude-namespaces stringArray namespaces to exclude from the restore
--exclude-resources stringArray resources to exclude from the restore, formatted as resource.group, such as storageclasses.storage.k8s.io
--from-backup string backup to restore from
-h, --help help for create
--include-cluster-resources optionalBool[=true] include cluster-scoped resources in the restore
--include-namespaces stringArray namespaces to include in the restore (use '*' for all namespaces) (default *)
--include-resources stringArray resources to include in the restore, formatted as resource.group, such as storageclasses.storage.k8s.io (use '*' for all resources)
--label-columns stringArray a comma-separated list of labels to be displayed as columns
--labels mapStringString labels to apply to the restore
--namespace-mappings mapStringString namespace mappings from name in the backup to desired restored name in the form src1:dst1,src2:dst2,...
-o, --output string Output display format. For create commands, display the object but do not send it to the server. Valid formats are 'table', 'json', and 'yaml'.
--restore-volumes optionalBool[=true] whether to restore volumes from snapshots
-l, --selector labelSelector only restore resources matching this label selector (default <none>)
--show-labels show labels in the last column
```
### Options inherited from parent commands
@@ -29,9 +45,11 @@ ark restore create BACKUP
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging

View File

@@ -8,7 +8,13 @@ Delete a restore
Delete a restore
```
ark restore delete NAME
ark restore delete NAME [flags]
```
### Options
```
-h, --help help for delete
```
### Options inherited from parent commands
@@ -16,9 +22,11 @@ ark restore delete NAME
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging

View File

@@ -0,0 +1,39 @@
## ark restore describe
Describe restores
### Synopsis
Describe restores
```
ark restore describe [NAME1] [NAME2] [NAME...] [flags]
```
### Options
```
-h, --help help for describe
-l, --selector string only show items matching this label selector
--volume-details display details of restic volume restores
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark restore](ark_restore.md) - Work with restores

View File

@@ -1,19 +1,20 @@
## ark restore get
get restores
Get restores
### Synopsis
get restores
Get restores
```
ark restore get
ark restore get [flags]
```
### Options
```
-h, --help help for get
--label-columns stringArray a comma-separated list of labels to be displayed as columns
-o, --output string Output display format. For create commands, display the object but do not send it to the server. Valid formats are 'table', 'json', and 'yaml'. (default "table")
-l, --selector string only show items matching this label selector
@@ -25,9 +26,11 @@ ark restore get
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging

View File

@@ -0,0 +1,38 @@
## ark restore logs
Get restore logs
### Synopsis
Get restore logs
```
ark restore logs RESTORE [flags]
```
### Options
```
-h, --help help for logs
--timeout duration how long to wait to receive logs (default 1m0s)
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark restore](ark_restore.md) - Work with restores

View File

@@ -7,14 +7,22 @@ Work with schedules
Work with schedules
### Options
```
-h, --help help for schedule
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
@@ -24,5 +32,6 @@ Work with schedules
* [ark](ark.md) - Back up and restore Kubernetes cluster resources.
* [ark schedule create](ark_schedule_create.md) - Create a schedule
* [ark schedule delete](ark_schedule_delete.md) - Delete a schedule
* [ark schedule describe](ark_schedule_describe.md) - Describe schedules
* [ark schedule get](ark_schedule_get.md) - Get schedules

View File

@@ -5,27 +5,43 @@ Create a schedule
### Synopsis
Create a schedule
The --schedule flag is required, in cron notation:
| Character Position | Character Period | Acceptable Values |
| -------------------|:----------------:| -----------------:|
| 1 | Minute | 0-59,* |
| 2 | Hour | 0-23,* |
| 3 | Day of Month | 1-31,* |
| 4 | Month | 1-12,* |
| 5 | Day of Week | 0-7,* |
```
ark schedule create NAME
ark schedule create NAME --schedule [flags]
```
### Examples
```
ark create schedule NAME --schedule="0 */6 * * *"
```
### Options
```
--exclude-namespaces stringArray namespaces to exclude from the backup
--exclude-resources stringArray resources to exclude from the backup, formatted as resource.group, such as storageclasses.storage.k8s.io
--include-namespaces stringArray namespaces to include in the backup (use '*' for all namespaces) (default *)
--include-resources stringArray resources to include in the backup, formatted as resource.group, such as storageclasses.storage.k8s.io (use '*' for all resources)
--label-columns stringArray a comma-separated list of labels to be displayed as columns
--labels mapStringString labels to apply to the backup
-o, --output string Output display format. For create commands, display the object but do not send it to the server. Valid formats are 'table', 'json', and 'yaml'.
--schedule string a cron expression specifying a recurring schedule for this backup to run
-l, --selector labelSelector only back up resources matching this label selector (default <none>)
--show-labels show labels in the last column
--snapshot-volumes take snapshots of PersistentVolumes as part of the backup
--ttl duration how long before the backup can be garbage collected (default 24h0m0s)
--exclude-namespaces stringArray namespaces to exclude from the backup
--exclude-resources stringArray resources to exclude from the backup, formatted as resource.group, such as storageclasses.storage.k8s.io
-h, --help help for create
--include-cluster-resources optionalBool[=true] include cluster-scoped resources in the backup
--include-namespaces stringArray namespaces to include in the backup (use '*' for all namespaces) (default *)
--include-resources stringArray resources to include in the backup, formatted as resource.group, such as storageclasses.storage.k8s.io (use '*' for all resources)
--label-columns stringArray a comma-separated list of labels to be displayed as columns
--labels mapStringString labels to apply to the backup
-o, --output string Output display format. For create commands, display the object but do not send it to the server. Valid formats are 'table', 'json', and 'yaml'.
--schedule string a cron expression specifying a recurring schedule for this backup to run
-l, --selector labelSelector only back up resources matching this label selector (default <none>)
--show-labels show labels in the last column
--snapshot-volumes optionalBool[=true] take snapshots of PersistentVolumes as part of the backup
--ttl duration how long before the backup can be garbage collected (default 720h0m0s)
```
### Options inherited from parent commands
@@ -33,9 +49,11 @@ ark schedule create NAME
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging

View File

@@ -8,7 +8,13 @@ Delete a schedule
Delete a schedule
```
ark schedule delete NAME
ark schedule delete NAME [flags]
```
### Options
```
-h, --help help for delete
```
### Options inherited from parent commands
@@ -16,9 +22,11 @@ ark schedule delete NAME
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging

View File

@@ -0,0 +1,38 @@
## ark schedule describe
Describe schedules
### Synopsis
Describe schedules
```
ark schedule describe [NAME1] [NAME2] [NAME...] [flags]
```
### Options
```
-h, --help help for describe
-l, --selector string only show items matching this label selector
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [ark schedule](ark_schedule.md) - Work with schedules

View File

@@ -8,12 +8,13 @@ Get schedules
Get schedules
```
ark schedule get
ark schedule get [flags]
```
### Options
```
-h, --help help for get
--label-columns stringArray a comma-separated list of labels to be displayed as columns
-o, --output string Output display format. For create commands, display the object but do not send it to the server. Valid formats are 'table', 'json', and 'yaml'. (default "table")
-l, --selector string only show items matching this label selector
@@ -25,9 +26,11 @@ ark schedule get
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging

View File

@@ -8,22 +8,28 @@ Run the ark server
Run the ark server
```
ark server
ark server [flags]
```
### Options
```
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
-h, --help help for server
--log-level the level at which to log. Valid values are debug, info, warning, error, fatal, panic. (default info)
--metrics-address string the address to expose prometheus metrics (default ":8085")
--plugin-dir string directory containing Ark plugins (default "/plugins")
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging

View File

@@ -8,7 +8,13 @@ Print the ark version and associated image
Print the ark version and associated image
```
ark version
ark version [flags]
```
### Options
```
-h, --help help for version
```
### Options inherited from parent commands
@@ -16,9 +22,11 @@ ark version
```
--alsologtostderr log to standard error as well as files
--kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration
--kubecontext string The context to use to talk to the Kubernetes apiserver. If unset defaults to whatever your current-context is (kubectl config current-context)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-n, --namespace string The namespace in which Ark should operate (default "heptio-ark")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging

82
docs/cloud-common.md Normal file
View File

@@ -0,0 +1,82 @@
# Set up Ark with your cloud provider
To run Ark with your cloud provider, you specify provider-specific settings for the Ark server. In version 0.7.0 and later, you can run Ark in any namespace, which requires additional customization. See [Run in custom namespace][3].
The Ark repository includes a set of example YAML files that specify the settings for each cloud provider. For provider-specific instructions, see:
* [Run Ark on AWS][0]
* [Run Ark on GCP][1]
* [Run Ark on Azure][2]
* [Use IBM Cloud Object Store as Ark's storage destination][4]
In version 0.9.0 and later, you can use Ark's integration with restic, which requires additional setup. See [Restic instructions][20].
## Examples
After you set up the Ark server, try these examples:
### Basic example (without PersistentVolumes)
1. Start the sample nginx app:
```bash
kubectl apply -f examples/nginx-app/base.yaml
```
1. Create a backup:
```bash
ark backup create nginx-backup --include-namespaces nginx-example
```
1. Simulate a disaster:
```bash
kubectl delete namespaces nginx-example
```
Wait for the namespace to be deleted.
1. Restore your lost resources:
```bash
ark restore create --from-backup nginx-backup
```
### Snapshot example (with PersistentVolumes)
> NOTE: For Azure, your Kubernetes cluster needs to be version 1.7.2+ to support PV snapshotting of its managed disks.
1. Start the sample nginx app:
```bash
kubectl apply -f examples/nginx-app/with-pv.yaml
```
1. Create a backup with PV snapshotting:
```bash
ark backup create nginx-backup --include-namespaces nginx-example
```
1. Simulate a disaster:
```bash
kubectl delete namespaces nginx-example
```
Because the default [reclaim policy][19] for dynamically-provisioned PVs is "Delete", these commands should trigger your cloud provider to delete the disk backing the PV. The deletion process is asynchronous so this may take some time. **Before continuing to the next step, check your cloud provider to confirm that the disk no longer exists.**
1. Restore your lost resources:
```bash
ark restore create --from-backup nginx-backup
```
[0]: aws-config.md
[1]: gcp-config.md
[2]: azure-config.md
[3]: namespace.md
[4]: ibm-config.md
[19]: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#reclaiming
[20]: https://github.com/heptio/ark/blob/master/docs/restic.md

View File

@@ -1,361 +0,0 @@
# Cloud Provider Specifics
While the [Quickstart][0] uses a local storage service to quickly set up Heptio Ark as a demonstration, this document details additional configurations that are required when integrating with the cloud providers below:
* [Setup][12]
* [AWS][1]
* [GCP][2]
* [Azure][3]
* [Run][13]
* [Ark server][9]
* [Basic example (no PVs)][10]
* [Snapshot example (with PVs)][11]
## Setup
### AWS
#### IAM user creation
To integrate Heptio Ark with AWS, you should follow the instructions below to create an Ark-specific [IAM user][14].
1. If you do not have the AWS CLI locally installed, follow the [user guide][5] to set it up.
2. Create an IAM user:
```
aws iam create-user --user-name heptio-ark
```
3. Attach a policy to give `heptio-ark` the necessary permissions:
```
aws iam attach-user-policy \
--policy-arn arn:aws:iam::aws:policy/AmazonS3FullAccess \
--user-name heptio-ark
aws iam attach-user-policy \
--policy-arn arn:aws:iam::aws:policy/AmazonEC2FullAccess \
--user-name heptio-ark
```
4. Create an access key for the user:
```
aws iam create-access-key --user-name heptio-ark
```
The result should look like:
```
{
"AccessKey": {
"UserName": "heptio-ark",
"Status": "Active",
"CreateDate": "2017-07-31T22:24:41.576Z",
"SecretAccessKey": <AWS_SECRET_ACCESS_KEY>,
"AccessKeyId": <AWS_ACCESS_KEY_ID>
}
}
```
5. Using the output from the previous command, create an Ark-specific credentials file (`credentials-ark`) in your local directory that looks like the following:
```
[default]
aws_access_key_id=<AWS_ACCESS_KEY_ID>
aws_secret_access_key=<AWS_SECRET_ACCESS_KEY>
```
#### Credentials and configuration
In the Ark root directory, run the following to first set up namespaces, RBAC, and other scaffolding:
```
kubectl apply -f examples/common/00-prereqs.yaml
```
Create a Secret, running this command in the local directory of the credentials file you just created:
```
kubectl create secret generic cloud-credentials \
--namespace heptio-ark \
--from-file cloud=credentials-ark
```
Now that you have your IAM user credentials stored in a Secret, you need to replace some placeholder values in the template files. Specifically, you need to change the following:
* In file `examples/aws/00-ark-config.yaml`:
* Replace `<YOUR_BUCKET>`, `<YOUR_REGION>`, and `<YOUR_AVAILABILITY_ZONE>`. See the [Config definition][6] for details.
* In file `examples/common/10-deployment.yaml`:
* Make sure that `spec.template.spec.containers[*].env.name` is "AWS_SHARED_CREDENTIALS_FILE".
* (Optional) If you are running the Nginx example, in file `examples/nginx-app/with-pv.yaml`:
* Replace `<YOUR_STORAGE_CLASS_NAME>` with `gp2`. This is AWS's default `StorageClass` name.
### GCP
#### Service account creation
To integrate Heptio Ark with GCP, you should follow the instructions below to create an Ark-specific [Service Account][15].
1. If you do not have the gcloud CLI locally installed, follow the [user guide][16] to set it up.
2. View your current config settings:
```
gcloud config list
```
Store the `project` value from the results in the environment variable `$PROJECT_ID`.
2. Create a service account:
```
gcloud iam service-accounts create heptio-ark \
--display-name "Heptio Ark service account"
```
Then list all accounts and find the `heptio-ark` account you just created:
```
gcloud iam service-accounts list
```
Set the `$SERVICE_ACCOUNT_EMAIL` variable to match its `email` value.
3. Attach policies to give `heptio-ark` the necessary permissions to function (replacing placeholders appropriately):
```
gcloud projects add-iam-policy-binding $PROJECT_ID \
--member serviceAccount:$SERVICE_ACCOUNT_EMAIL \
--role roles/compute.storageAdmin
gcloud projects add-iam-policy-binding $PROJECT_ID \
--member serviceAccount:$SERVICE_ACCOUNT_EMAIL \
--role roles/storage.admin
```
4. Create a service account key, specifying an output file (`credentials-ark`) in your local directory:
```
gcloud iam service-accounts keys create credentials-ark \
--iam-account $SERVICE_ACCOUNT_EMAIL
```
#### Credentials and configuration
In the Ark root directory, run the following to first set up namespaces, RBAC, and other scaffolding:
```
kubectl apply -f examples/common/00-prereqs.yaml
```
Create a Secret, running this command in the local directory of the credentials file you just created:
```
kubectl create secret generic cloud-credentials \
--namespace heptio-ark \
--from-file cloud=credentials-ark
```
Now that you have your Google Cloud credentials stored in a Secret, you need to replace some placeholder values in the template files. Specifically, you need to change the following:
* In file `examples/gcp/00-ark-config.yaml`:
* Replace `<YOUR_BUCKET>`, `<YOUR_PROJECT>` and `<YOUR_ZONE>`. See the [Config definition][7] for details.
* In file `examples/common/10-deployment.yaml`:
* Change `spec.template.spec.containers[*].env.name` to "GOOGLE_APPLICATION_CREDENTIALS".
* (Optional) If you are running the Nginx example, in file `examples/nginx-app/with-pv.yaml`:
* Replace `<YOUR_STORAGE_CLASS_NAME>` with `standard`. This is GCP's default `StorageClass` name.
### Azure
#### Service principal creation
To integrate Heptio Ark with Azure, you should follow the instructions below to create an Ark-specific [service principal][17].
1. If you do not have the `az` Azure CLI 2.0 locally installed, follow the [user guide][18] to set it up. Once done, run:
```
az login
```
2. There are seven environment variables that need to be set for Heptio Ark to work properly. The following steps detail how to acquire these, in the process of setting up the necessary RBAC.
3. List your account:
```
az account list
```
Save the relevant response values into environment variables: `id` corresponds to `$AZURE_SUBSCRIPTION_ID` and `tenantId` corresponds to `$AZURE_TENANT_ID`.
4. Assuming that you already have a running Kubernetes cluster on Azure, you should have a corresponding resource group as well. List your current groups to find it:
```
az group list
```
Get your cluster's group `name` from the response, and use it to set `$AZURE_RESOURCE_GROUP`. (Also note the `location`--this is later used in the Azure-specific portion of the Ark Config).
5. Create a service principal with the "Contributor" role:
```
az ad sp create-for-rbac --role="Contributor" --name="heptio-ark"
```
From the response, save `appId` into `$AZURE_CLIENT_ID` and `password` into `$AZURE_CLIENT_SECRET`.
6. Login into the `heptio-ark` service principal account:
```
az login --service-principal \
--username http://heptio-ark-test \
--password $AZURE_CLIENT_SECRET \
--tenant $AZURE_TENANT_ID
```
7. Specify a *globally-unique* storage account id and save it in `$AZURE_STORAGE_ACCOUNT_ID`. Then create the storage account, specifying the optional `--location` flag if you do not have defaults from `az configure`:
```
az storage account create \
--name $AZURE_STORAGE_ACCOUNT_ID \
--resource-group $AZURE_RESOURCE_GROUP \
--sku Standard_GRS
```
You will encounter an error message if the storage account ID is not unique; change it accordingly.
8. Get the keys for your storage account:
```
az storage account keys list \
--account-name $AZURE_STORAGE_ACCOUNT_ID \
--resource-group $AZURE_RESOURCE_GROUP
```
Set `$AZURE_STORAGE_KEY` to any one of the `value`s returned.
#### Credentials and configuration
In the Ark root directory, run the following to first set up namespaces, RBAC, and other scaffolding:
```
kubectl apply -f examples/common/00-prereqs.yaml
```
Now you need to create a Secret that contains all the seven environment variables you just set. The command looks like the following:
```
kubectl create secret generic cloud-credentials \
--namespace heptio-ark \
--from-literal AZURE_SUBSCRIPTION_ID=${AZURE_SUBSCRIPTION_ID} \
--from-literal AZURE_TENANT_ID=${AZURE_TENANT_ID} \
--from-literal AZURE_RESOURCE_GROUP=${AZURE_RESOURCE_GROUP} \
--from-literal AZURE_CLIENT_ID=${AZURE_CLIENT_ID} \
--from-literal AZURE_CLIENT_SECRET=${AZURE_CLIENT_SECRET} \
--from-literal AZURE_STORAGE_ACCOUNT_ID=${AZURE_STORAGE_ACCOUNT_ID} \
--from-literal AZURE_STORAGE_KEY=${AZURE_STORAGE_KEY}
```
Now that you have your Azure credentials stored in a Secret, you need to replace some placeholder values in the template files. Specifically, you need to change the following:
* In file `examples/azure/10-ark-config.yaml`:
* Replace `<YOUR_BUCKET>`, `<YOUR_LOCATION>`, and `<YOUR_TIMEOUT>`. See the [Config definition][8] for details.
## Run
### Ark server
Make sure that you have run `kubectl apply -f examples/common/00-prereqs.yaml` first (this command is incorporated in the previous setup instructions because it creates the necessary namespaces).
* **AWS and GCP**
Start the Ark server itself, using the Config from the appropriate cloud-provider-specific directory:
```
kubectl apply -f examples/common/10-deployment.yaml
kubectl apply -f examples/<CLOUD-PROVIDER>/
```
* **Azure**
Because Azure loads its credentials differently (from environment variables rather than a file), you need to instead run:
```
kubectl apply -f examples/azure/
```
### Basic example (No PVs)
Start the sample nginx app:
```
kubectl apply -f examples/nginx-app/base.yaml
```
Now create a backup:
```
ark backup create nginx-backup --selector app=nginx
```
Simulate a disaster:
```
kubectl delete namespaces nginx-example
```
Now restore your lost resources:
```
ark restore create nginx-backup
```
### Snapshot example (With PVs)
> NOTE: For Azure, your Kubernetes cluster needs to be version 1.7.2+ in order to support PV snapshotting of its managed disks.
Label a node so that all nginx pods end up on the same machine (avoiding PV binding issues):
```
nginx_node_name=$(kubectl get nodes -o jsonpath='{.items[0].metadata.name}')
kubectl label nodes $nginx_node_name app=nginx
```
Start the sample nginx app:
```
kubectl apply -f examples/nginx-app/with-pv.yaml
```
Because Kubernetes does not automatically transfer labels from PVCs to dynamically generated PVs, you need to do so manually:
```
nginx_pv_name=$(kubectl get pv -o jsonpath='{.items[?(@.spec.claimRef.name=="nginx-logs")].metadata.name}')
kubectl label pv $nginx_pv_name app=nginx
```
Now create a backup with PV snapshotting:
```
ark backup create nginx-backup --selector app=nginx --snapshot-volumes
```
Simulate a disaster:
```
kubectl delete namespaces nginx-example
kubectl delete pv $nginx_pv_name
```
Because the default [reclaim policy][19] for dynamically-provisioned PVs is "Delete", the above commands should trigger your cloud provider to delete the disk backing the PV. The deletion process is asynchronous so this may take some time. **Before continuing to the next step, check your cloud provider (via dashboard or CLI) to confirm that the disk no longer exists.**
Now restore your lost resources:
```
ark restore create nginx-backup --restore-volumes
```
[0]: /README.md#quickstart
[1]: #aws
[2]: #gcp
[3]: #azure
[4]: /examples/aws
[5]: http://docs.aws.amazon.com/cli/latest/userguide/installing.html
[6]: config-definition.md#aws
[7]: config-definition.md#gcp
[8]: config-definition.md#azure
[9]: #ark-server
[10]: #basic-example-no-pvs
[11]: #snapshot-example-with-pvs
[12]: #setup
[13]: #run
[14]: http://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html
[15]: https://cloud.google.com/compute/docs/access/service-accounts
[16]: https://cloud.google.com/compute/docs/gcloud-compute
[17]: https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-application-objects
[18]: https://docs.microsoft.com/en-us/azure/storage/storage-azure-cli
[19]: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#reclaiming

View File

@@ -1,66 +0,0 @@
# Concepts
* [Overview][0]
* [Operation types][1]
* [1. Backups][2]
* [2. Schedules][3]
* [3. Restores][4]
* [Expired backup deletion][5]
* [Cloud storage sync][6]
## Overview
Heptio Ark provides customizable degrees of recovery for all Kubernetes API objects (Pods, Deployments, Jobs, Custom Resource Definitions, etc.), as well as for persistent volumes. This recovery can be cluster-wide, or fine-tuned according to object type, namespace, or labels.
Ark is ideal for the disaster recovery use case, as well as for snapshotting your application state, prior to performing system operations on your cluster (e.g. upgrades).
## Operation types
This section gives a quick overview of the Ark operation types.
### 1. Backups
The *backup* operation (1) uploads a tarball of copied Kubernetes resources into cloud object storage and (2) uses the cloud provider API to make disk snapshots of persistent volumes, if specified. [Annotations][8] are cleared for PVs but kept for all other object types.
Some things to be aware of:
* *Cluster backups are not strictly atomic.* If API objects are being created or edited at the time of backup, they may or not be included in the backup. In practice, backups happen very quickly and so the odds of capturing inconsistent information are low, but still possible.
* *A backup usually takes no more than a few seconds.* The snapshotting process for persistent volumes is asynchronous, so the runtime of the `ark backup` command isn't dependent on disk size.
These ad-hoc backups are saved with the `<BACKUP NAME>` specified during creation.
### 2. Schedules
The *schedule* operation allows you to back up your data at recurring intervals. The first backup is performed when the schedule is first created, and subsequent backups happen at the schedule's specified interval. These intervals are specified by a Cron expression.
A Schedule acts as a wrapper for Backups; when triggered, it creates them behind the scenes.
Scheduled backups are saved with the name `<SCHEDULE NAME>-<TIMESTAMP>`, where `<TIMESTAMP>` is formatted as *YYYYMMDDhhmmss*.
### 3. Restores
The *restore* operation allows you to restore all of the objects and persistent volumes from a previously created Backup. Heptio Ark supports multiple namespace remapping--for example, in a single restore, objects in namespace "abc" can be recreated under namespace "def", and the ones in "123" under "456".
Kubernetes API objects that have been restored can be identified with a label that looks like `ark-restore=<BACKUP NAME>-<TIMESTAMP>`, where `<TIMESTAMP>` is formatted as *YYYYMMDDhhmmss*.
You can also run the Ark server in *restore-only* mode, which disables backup, schedule, and garbage collection functionality during disaster recovery.
## Expired backup deletion
When first creating a backup, you can specify a TTL. If Ark sees that an existing Backup resource has expired, it removes both:
* The Backup resource itself
* The actual backup file from cloud object storage
## Cloud storage sync
Heptio Ark treats object storage as the source of truth. It continuously checks to see that the correct Backup resources are always present. If there is a properly formatted backup file in the storage bucket, but no corresponding Backup resources in the Kubernetes API, Ark synchronizes the information from object storage to Kubernetes.
This allows *restore* functionality to work in a cluster migration scenario, where the original Backup objects do not exist in the new cluster. See the [use case guide][7] for details.
[0]: #overview
[1]: #operation-types
[2]: #1-backups
[3]: #2-schedules
[4]: #3-restores
[5]: #expired-backup-deletion
[6]: #cloud-storage-sync
[7]: use-cases.md#cluster-migration
[8]: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/

View File

@@ -1,9 +1,9 @@
# Ark Config definition
* [Overview][10]
* [Example][11]
* [Parameter Reference][8]
* [Main config][9]
* [Overview][8]
* [Example][9]
* [Parameter Reference][6]
* [Main config][7]
* [AWS][0]
* [GCP][1]
* [Azure][2]
@@ -24,18 +24,14 @@ metadata:
namespace: heptio-ark
name: default
persistentVolumeProvider:
aws:
region: minio
availabilityZone: minio
s3ForcePathStyle: true
s3Url: http://minio:9000
name: aws
config:
region: us-west-2
backupStorageProvider:
name: aws
bucket: ark
aws:
region: minio
availabilityZone: minio
s3ForcePathStyle: true
s3Url: http://minio:9000
config:
region: us-west-2
backupSyncPeriod: 60m
gcSyncPeriod: 60m
scheduleSyncPeriod: 1m
@@ -50,48 +46,66 @@ The configurable parameters are as follows:
| Key | Type | Default | Meaning |
| --- | --- | --- | --- |
| `persistentVolumeProvider` | CloudProviderConfig<br><br>(Supported key values are `aws`, `gcp`, and `azure`, but only one can be present. See the corresponding [AWS][0], [GCP][1], and [Azure][2]-specific configs.) | Required Field | The specification for whichever cloud provider the cluster is using for persistent volumes (to be snapshotted).<br><br> *NOTE*: For Azure, your Kubernetes cluster needs to be version 1.7.2+ in order to support PV snapshotting of its managed disks. |
| `backupStorageProvider`/(inline) | CloudProviderConfig<br><br>(Supported key values are `aws`, `gcp`, and `azure`, but only one can be present. See the corresponding [AWS][0], [GCP][1], and [Azure][2]-specific configs.) | Required Field | The specification for whichever cloud provider will be used to actually store the backups. |
| `persistentVolumeProvider` | CloudProviderConfig | None (Optional) | The specification for whichever cloud provider the cluster is using for persistent volumes (to be snapshotted), if any.<br><br>If not specified, Backups and Restores requesting PV snapshots & restores, respectively, are considered invalid. <br><br> *NOTE*: For Azure, your Kubernetes cluster needs to be version 1.7.2+ in order to support PV snapshotting of its managed disks. |
| `persistentVolumeProvider/name` | String<br><br>(Ark natively supports `aws`, `gcp`, and `azure`. Other providers may be available via external plugins.) | None (Optional) | The name of the cloud provider the cluster is using for persistent volumes, if any. |
| `persistentVolumeProvider/config` | map[string]string<br><br>(See the corresponding [AWS][0], [GCP][1], and [Azure][2]-specific configs or your provider's documentation.) | None (Optional) | Configuration keys/values to be passed to the cloud provider for persistent volumes. |
| `backupStorageProvider` | CloudProviderConfig | Required Field | The specification for whichever cloud provider will be used to actually store the backups. |
| `backupStorageProvider/name` | String<br><br>(Ark natively supports `aws`, `gcp`, and `azure`. Other providers may be available via external plugins.) | Required Field | The name of the cloud provider that will be used to actually store the backups. |
| `backupStorageProvider/bucket` | String | Required Field | The storage bucket where backups are to be uploaded. |
| `backupStorageProvider/config` | map[string]string<br><br>(See the corresponding [AWS][0], [GCP][1], and [Azure][2]-specific configs or your provider's documentation.) | None (Optional) | Configuration keys/values to be passed to the cloud provider for backup storage. |
| `backupSyncPeriod` | metav1.Duration | 60m0s | How frequently Ark queries the object storage to make sure that the appropriate Backup resources have been created for existing backup files. |
| `gcSyncPeriod` | metav1.Duration | 60m0s | How frequently Ark queries the object storage to delete backup files that have passed their TTL. |
| `scheduleSyncPeriod` | metav1.Duration | 1m0s | How frequently Ark checks its Schedule resource objects to see if a backup needs to be initiated. |
| `resourcePriorities` | []string | `[namespaces, persistentvolumes, persistentvolumeclaims, secrets, configmaps]` | An ordered list that describes the order in which Kubernetes resource objects should be restored (also specified with the `<RESOURCE>.<GROUP>` format.<br><br>If a resource is not in this list, it is restored after all other prioritized resources. |
| `resourcePriorities` | []string | `[namespaces, persistentvolumes, persistentvolumeclaims, secrets, configmaps, serviceaccounts, limitranges]` | An ordered list that describes the order in which Kubernetes resource objects should be restored (also specified with the `<RESOURCE>.<GROUP>` format.<br><br>If a resource is not in this list, it is restored after all other prioritized resources. |
| `restoreOnlyMode` | bool | `false` | When RestoreOnly mode is on, functionality for backups, schedules, and expired backup deletion is *turned off*. Restores are made from existing backup files in object storage. |
### AWS
**(Or other S3-compatible storage)**
#### backupStorageProvider/config
| Key | Type | Default | Meaning |
| --- | --- | --- | --- |
| `region` | string | Empty | *Example*: "us-east-1"<br><br>See [AWS documentation][3] for the full list.<br><br>Queried from the AWS S3 API if not provided. |
| `s3ForcePathStyle` | bool | `false` | Set this to `true` if you are using a local storage service like Minio. |
| `s3Url` | string | Required field for non-AWS-hosted storage| *Example*: http://minio:9000<br><br>You can specify the AWS S3 URL here for explicitness, but Ark can already generate it from `region`, and `bucket`. This field is primarily for local storage services like Minio.|
| `kmsKeyId` | string | Empty | *Example*: "502b409c-4da1-419f-a16e-eif453b3i49f" or "alias/`<KMS-Key-Alias-Name>`"<br><br>Specify an [AWS KMS key][10] id or alias to enable encryption of the backups stored in S3. Only works with AWS S3 and may require explicitly granting key usage rights.|
#### persistentVolumeProvider/config (AWS Only)
| Key | Type | Default | Meaning |
| --- | --- | --- | --- |
| `region` | string | Required Field | *Example*: "us-east-1"<br><br>See [AWS documentation][3] for the full list. |
| `availabilityZone` | string | Required Field | *Example*: "us-east-1a"<br><br>See [AWS documentation][4] for details. |
| `disableSSL` | bool | `false` | Set this to `true` if you are using Minio (or another local, S3-compatible storage service) and your deployment is not secured. |
| `s3ForcePathStyle` | bool | `false` | Set this to `true` if you are using a local storage service like Minio. |
| `s3Url` | string | Required field for non-AWS-hosted storage| *Example*: http://minio:9000<br><br>You can specify the AWS S3 URL here for explicitness, but Ark can already generate it from `region`, `availabilityZone`, and `bucket`. This field is primarily for local sotrage services like Minio.|
### GCP
| Key | Type | Default | Meaning |
| --- | --- | --- | --- |
| `project` | string | Required Field | *Example*: "project-example-3jsn23"<br><br> See the [Project ID documentation][5] for details. |
| `zone` | string | Required Field | *Example*: "us-central1-a"<br><br>See [GCP documentation][6] for the full list. |
#### backupStorageProvider/config
No parameters required.
#### persistentVolumeProvider/config
No parameters required.
### Azure
#### backupStorageProvider/config
No parameters required.
#### persistentVolumeProvider/config
| Key | Type | Default | Meaning |
| --- | --- | --- | --- |
| `location` | string | Required Field | *Example*: "Canada East"<br><br>See [the list of available locations][7] (note that this particular page refers to them as "Regions"). |
| `apiTimeout` | metav1.Duration | 1m0s | How long to wait for an API Azure request to complete before timeout. |
| `apiTimeout` | metav1.Duration | 2m0s | How long to wait for an Azure API request to complete before timeout. |
[0]: #aws
[1]: #gcp
[2]: #azure
[3]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-available-regions
[4]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-availability-zones
[5]: https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects
[6]: https://cloud.google.com/compute/docs/regions-zones/regions-zones
[7]: https://azure.microsoft.com/en-us/regions/
[8]: #parameter-reference
[9]: #main-config-parameters
[10]: #overview
[11]: #example
[6]: #parameter-reference
[7]: #main-config-parameters
[8]: #overview
[9]: #example
[10]: http://docs.aws.amazon.com/kms/latest/developerguide/overview.html

47
docs/debugging-deletes.md Normal file
View File

@@ -0,0 +1,47 @@
# Ark version 0.7.0 and later: issue with deleting namespaces and backups
Version 0.7.0 introduced the ability to delete backups. However, you may encounter an issue if you try to
delete the `heptio-ark` namespace. The namespace can get stuck in a terminating state, and you cannot delete your backups.
To fix:
1. If you don't have it, [install `jq`][0].
1. Run:
```bash
bash <(kubectl -n heptio-ark get backup -o json | jq -c -r $'.items[] | "kubectl -n heptio-ark patch backup/" + .metadata.name + " -p \'" + (({metadata: {finalizers: ( (.metadata.finalizers // []) - ["gc.ark.heptio.com"]), resourceVersion: .metadata.resourceVersion}}) | tostring) + "\' --type=merge"')
```
This command retrieves a list of backups, then generates and runs another list of commands that look like:
```
kubectl -n heptio-ark patch backup/my-backup -p '{"metadata":{"finalizers":[],"resourceVersion":"461343"}}' --type=merge
kubectl -n heptio-ark patch backup/some-other-backup -p '{"metadata":{"finalizers":[],"resourceVersion":"461718"}}' --type=merge
```
If you encounter errors that tell you patching backups is not allowed, the Ark
CustomResourceDefinitions (CRDs) might have been deleted. To fix, recreate the CRDs using
`examples/common/00-prereqs.yaml`, then follow the steps above.
## Mitigate the issue in Ark version 0.7.1 and later
In Ark version 0.7.1, the default configuration runs the Ark server in a different namespace from the namespace
for backups, schedules, restores, and the Ark config. We strongly recommend that you keep this configuration.
This approach can help prevent issues with deletes.
## For the curious: why the error occurs
The Ark team added the ability to delete backups by adding a **finalizer** to each
backup. When you request the deletion of an object that has at least one finalizer, Kubernetes sets
the object's deletion timestamp, which indicates that the object is marked for deletion. However, it does
not immediately delete the object. Instead, the object is deleted only when it no longer has
any finalizers. This means that something -- in this case, Ark -- must process the backup and then
remove the Ark finalizer from it.
Ark versions earlier than v0.7.1 place the Ark server pod in the same namespace as backups, restores,
schedules, and the Ark config. If you try to delete the namespace, with `kubectl delete
namespace/heptio-ark`, the Ark server pod might be deleted before the backups, because
the order of deletions is arbitrary. If this happens, the remaining bacukps are stuck in a
deleting state, because the Ark server pod no longer exists to remove their finalizers.
[0]: https://stedolan.github.io/jq/

59
docs/debugging-install.md Normal file
View File

@@ -0,0 +1,59 @@
# Debugging Installation Issues
## General
### `invalid configuration: no configuration has been provided`
This typically means that no `kubeconfig` file can be found for the Ark client to use. Ark looks for a kubeconfig in the
following locations:
* the path specified by the `--kubeconfig` flag, if any
* the path specified by the `$KUBECONFIG` environment variable, if any
* `~/.kube/config`
### Backups or restores stuck in `New` phase
This means that the Ark controllers are not processing the backups/restores, which usually happens because the Ark server is not running. Check the pod description and logs for errors:
```
kubectl -n heptio-ark describe pods
kubectl -n heptio-ark logs deployment/ark
```
## AWS
### `NoCredentialProviders: no valid providers in chain`
This means that the secret containing the AWS IAM user credentials for Ark has not been created/mounted properly
into the Ark server pod. Ensure the following:
* The `cloud-credentials` secret exists in the Ark server's namespace
* The `cloud-credentials` secret has a single key, `cloud`, whose value is the contents of the `credentials-ark` file
* The `credentials-ark` file is formatted properly and has the correct values:
```
[default]
aws_access_key_id=<your AWS access key ID>
aws_secret_access_key=<your AWS secret access key>
```
* The `cloud-credentials` secret is defined as a volume for the Ark deployment
* The `cloud-credentials` secret is being mounted into the Ark server pod at `/credentials`
## Azure
### `Failed to refresh the Token` or `adal: Refresh request failed`
This means that the secrets containing the Azure service principal credentials for Ark has not been created/mounted
properly into the Ark server pod. Ensure the following:
* The `cloud-credentials` secret exists in the Ark server's namespace
* The `cloud-credentials` secret has seven keys and each one has the correct value (see [setup instructions](0))
* The `cloud-credentials` secret is defined as a volume for the Ark deployment
* The `cloud-credentials` secret is being mounted into the Ark server pod at `/credentials`
## GCE/GKE
### `open credentials/cloud: no such file or directory`
This means that the secret containing the GCE service account credentials for Ark has not been created/mounted properly
into the Ark server pod. Ensure the following:
* The `cloud-credentials` secret exists in the Ark server's namespace
* The `cloud-credentials` secret has a single key, `cloud`, whose value is the contents of the `credentials-ark` file
* The `cloud-credentials` secret is defined as a volume for the Ark deployment
* The `cloud-credentials` secret is being mounted into the Ark server pod at `/credentials`
[0]: azure-config#credentials-and-configuration

View File

@@ -15,37 +15,89 @@ backup-test-2-20170726180514 backup-test-2 Completed 0 0 2
backup-test-2-20170726180515 backup-test-2 Completed 0 1 2017-07-26 13:32:59 -0400 EDT <none>
```
To delve into the warnings and errors into more detail, you can use the `-o` option:
To delve into the warnings and errors into more detail, you can use `ark restore describe`:
```
kubectl restore get backup-test-20170726180512 -o yaml
ark restore describe backup-test-20170726180512
```
The output YAML has a `status` field which may look like the following:
The output looks like this:
```
status:
errors:
ark: null
cluster: null
namespaces: null
phase: Completed
validationErrors: null
warnings:
ark: null
cluster: null
namespaces:
cm1:
- secrets "default-token-t0slk" already exists
Name: backup-test-20170726180512
Namespace: heptio-ark
Labels: <none>
Annotations: <none>
Backup: backup-test
Namespaces:
Included: *
Excluded: <none>
Resources:
Included: serviceaccounts
Excluded: nodes, events, events.events.k8s.io
Cluster-scoped: auto
Namespace mappings: <none>
Label selector: <none>
Restore PVs: auto
Phase: Completed
Validation errors: <none>
Warnings:
Ark: <none>
Cluster: <none>
Namespaces:
heptio-ark: serviceaccounts "ark" already exists
serviceaccounts "default" already exists
kube-public: serviceaccounts "default" already exists
kube-system: serviceaccounts "attachdetach-controller" already exists
serviceaccounts "certificate-controller" already exists
serviceaccounts "cronjob-controller" already exists
serviceaccounts "daemon-set-controller" already exists
serviceaccounts "default" already exists
serviceaccounts "deployment-controller" already exists
serviceaccounts "disruption-controller" already exists
serviceaccounts "endpoint-controller" already exists
serviceaccounts "generic-garbage-collector" already exists
serviceaccounts "horizontal-pod-autoscaler" already exists
serviceaccounts "job-controller" already exists
serviceaccounts "kube-dns" already exists
serviceaccounts "namespace-controller" already exists
serviceaccounts "node-controller" already exists
serviceaccounts "persistent-volume-binder" already exists
serviceaccounts "pod-garbage-collector" already exists
serviceaccounts "replicaset-controller" already exists
serviceaccounts "replication-controller" already exists
serviceaccounts "resourcequota-controller" already exists
serviceaccounts "service-account-controller" already exists
serviceaccounts "service-controller" already exists
serviceaccounts "statefulset-controller" already exists
serviceaccounts "ttl-controller" already exists
default: serviceaccounts "default" already exists
Errors:
Ark: <none>
Cluster: <none>
Namespaces: <none>
```
## Structure
The `status` field in a Restore's YAML has subfields for `errors` and `warnings`. `errors` appear for incomplete or partial restores. `warnings` appear for non-blocking issues (e.g. the restore looks "normal" and all resources referenced in the backup exist in some form, although some of them may have been pre-existing).
Both `errors` and `warnings` are structured in the same way:
Errors appear for incomplete or partial restores. Warnings appear for non-blocking issues (e.g. the
restore looks "normal" and all resources referenced in the backup exist in some form, although some
of them may have been pre-existing).
* `ark`: A list of system-related issues encountered by the Ark server (e.g. couldn't read directory).
Both errors and warnings are structured in the same way:
* `cluster`: A list of issues related to the restore of cluster-scoped resources.
* `Ark`: A list of system-related issues encountered by the Ark server (e.g. couldn't read directory).
* `namespaces`: A map of namespaces to the list of issues related to the restore of their respective resources.
* `Cluster`: A list of issues related to the restore of cluster-scoped resources.
* `Namespaces`: A map of namespaces to the list of issues related to the restore of their respective resources.
[0]: #example
[1]: #structure

9
docs/extend.md Normal file
View File

@@ -0,0 +1,9 @@
# Extend Ark
Ark includes mechanisms for extending the core functionality to meet your individual backup/restore needs:
* [Hooks][27] allow you to specify commands to be executed within running pods during a backup. This is useful if you need to run a workload-specific command prior to taking a backup (for example, to flush disk buffers or to freeze a database).
* [Plugins][28] allow you to develop custom object/block storage back-ends or per-item backup/restore actions that can execute arbitrary logic, including modifying the items being backed up/restored. Plugins can be used by Ark without needing to be compiled into the core Ark binary.
[27]: hooks.md
[28]: plugins.md

38
docs/faq.md Normal file
View File

@@ -0,0 +1,38 @@
# FAQ
## When is it appropriate to use Ark instead of etcd's built in backup/restore?
Etcd's backup/restore tooling is good for recovering from data loss in a single etcd cluster. For
example, it is a good idea to take a backup of etcd prior to upgrading etcd itself. For more
sophisticated management of your Kubernetes cluster backups and restores, we feel that Ark is
generally a better approach. It gives you the ability to throw away an unstable cluster and restore
your Kubernetes resources and data into a new cluster, which you can't do easily just by backing up
and restoring etcd.
Examples of cases where Ark is useful:
* you don't have access to etcd (e.g. you're running on GKE)
* backing up both Kubernetes resources and persistent volume state
* cluster migrations
* backing up a subset of your Kubernetes resources
* backing up Kubernetes resources that are stored across multiple etcd clusters (for example if you
run a custom apiserver)
## Will Ark restore my Kubernetes resources exactly the way they were before?
Yes, with some exceptions. For example, when Ark restores pods it deletes the `nodeName` from the
pod so that it can be scheduled onto a new node. You can see some more examples of the differences
in [pod_action.go](https://github.com/heptio/ark/blob/master/pkg/restore/pod_action.go)
## I'm using Ark in multiple clusters. Should I use the same bucket to store all of my backups?
We **strongly** recommend that you use a separate bucket per cluster to store backups. Sharing a bucket
across multiple Ark instances can lead to numerous problems - failed backups, overwritten backups,
inadvertently deleted backups, etc., all of which can be avoided by using a separate bucket per Ark
instance.
Related to this, if you need to restore a backup from cluster A into cluster B, please use [restore-only][1]
mode in cluster B's Ark instance while it's configured to use cluster A's bucket. This will ensure no
new backups are created, and no existing backups are deleted or overwritten.
[1]: config-definition.md#main-config-parameters

122
docs/gcp-config.md Normal file
View File

@@ -0,0 +1,122 @@
# Run Ark on GCP
You can run Kubernetes on Google Cloud Platform in either of:
* Kubernetes on Google Compute Engine virtual machines
* Google Kubernetes Engine
If you do not have the `gcloud` and `gsutil` CLIs locally installed, follow the [user guide][16] to set them up.
## Create GCS bucket
Heptio Ark requires an object storage bucket in which to store backups. Create a GCS bucket, replacing placeholder appropriately:
```bash
gsutil mb gs://<YOUR_BUCKET>/
```
## Create service account
To integrate Heptio Ark with GCP, create an Ark-specific [Service Account][15]:
1. View your current config settings:
```bash
gcloud config list
```
Store the `project` value from the results in the environment variable `$PROJECT_ID`.
2. Create a service account:
```bash
gcloud iam service-accounts create heptio-ark \
--display-name "Heptio Ark service account"
```
Then list all accounts and find the `heptio-ark` account you just created:
```bash
gcloud iam service-accounts list
```
Set the `$SERVICE_ACCOUNT_EMAIL` variable to match its `email` value.
3. Attach policies to give `heptio-ark` the necessary permissions to function:
```bash
BUCKET=<YOUR_BUCKET>
ROLE_PERMISSIONS=(
compute.disks.get
compute.disks.create
compute.disks.createSnapshot
compute.snapshots.get
compute.snapshots.create
compute.snapshots.useReadOnly
compute.snapshots.delete
compute.projects.get
)
gcloud iam roles create heptio_ark.server \
--project $PROJECT_ID \
--title "Heptio Ark Server" \
--permissions "$(IFS=","; echo "${ROLE_PERMISSIONS[*]}")"
gcloud projects add-iam-policy-binding $PROJECT_ID \
--member serviceAccount:$SERVICE_ACCOUNT_EMAIL \
--role projects/$PROJECT_ID/roles/heptio_ark.server
gsutil iam ch serviceAccount:$SERVICE_ACCOUNT_EMAIL:objectAdmin gs://${BUCKET}
```
4. Create a service account key, specifying an output file (`credentials-ark`) in your local directory:
```bash
gcloud iam service-accounts keys create credentials-ark \
--iam-account $SERVICE_ACCOUNT_EMAIL
```
## Credentials and configuration
If you run Google Kubernetes Engine (GKE), make sure that your current IAM user is a cluster-admin. This role is required to create RBAC objects.
See [the GKE documentation][22] for more information.
In the Ark root directory, run the following to first set up namespaces, RBAC, and other scaffolding. To run in a custom namespace, make sure that you have edited the YAML files to specify the namespace. See [Run in custom namespace][0].
```bash
kubectl apply -f examples/common/00-prereqs.yaml
```
Create a Secret. In the directory of the credentials file you just created, run:
```bash
kubectl create secret generic cloud-credentials \
--namespace <ARK_NAMESPACE> \
--from-file cloud=credentials-ark
```
Specify the following values in the example files:
* In file `examples/gcp/00-ark-config.yaml`:
* Replace `<YOUR_BUCKET>`. See the [Config definition][7] for details.
* (Optional) If you run the nginx example, in file `examples/nginx-app/with-pv.yaml`:
* Replace `<YOUR_STORAGE_CLASS_NAME>` with `standard`. This is GCP's default `StorageClass` name.
## Start the server
In the root of your Ark directory, run:
```bash
kubectl apply -f examples/gcp/00-ark-config.yaml
kubectl apply -f examples/gcp/10-deployment.yaml
```
[0]: namespace.md
[7]: config-definition.md#gcp
[15]: https://cloud.google.com/compute/docs/access/service-accounts
[16]: https://cloud.google.com/sdk/docs/
[22]: https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control#prerequisites_for_using_role-based_access_control

View File

@@ -1,5 +1,5 @@
/*
Copyright 2017 Heptio Inc.
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.
@@ -18,17 +18,17 @@ package main
import (
"log"
"os"
"os"
"github.com/spf13/cobra/doc"
"github.com/heptio/ark/pkg/cmd/ark"
"github.com/spf13/cobra/doc"
)
func main() {
cmdName := os.Args[1]
cmdName := os.Args[1]
outputDir := os.Args[2]
cmd := ark.NewCommand(cmdName)
cmd := ark.NewCommand(cmdName)
// Remove auto-generated timestamps
cmd.DisableAutoGenTag = true

54
docs/hooks.md Normal file
View File

@@ -0,0 +1,54 @@
# Hooks
Heptio Ark currently supports executing commands in containers in pods during a backup.
## Backup Hooks
When performing a backup, you can specify one or more commands to execute in a container in a pod
when that pod is being backed up.
Ark versions prior to v0.7.0 only support hooks that execute prior to any custom action processing
("pre" hooks).
As of version v0.7.0, Ark also supports "post" hooks - these execute after all custom actions have
completed, as well as after all the additional items specified by custom actions have been backed
up.
An example of when you might use both pre and post hooks is freezing a file system. If you want to
ensure that all pending disk I/O operations have completed prior to taking a snapshot, you could use
a pre hook to run `fsfreeze --freeze`. Next, Ark would take a snapshot of the disk. Finally, you
could use a post hook to run `fsfreeze --unfreeze`.
There are two ways to specify hooks: annotations on the pod itself, and in the Backup spec.
### Specifying Hooks As Pod Annotations
You can use the following annotations on a pod to make Ark execute a hook when backing up the pod:
#### Pre hooks
| Annotation Name | Description |
| --- | --- |
| `pre.hook.backup.ark.heptio.com/container` | The container where the command should be executed. Defaults to the first container in the pod. Optional. |
| `pre.hook.backup.ark.heptio.com/command` | The command to execute. If you need multiple arguments, specify the command as a JSON array, such as `["/usr/bin/uname", "-a"]` |
| `pre.hook.backup.ark.heptio.com/on-error` | What to do if the command returns a non-zero exit code. Defaults to Fail. Valid values are Fail and Continue. Optional. |
| `pre.hook.backup.ark.heptio.com/timeout` | How long to wait for the command to execute. The hook is considered in error if the command exceeds the timeout. Defaults to 30s. Optional. |
Ark v0.7.0+ continues to support the original (deprecated) way to specify pre hooks - without the
`pre.` prefix in the annotation names (e.g. `hook.backup.ark.heptio.com/container`).
#### Post hooks (v0.7.0+)
| Annotation Name | Description |
| --- | --- |
| `post.hook.backup.ark.heptio.com/container` | The container where the command should be executed. Defaults to the first container in the pod. Optional. |
| `post.hook.backup.ark.heptio.com/command` | The command to execute. If you need multiple arguments, specify the command as a JSON array, such as `["/usr/bin/uname", "-a"]` |
| `post.hook.backup.ark.heptio.com/on-error` | What to do if the command returns a non-zero exit code. Defaults to Fail. Valid values are Fail and Continue. Optional. |
| `post.hook.backup.ark.heptio.com/timeout` | How long to wait for the command to execute. The hook is considered in error if the command exceeds the timeout. Defaults to 30s. Optional. |
### Specifying Hooks in the Backup Spec
Please see the documentation on the [Backup API Type][1] for how to specify hooks in the Backup
spec.
[1]: api-types/backup.md

82
docs/ibm-config.md Normal file
View File

@@ -0,0 +1,82 @@
# Use IBM Cloud Object Storage as Ark's storage destination.
You can deploy Ark on IBM [Public][5] or [Private][4] clouds, or even on any other Kubernetes cluster, but anyway you can use IBM Cloud Object Store as a destination for Ark's backups.
To set up IBM Cloud Object Storage (COS) as Ark's destination, you:
* Create your COS instance
* Create an S3 bucket
* Define a service that can store data in the bucket
* Configure and start the Ark server
## Create COS instance
If you dont have a COS instance, you can create a new one, according to the detailed instructions in [Creating a new resource instance][1].
## Create an S3 bucket
Heptio Ark requires an object storage bucket to store backups in. See instructions in [Create some buckets to store your data][2].
## Define a service that can store data in the bucket.
The process of creating service credentials is described in [Service credentials][3].
Several comments:
1. The Ark service will write its backup into the bucket, so it requires the “Writer” access role.
2. Ark uses an AWS S3 compatible API. Which means it authenticates using a signature created from a pair of access and secret keysa set of HMAC credentials. You can create these HMAC credentials by specifying `{“HMAC”:true}` as an optional inline parameter. See step 3 in the [Service credentials][3] guide.
3. After successfully creating a Service credential, you can view the JSON definition of the credential. Under the `cos_hmac_keys` entry there are `access_key_id` and `secret_access_key`. We will use them in the next step.
4. Create an Ark-specific credentials file (`credentials-ark`) in your local directory:
```
[default]
aws_access_key_id=<ACCESS_KEY_ID>
aws_secret_access_key=<SECRET_ACCESS_KEY>
```
where the access key id and secret are the values that we got above.
## Credentials and configuration
In the Ark root directory, run the following to first set up namespaces, RBAC, and other scaffolding. To run in a custom namespace, make sure that you have edited the YAML files to specify the namespace. See [Run in custom namespace][0].
```bash
kubectl apply -f examples/common/00-prereqs.yaml
```
Create a Secret. In the directory of the credentials file you just created, run:
```bash
kubectl create secret generic cloud-credentials \
--namespace <ARK_NAMESPACE> \
--from-file cloud=credentials-ark
```
Specify the following values in the example files:
* In `examples/ibm/00-ark-config.yaml`:
* Replace `<YOUR_BUCKET>`, `<YOUR_REGION>` and `<YOUR_URL_ACCESS_POINT>`. See the [Config definition][6] for details.
* (Optional) If you run the nginx example, in file `examples/nginx-app/with-pv.yaml`:
* Replace `<YOUR_STORAGE_CLASS_NAME>` with your `StorageClass` name.
## Start the Ark server
In the root of your Ark directory, run:
```bash
kubectl apply -f examples/ibm/00-ark-config.yaml
kubectl apply -f examples/ibm/10-deployment.yaml
```
[0]: namespace.md
[1]: https://console.bluemix.net/docs/services/cloud-object-storage/basics/order-storage.html#creating-a-new-resource-instance
[2]: https://console.bluemix.net/docs/services/cloud-object-storage/getting-started.html#create-buckets
[3]: https://console.bluemix.net/docs/services/cloud-object-storage/iam/service-credentials.html#service-credentials
[4]: https://www.ibm.com/support/knowledgecenter/SSBS6K_2.1.0/kc_welcome_containers.html
[5]: https://console.bluemix.net/docs/containers/container_index.html#container_index
[6]: config-definition.md#aws
[14]: http://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html

21
docs/image-tagging.md Normal file
View File

@@ -0,0 +1,21 @@
# Image tagging policy
This document describes Ark's image tagging policy.
## Released versions
`gcr.io/heptio-images/ark:<SemVer>`
Ark follows the [Semantic Versioning](http://semver.org/) standard for releases. Each tag in the `github.com/heptio/ark` repository has a matching image, e.g. `gcr.io/heptio-images/ark:v0.8.0`.
### Latest
`gcr.io/heptio-images/ark:latest`
The `latest` tag follows the most recently released version of Ark.
## Development
`gcr.io/heptio-images/ark:master`
The `master` tag follows the latest commit to land on the `master` branch.

68
docs/namespace.md Normal file
View File

@@ -0,0 +1,68 @@
# Run in custom namespace
In Ark version 0.7.0 and later, you can run Ark in any namespace. To do so, you specify the
namespace in the YAML files that configure the Ark server. You then also specify the namespace when
you run Ark client commands.
## Edit the example files
The Ark repository includes [a set of examples][0] that you can use to set up your Ark server. The
examples place the server and backup/schedule/restore/config data in the `heptio-ark` namespace.
To run the server in another namespace, you edit the relevant files, changing `heptio-ark` to
your desired namespace.
To store your backups, schedules, restores, and config in another namespace, you edit the relevant
files, changing `heptio-ark` to your desired namespace. You also need to create the
`cloud-credentials` secret in your desired namespace.
For all cloud providers, edit `https://github.com/heptio/ark/blob/master/examples/common/00-prereqs.yaml`. This file defines:
* CustomResourceDefinitions for the Ark objects (backups, schedules, restores, configs, downloadrequests)
* The namespace where the Ark server runs
* The namespace where backups, schedules, restores, and the config are stored
* The Ark service account
* The RBAC rules to grant permissions to the Ark service account
### AWS
For AWS, edit:
* `https://github.com/heptio/ark/blob/master/examples/aws/10-deployment.yaml`
* `https://github.com/heptio/ark/blob/master/examples/aws/00-ark-config.yaml`
### GCP
For GCP, edit:
* `https://github.com/heptio/ark/blob/master/examples/gcp/10-deployment.yaml`
* `https://github.com/heptio/ark/blob/master/examples/gcp/00-ark-config.yaml`
### Azure
For Azure, edit:
* `https://github.com/heptio/ark/blob/master/examples/azure/00-ark-deployment.yaml`
* `https://github.com/heptio/ark/blob/master/examples/azure/10-ark-config.yaml`
### IBM
For IBM, edit:
* `https://github.com/heptio/ark/blob/master/examples/ibm/10-deployment.yaml`
* `https://github.com/heptio/ark/blob/master/examples/ibm/00-ark-config.yaml`
## Specify the namespace in client commands
To specify the namespace for all Ark client commands, run:
```
ark client config set namespace=<NAMESPACE_VALUE>
```
[0]: https://github.com/heptio/ark/tree/master/examples

View File

@@ -2,9 +2,9 @@
A backup is a gzip-compressed tar file whose name matches the Backup API resource's `metadata.name` (what is specified during `ark backup create <NAME>`).
In cloud object storage, *each backup file is stored in its own subdirectory* beneath the bucket specified in the Ark server configuration. This subdirectory includes an additional file called `ark-backup.json`. The JSON file explicitly lists all info about your associated Backup resource--including any default values used--so that you have a complete historical record of its configuration. It also specifies `status.version`, which corresponds to the output file format.
In cloud object storage, each backup file is stored in its own subdirectory in the bucket specified in the Ark server configuration. This subdirectory includes an additional file called `ark-backup.json`. The JSON file lists all information about your associated Backup resource, including any default values. This gives you a complete historical record of the backup configuration. The JSON file also specifies `status.version`, which corresponds to the output file format.
All together, the directory structure in your cloud storage may look like:
The directory structure in your cloud storage looks something like:
```
rootBucket/
@@ -13,8 +13,8 @@ rootBucket/
backup1234.tar.gz
```
## `ark-backup.json`
An example of this file looks like the following:
## Example backup JSON file
```
{
"kind": "Backup",
@@ -62,26 +62,38 @@ Note that this file includes detailed info about your volume snapshots in the `s
When unzipped, a typical backup directory (e.g. `backup1234.tar.gz`) looks like the following:
```
cluster/
resources/
persistentvolumes/
pv01.json
...
namespaces/
namespace1/
configmaps/
myconfigmap.json
cluster/
pv01.json
...
pods
mypod.json
...
jobs
awesome-job.json
...
deployments
cool-deployment.json
...
...
namespace2/
...
configmaps/
namespaces/
namespace1/
myconfigmap.json
...
namespace2/
...
pods/
namespaces/
namespace1/
mypod.json
...
namespace2/
...
jobs/
namespaces/
namespace1/
awesome-job.json
...
namespace2/
...
deployments/
namespaces/
namespace1/
cool-deployment.json
...
namespace2/
...
...
```

35
docs/plugins.md Normal file
View File

@@ -0,0 +1,35 @@
# Plugins
Heptio Ark has a plugin architecture that allows users to add their own custom functionality to Ark backups & restores
without having to modify/recompile the core Ark binary. To add custom functionality, users simply create their own binary
containing an implementation of one of Ark's plugin kinds (described below), plus a small amount of boilerplate code to
expose the plugin implementation to Ark. This binary is added to a container image that serves as an init container for
the Ark server pod and copies the binary into a shared emptyDir volume for the Ark server to access.
A fully-functional [sample plugin repository][1] is provided to serve as a convenient starting point for plugin authors.
## Plugin Kinds
Ark currently supports the following kinds of plugins:
- **Object Store** - persists and retrieves backups, backup logs and restore logs
- **Block Store** - creates volume snapshots (during backup) and restores volumes from snapshots (during restore)
- **Backup Item Action** - executes arbitrary logic for individual items prior to storing them in a backup file
- **Restore Item Action** - executes arbitrary logic for individual items prior to restoring them into a cluster
## Plugin Naming
Ark relies on a naming convention to identify plugins. Each plugin binary should be named `ark-<plugin-kind>-<name>`,
where `plugin-kind` is one of `objectstore`, `blockstore`, `backupitemaction`, or `restoreitemaction`, and `name` is
unique within the plugin kind.
## Plugin Logging
Ark provides a [logger][2] that can be used by plugins to log structured information to the main Ark server log or
per-backup/restore logs. See the [sample repository][1] for an example of how to instantiate and use the logger
within your plugin.
[1]: https://github.com/heptio/ark-plugin-example
[2]: https://github.com/heptio/ark/blob/master/pkg/plugin/logger.go

149
docs/quickstart.md Normal file
View File

@@ -0,0 +1,149 @@
## 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
[Download the client][26].
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
```
Alternatively if you want to backup all objects *except* those matching the label `backup=ignore`:
```
ark backup create nginx-backup --selector 'backup notin (ignore)'
```
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` namespace 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
```
[3]: /docs/cloud-common.md
[18]: /docs/debugging-restores.md
[26]: https://github.com/heptio/ark/releases

267
docs/restic.md Normal file
View File

@@ -0,0 +1,267 @@
# Restic Integration
As of version 0.9.0, Ark has support for backing up and restoring Kubernetes volumes using a free open-source backup tool called
[restic][1].
Ark has always allowed you to take snapshots of persistent volumes as part of your backups if youre using one of
the supported cloud providers block storage offerings (Amazon EBS Volumes, Azure Managed Disks, Google Persistent Disks).
Starting with version 0.6.0, we provide a plugin model that enables anyone to implement additional object and block storage
backends, outside the main Ark repository.
We integrated restic with Ark so that users have an out-of-the-box solution for backing up and restoring almost any type of Kubernetes
volume*. This is a new capability for Ark, not a replacement for existing functionality. If you're running on AWS, and
taking EBS snapshots as part of your regular Ark backups, there's no need to switch to using restic. However, if you've
been waiting for a snapshot plugin for your storage platform, or if you're using EFS, AzureFile, NFS, emptyDir,
local, or any other volume type that doesn't have a native snapshot concept, restic might be for you.
Restic is not tied to a specific storage platform, which means that this integration also paves the way for future work to enable
cross-volume-type data migrations. Stay tuned as this evolves!
\* hostPath volumes are not supported, but the [new local volume type][4] is supported.
## Setup
### Prerequisites
- A working install of Ark version 0.9.0 or later. See [Set up Ark][2]
- A local clone of [the latest release tag of the Ark repository][3]
#### Additional steps if upgrading from version 0.9 alpha
- Manually delete all of the repositories/data from your existing restic bucket
- Delete all Ark backups from your cluster using `ark backup delete`
- Delete all secrets named `ark-restic-credentials` across all namespaces in your cluster
### Instructions
1. Download an updated Ark client from the [latest release][3], and move it to a location in your PATH.
1. From the Ark root directory, run the following to create new custom resource definitions:
```bash
kubectl apply -f examples/common/00-prereqs.yaml
```
1. Run one of the following for your platform to create the daemonset:
- AWS: `kubectl apply -f examples/aws/20-restic-daemonset.yaml`
- Azure: `kubectl apply -f examples/azure/20-restic-daemonset.yaml`
- GCP: `kubectl apply -f examples/gcp/20-restic-daemonset.yaml`
- Minio: `kubectl apply -f examples/minio/30-restic-daemonset.yaml`
1. Create a new bucket for restic to store its data in, and give the `heptio-ark` IAM user access to it, similarly to
the main Ark bucket you've already set up. Note that this must be a different bucket than the main Ark bucket.
We plan to remove this limitation in a future release.
1. Uncomment `resticLocation` in your Ark config and set the value appropriately, then apply:
- AWS: `kubectl apply -f examples/aws/00-ark-config.yaml`
- Azure: `kubectl apply -f examples/azure/10-ark-config.yaml`
- GCP: `kubectl apply -f examples/gcp/00-ark-config.yaml`
- Minio: `kubectl apply -f examples/minio/10-ark-config.yaml`
Note that `resticLocation` may either be just a bucket name, e.g. `my-restic-bucket`, or a bucket name plus a prefix under
which you'd like the restic data to be stored, e.g. `my-restic-bucket/ark-repos`.
You're now ready to use Ark with restic.
## Back up
1. Run the following for each pod that contains a volume to back up:
```bash
kubectl -n YOUR_POD_NAMESPACE annotate pod/YOUR_POD_NAME backup.ark.heptio.com/backup-volumes=YOUR_VOLUME_NAME_1,YOUR_VOLUME_NAME_2,...
```
where the volume names are the names of the volumes in the pod spec.
For example, for the following pod:
```bash
apiVersion: v1
kind: Pod
metadata:
name: sample
namespace: foo
spec:
containers:
- image: k8s.gcr.io/test-webserver
name: test-webserver
volumeMounts:
- name: pvc-volume
mountPath: /volume-1
- name: emptydir-volume
mountPath: /volume-2
volumes:
- name: pvc-volume
persistentVolumeClaim:
claimName: test-volume-claim
- name: emptydir-volume
emptyDir: {}
```
You'd run:
```bash
kubectl -n foo annotate pod/sample backup.ark.heptio.com/backup-volumes=pvc-volume,emptydir-volume
```
This annotation can also be provided in a pod template spec if you use a controller to manage your pods.
1. Take an Ark backup:
```bash
ark backup create NAME OPTIONS...
```
1. When the backup completes, view information about the backups:
```bash
ark backup describe YOUR_BACKUP_NAME
kubectl -n heptio-ark get podvolumebackups -l ark.heptio.com/backup-name=YOUR_BACKUP_NAME -o yaml
```
## Restore
1. Restore from your Ark backup:
```bash
ark restore create --from-backup BACKUP_NAME OPTIONS...
```
1. When the restore completes, view information about your pod volume restores:
```bash
ark restore describe YOUR_RESTORE_NAME
kubectl -n heptio-ark get podvolumerestores -l ark.heptio.com/restore-name=YOUR_RESTORE_NAME -o yaml
```
## Limitations
- You cannot use the main Ark bucket for storing restic backups. We plan to address this issue
in a future release.
- `hostPath` volumes are not supported. [Local persistent volumes][4] are supported.
- Those of you familiar with [restic][1] may know that it encrypts all of its data. We've decided to use a static,
common encryption key for all restic repositories created by Ark. **This means that anyone who has access to your
bucket can decrypt your restic backup data**. Make sure that you limit access to the restic bucket
appropriately. We plan to implement full Ark backup encryption, including securing the restic encryption keys, in
a future release.
## Troubleshooting
Run the following checks:
Are your Ark server and daemonset pods running?
```bash
kubectl get pods -n heptio-ark
```
Does your restic repository exist, and is it ready?
```bash
ark restic repo get
ark restic repo get REPO_NAME -o yaml
```
Are there any errors in your Ark backup/restore?
```bash
ark backup describe BACKUP_NAME
ark backup logs BACKUP_NAME
ark restore describe RESTORE_NAME
ark restore logs RESTORE_NAME
```
What is the status of your pod volume backups/restores?
```bash
kubectl -n heptio-ark get podvolumebackups -l ark.heptio.com/backup-name=BACKUP_NAME -o yaml
kubectl -n heptio-ark get podvolumerestores -l ark.heptio.com/restore-name=RESTORE_NAME -o yaml
```
Is there any useful information in the Ark server or daemon pod logs?
```bash
kubectl -n heptio-ark logs deploy/ark
kubectl -n heptio-ark logs DAEMON_POD_NAME
```
**NOTE**: You can increase the verbosity of the pod logs by adding `--log-level=debug` as an argument
to the container command in the deployment/daemonset pod template spec.
## How backup and restore work with restic
We introduced three custom resource definitions and associated controllers:
- `ResticRepository` - represents/manages the lifecycle of Ark's [restic repositories][5]. Ark creates
a restic repository per namespace when the first restic backup for a namespace is requested. The controller
for this custom resource executes restic repository lifecycle commands -- `restic init`, `restic check`,
and `restic prune`.
You can see information about your Ark restic repositories by running `ark restic repo get`.
- `PodVolumeBackup` - represents a restic backup of a volume in a pod. The main Ark backup process creates
one or more of these when it finds an annotated pod. Each node in the cluster runs a controller for this
resource (in a daemonset) that handles the `PodVolumeBackups` for pods on that node. The controller executes
`restic backup` commands to backup pod volume data.
- `PodVolumeRestore` - represents a restic restore of a pod volume. The main Ark restore process creates one
or more of these when it encounters a pod that has associated restic backups. Each node in the cluster runs a
controller for this resource (in the same daemonset as above) that handles the `PodVolumeRestores` for pods
on that node. The controller executes `restic restore` commands to restore pod volume data.
### Backup
1. The main Ark backup process checks each pod that it's backing up for the annotation specifying a restic backup
should be taken (`backup.ark.heptio.com/backup-volumes`)
1. When found, Ark first ensures a restic repository exists for the pod's namespace, by:
- checking if a `ResticRepository` custom resource already exists
- if not, creating a new one, and waiting for the `ResticRepository` controller to init/check it
1. Ark then creates a `PodVolumeBackup` custom resource per volume listed in the pod annotation
1. The main Ark process now waits for the `PodVolumeBackup` resources to complete or fail
1. Meanwhile, each `PodVolumeBackup` is handled by the controller on the appropriate node, which:
- has a hostPath volume mount of `/var/lib/kubelet/pods` to access the pod volume data
- finds the pod volume's subdirectory within the above volume
- runs `restic backup`
- updates the status of the custom resource to `Completed` or `Failed`
1. As each `PodVolumeBackup` finishes, the main Ark process captures its restic snapshot ID and adds it as an annotation
to the copy of the pod JSON that's stored in the Ark backup. This will be used for restores, as seen in the next section.
### Restore
1. The main Ark restore process checks each pod that it's restoring for annotations specifying a restic backup
exists for a volume in the pod (`snapshot.ark.heptio.com/<volume-name>`)
1. When found, Ark first ensures a restic repository exists for the pod's namespace, by:
- checking if a `ResticRepository` custom resource already exists
- if not, creating a new one, and waiting for the `ResticRepository` controller to init/check it (note that
in this case, the actual repository should already exist in object storage, so the Ark controller will simply
check it for integrity)
1. Ark adds an init container to the pod, whose job is to wait for all restic restores for the pod to complete (more
on this shortly)
1. Ark creates the pod, with the added init container, by submitting it to the Kubernetes API
1. Ark creates a `PodVolumeRestore` custom resource for each volume to be restored in the pod
1. The main Ark process now waits for each `PodVolumeRestore` resource to complete or fail
1. Meanwhile, each `PodVolumeRestore` is handled by the controller on the appropriate node, which:
- has a hostPath volume mount of `/var/lib/kubelet/pods` to access the pod volume data
- waits for the pod to be running the init container
- finds the pod volume's subdirectory within the above volume
- runs `restic restore`
- on success, writes a file into the pod volume, in an `.ark` subdirectory, whose name is the UID of the Ark restore
that this pod volume restore is for
- updates the status of the custom resource to `Completed` or `Failed`
1. The init container that was added to the pod is running a process that waits until it finds a file
within each restored volume, under `.ark`, whose name is the UID of the Ark restore being run
1. Once all such files are found, the init container's process terminates successfully and the pod moves
on to running other init containers/the main containers.
[1]: https://github.com/restic/restic
[2]: cloud-common.md
[3]: https://github.com/heptio/ark/releases/
[4]: https://kubernetes.io/docs/concepts/storage/volumes/#local
[5]: http://restic.readthedocs.io/en/latest/100_references.html#terminology

15
docs/troubleshooting.md Normal file
View File

@@ -0,0 +1,15 @@
# Troubleshooting
These tips can help you troubleshoot known issues. If they don't help, you can [file an issue][4], or talk to us on the [Kubernetes Slack team][25] channel `#ark-dr`.
* [Debug installation/setup issues][2]
* [Delete namespaces and backups][0]
* [Debug restores][1]
[0]: debugging-deletes.md
[1]: debugging-restores.md
[2]: debugging-install.md
[4]: https://github.com/heptio/ark/issues
[25]: http://slack.kubernetes.io/

View File

@@ -23,7 +23,7 @@ If you periodically back up your cluster's resources, you are able to return to
4. Create a restore with your most recent Ark Backup:
```
ark restore create <SCHEDULE NAME>-<TIMESTAMP>
ark restore create --from-backup <SCHEDULE NAME>-<TIMESTAMP>
```
## Cluster migration
@@ -35,20 +35,19 @@ Heptio Ark can help you port your resources from one cluster to another, as long
1. *(Cluster 1)* Assuming you haven't already been checkpointing your data with the Ark `schedule` operation, you need to first back up your entire cluster (replacing `<BACKUP-NAME>` as desired):
```
ark backup create <BACKUP-NAME> --snapshot-volumes
ark backup create <BACKUP-NAME>
```
The default TTL is 24 hours; you can use the `--ttl` flag to change this as necessary.
The default TTL is 30 days (720 hours); you can use the `--ttl` flag to change this as necessary.
2. *(Cluster 2)* Make sure that the `persistentVolumeProvider` and `backupStorageProvider` fields in the Ark Config match the ones from *Cluster 1*, so that your new Ark server instance is pointing to the same bucket.
3. *(Cluster 2)* Make sure that the Ark Backup object has been created. Ark resources are [synced][2] with the backup files available in cloud storage.
3. *(Cluster 2)* Make sure that the Ark Backup object has been created. Ark resources are synced with the backup files available in cloud storage.
4. *(Cluster 2)* Once you have confirmed that the right Backup (`<BACKUP-NAME>`) is now present, you can restore everything with:
```
ark restore create <BACKUP-NAME> --restore-volumes
ark restore create --from-backup <BACKUP-NAME>
```
[0]: #disaster-recovery
[1]: #cluster-migration
[2]: concepts.md#cloud-storage-sync
[3]: config-definition.md#main-config-parameters

View File

@@ -0,0 +1,18 @@
# Vendoring dependencies
## Overview
We are using [dep][0] to manage dependencies. You can install it by following [these
instructions][1].
## Adding a new dependency
Run `dep ensure`. If you want to see verbose output, you can append `-v` as in
`dep ensure -v`.
## Updating an existing dependency
Run `dep ensure -update <pkg> [<pkg> ...]` to update one or more dependencies.
[0]: https://github.com/golang/dep
[1]: https://golang.github.io/dep/docs/installation.html

View File

@@ -6,7 +6,7 @@ The YAML config files in this directory can be used to quickly deploy a containe
* `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.
* `aws/`, `azure/`, `gcp/`: Contains manifests specific to the given cloud provider's setup.
* `aws/`, `azure/`, `gcp/`, `ibm/`: Contains manifests specific to the given cloud provider's setup.
[0]: https://github.com/minio/minio
[1]: /README.md#quickstart

View File

@@ -1,4 +1,4 @@
# Copyright 2017 Heptio Inc.
# 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.
@@ -19,14 +19,20 @@ metadata:
namespace: heptio-ark
name: default
persistentVolumeProvider:
aws:
name: aws
config:
region: <YOUR_REGION>
availabilityZone: <YOUR_AVAILABILITY_ZONE>
backupStorageProvider:
name: aws
bucket: <YOUR_BUCKET>
aws:
# Uncomment the below line to enable restic integration.
# The format for resticLocation is <bucket>[/<prefix>],
# e.g. "my-restic-bucket" or "my-restic-bucket/repos".
# This MUST be a different bucket than the main Ark bucket
# specified just above.
# resticLocation: <YOUR_RESTIC_LOCATION>
config:
region: <YOUR_REGION>
availabilityZone: <YOUR_AVAILABILITY_ZONE>
backupSyncPeriod: 30m
gcSyncPeriod: 30m
scheduleSyncPeriod: 1m

View File

@@ -0,0 +1,50 @@
# 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>
prometheus.io/scrape: "true"
prometheus.io/port: "8085"
prometheus.io/path: "/metrics"
spec:
restartPolicy: Always
serviceAccountName: ark
containers:
- name: ark
image: gcr.io/heptio-images/ark:latest
ports:
- name: metrics
containerPort: 8085
command:
- /ark
args:
- server
volumeMounts:
- name: plugins
mountPath: /plugins
volumes:
- name: plugins
emptyDir: {}

View File

@@ -0,0 +1,60 @@
# 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
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "8085"
prometheus.io/path: "/metrics"
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
- name: scratch
mountPath: /scratch
env:
- name: AWS_SHARED_CREDENTIALS_FILE
value: /credentials/cloud
- name: ARK_SCRATCH_DIR
value: /scratch
volumes:
- name: cloud-credentials
secret:
secretName: cloud-credentials
- name: plugins
emptyDir: {}
- name: scratch
emptyDir: {}

View File

@@ -0,0 +1,69 @@
# 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/v1
kind: DaemonSet
metadata:
name: restic
namespace: heptio-ark
spec:
selector:
matchLabels:
name: restic
template:
metadata:
labels:
name: restic
spec:
serviceAccountName: ark
securityContext:
runAsUser: 0
volumes:
- name: cloud-credentials
secret:
secretName: cloud-credentials
- name: host-pods
hostPath:
path: /var/lib/kubelet/pods
- name: scratch
emptyDir: {}
containers:
- name: ark
image: gcr.io/heptio-images/ark:latest
command:
- /ark
args:
- restic
- server
volumeMounts:
- name: cloud-credentials
mountPath: /credentials
- name: host-pods
mountPath: /host_pods
mountPropagation: HostToContainer
- name: scratch
mountPath: /scratch
env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: HEPTIO_ARK_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: AWS_SHARED_CREDENTIALS_FILE
value: /credentials/cloud
- name: ARK_SCRATCH_DIR
value: /scratch

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