Andy Goldstein
aa9d96f3b7
Add pprof support to ark server
...
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-12-05 10:13:39 -05:00
Andy Goldstein
62d8c642d2
Remove default token from all service accounts
...
Instead of only removing the default token from a service account when
it already exists in the cluster, always remove it. If the service
account already exists, continue to do the merging logic.
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-12-04 11:41:18 -05:00
Andy Goldstein
d85872dfb2
Merge pull request #1069 from gliptak/patch-1
...
Update to go 1.11
2018-11-21 08:39:06 -05:00
Gábor Lipták
daf1a75515
Bring Go current in Travis
...
Signed-off-by: Gábor Lipták <gliptak@gmail.com>
2018-11-21 08:31:14 -05:00
Christian Beneke
90c5ed0850
Initialize empty schedule metrics on server init
...
When backups are run manually (outside of a schedule) the metrics
will be counted for ark_*{schedule=""}. To prevent partial NaN
metrics they will be initialised on server init.
Signed-off-by: Christian Beneke <c.beneke@syseleven.de>
2018-11-14 15:31:26 +01:00
Steve Kriss
2781e4e8de
Merge pull request #956 from ffd2subroutine/qps-burst-configurable
...
Added qps and burst to server's client
2018-11-09 12:41:41 -07:00
Darko Radisic
e5556fe608
Added qps and burst to server's client
...
Signed-off-by: Darko Radisic <ffd2subroutine@users.noreply.github.com>
2018-11-09 20:16:24 +01:00
Steve Kriss
b818cc2769
don't require a default provider VSL if there's only 1
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-26 12:45:40 -06:00
Andy Goldstein
bca585162f
Run 'make update' to update formatting
...
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-10-23 13:08:42 -04:00
Nolan Brubaker
6cf3519c3a
Merge pull request #974 from skriss/backup-describer
...
backup describer: show snapshot summary by default, details optionally
2018-10-23 12:58:54 -04:00
Nolan Brubaker
6591b5a09c
Merge pull request #975 from skriss/rm-pvproviderexists
...
remove pvProviderExists param from NewRestoreController
2018-10-23 12:58:17 -04:00
Steve Kriss
f3a57b5b8a
Merge pull request #971 from shubheksha/fix/594-restore-storageclasses-before-pv-pvc
...
Restore storageclasses before pvs and pvcs
2018-10-23 08:14:42 -06:00
Shubheksha Jalan
596eea1b8c
restore storageclasses before pvs and pvcs
...
Signed-off-by: Shubheksha Jalan <jshubheksha@gmail.com>
2018-10-22 21:15:08 +02:00
Steve Kriss
f014cab1fe
backup describer: show snapshot summary by default, details optionally
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-22 12:08:37 -06:00
Steve Kriss
8acc66d02f
remove pvProviderExists param from NewRestoreController
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-22 11:47:51 -06:00
Domenic Rosati
9952dfb0ad
Address #424 : Add CRDs to list of prioritized resources
...
Signed-off-by: Domenic Rosati <domenicrosati@gmail.com>
2018-10-18 22:42:37 -03:00
Steve Kriss
c36131a024
remove Config-related code
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-17 14:00:38 -06:00
Wayne Witzel III
406b50a71b
update restore process using snapshot locations
...
Signed-off-by: Wayne Witzel III <wayne@riotousliving.com>
2018-10-17 13:40:42 -06:00
Steve Kriss
4a03370f1d
update backup deletion controller for snapshot locations
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-17 13:40:42 -06:00
Steve Kriss
38c72b8cc2
include snapshot locations in created schedule's backup spec
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-17 13:40:41 -06:00
Steve Kriss
e24248e07a
add --volume-snapshot-locations flag to ark backup create
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-17 13:36:51 -06:00
Steve Kriss
df07b7dc9f
update backup code to work with volume snapshot locations
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-17 13:36:50 -06:00
Wayne Witzel III
4af89fa863
add unit test for getDefaultVolumeSnapshotLocations
...
Signed-off-by: Wayne Witzel III <wayne@riotousliving.com>
2018-10-17 13:35:52 -06:00
Wayne Witzel III
02f50b9c84
add default-volume-snapshot-locations to server cmd
...
Signed-off-by: Wayne Witzel III <wayne@riotousliving.com>
2018-10-17 13:35:50 -06:00
Carlisia
1aa712d236
Default and validate VolumeSnapshotLocations
...
Signed-off-by: Carlisia <carlisia@grokkingtech.io>
2018-10-17 13:33:22 -06:00
Wayne Witzel III
bbf769850e
add create CLI command for snapshot locations
...
Signed-off-by: Wayne Witzel III <wayne@riotousliving.com>
2018-10-17 13:33:22 -06:00
Wayne Witzel III
aeb221eafe
Add printer for snapshot locations
...
Signed-off-by: Wayne Witzel III <wayne@riotousliving.com>
2018-10-17 13:33:22 -06:00
Wayne Witzel III
ffc612ac13
Add volume snapshot CLI get command
...
Signed-off-by: Wayne Witzel III <wayne@riotousliving.com>
2018-10-17 13:33:22 -06:00
captjt
ebc379ac02
Add --include-cluster-resources options when creating schedule
...
Signed-off-by: captjt <jtaylor007.jt@gmail.com>
2018-10-16 15:52:18 -04:00
Steve Kriss
4173515435
don't require a default backup storage location to exist
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-11 14:43:27 -06:00
Steve Kriss
0612c5de70
templatize error message in DeleteOptions
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-05 13:24:30 -06:00
Steve Kriss
1da3278ad6
Merge pull request #874 from shubheksha/fix/748-ark-schedule-bulk-deletion
...
Add support for bulk deletion to `ark schedule delete`
2018-10-05 13:21:40 -06:00
Shubheksha Jalan
66bcbc058c
add support for bulk deletion to ark schedule delete
...
refactor and move DeleteOptions struct and methods
unexport fields not used outside the package in DeleteOptions struct
refactor BindFlags() to work with name of command
fix constructor
Signed-off-by: Shubheksha Jalan <jshubheksha@gmail.com>
2018-10-05 19:45:18 +02:00
Steve Kriss
3af43b492f
add azure-specific code to support multi-location restic
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-05 09:20:56 -06:00
Steve Kriss
d009163b67
update restic to support multiple backup storage locations
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-05 09:10:35 -06:00
Steve Kriss
eb709b8f70
only sync a backup location if it's changed since last sync
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-03 08:05:06 -06:00
Steve Kriss
82ab2d73ac
Merge pull request #894 from marctc/fix_backup_list_date
...
Change CreationTimestamp to StartTimestamp in backup list
2018-10-02 11:04:04 -06:00
Marc Tudurí
ae4bf3d5f8
Change CreationTimestamp by StartTimestamp in backup list
...
Signed-off-by: Marc Tudurí <marctc@gmail.com>
2018-10-02 15:17:58 +02:00
Michal Wieczorek
0f1c5c283f
Enable restoring resources with ownerReference set
...
Signed-off-by: Michal Wieczorek <wieczorek-michal@wp.pl>
2018-10-02 12:04:51 +02:00
Steve Kriss
e46e89cb61
have restic share main Ark bucket
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-09-25 13:12:22 -06:00
Steve Kriss
8bc7e4f6aa
store backups & restores in backups/, restores/ subdirs in obj storage
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-09-25 09:56:41 -06:00
Shubheksha Jalan
e3232b7eb6
add support for bulk deletion to ark restore delete
...
refactor util methods into a common package
move utility methods into cli package instead of common
rename util.go to common.go
Signed-off-by: Shubheksha Jalan <jshubheksha@gmail.com>
2018-09-25 20:37:20 +05:30
Carlisia
44a75cee7b
Merge pull request #820 from skriss/azure-restic-fix
...
set azure restic env vars based on default backup location's config
2018-09-06 13:01:45 -07:00
Zsolt Varga
211aa7b7fd
Set schedule labels to subsequent backups
...
Signed-off-by: Zsolt Varga <zsolt.varga@console.hu>
2018-09-06 10:06:18 +02:00
Steve Kriss
d34994cb5f
set azure restic env vars based on default backup location's config
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-09-05 14:31:42 -06:00
Steve Kriss
b31e25bf6e
server: remove unused code, replace deprecated func
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-28 13:19:21 -07:00
Steve Kriss
729d733986
controllers: take a newPluginManager func in constructors
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-28 13:19:21 -07:00
Steve Kriss
133dc185ca
backup sync: process the default location first
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-28 13:19:21 -07:00
Steve Kriss
6f7bfe545d
remove Config CRD's BackupStorageProvider & other obsolete code
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-28 13:19:21 -07:00
Steve Kriss
bd4d97b9e4
move server's defaultBackupLocation into config struct
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-28 13:19:21 -07:00
Steve Kriss
0e94fa37f9
update sync controller for backup locations
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-28 13:19:21 -07:00
Carlisia
2750aa71b9
Use backup storage location during restore
...
Closes #740
Signed-off-by: Carlisia <carlisia@grokkingtech.io>
2018-08-28 13:19:21 -07:00
Steve Kriss
20f89fbcef
use the default backup storage location for restic
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-28 13:19:21 -07:00
Nolan Brubaker
833a6307a9
Add storage location to backup get/describe
...
Fixes #775
Also conforms ark imports to https://github.com/heptio/ark/issues/494
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-08-28 13:19:21 -07:00
Steve Kriss
cf7c8587f0
download request: fix setting of log level for plugin manager
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-28 13:19:21 -07:00
Steve Kriss
3234124afe
backup deletion: fix setting of log level in plugin manager
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-28 13:19:20 -07:00
Steve Kriss
8f5346150c
download request controller: use backup location for object store
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-28 13:19:20 -07:00
Steve Kriss
bab08ed1a6
backup deletion controller: use backup location for object store
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-28 13:19:20 -07:00
Nolan Brubaker
c6f488f75f
Use backup location in the backup controller
...
Fixes #739
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-08-28 13:19:20 -07:00
Steve Kriss
06b5af449f
add create and get CLI commands for backup locations
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-28 13:19:19 -07:00
Steve Kriss
adbcd3703b
add --default-backup-storage-location flag to server cmd
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-28 13:14:51 -07:00
Nolan Brubaker
2a34772ed5
Add --storage-location argument to create commands
...
Closes #738
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-08-28 13:14:51 -07:00
Nolan Brubaker
adc29a2db0
Merge pull request #774 from metadave/dp_report_bug
...
add an ark bug command
2018-08-24 16:17:21 -04:00
Dave Parfitt
342a1c6437
add an ark bug command
...
Signed-off-by: Dave Parfitt <diparfitt@gmail.com>
2018-08-24 13:10:56 -04:00
Carlisia
9508e4a20e
Switch Config CRD elements to server flags
...
Signed-off-by: Carlisia <carlisia@grokkingtech.io>
2018-08-16 08:51:46 -07:00
Steve Kriss
5acccaa739
add bulk deletion support to ark backup delete
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-08-08 10:28:40 -07:00
Steve Kriss
27003af62a
Merge pull request #304 from ncdc/wait
...
Add --wait support to ark backup create
2018-08-03 10:57:20 -07:00
Andy Goldstein
c5f5862c9c
Add --wait support to ark backup create
...
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-08-03 10:42:42 -07:00
Steve Kriss
c6ef76d2b3
Merge pull request #719 from nrb/prereq-faq
...
Document CRD not found errors
2018-08-02 16:03:09 -07:00
Nolan Brubaker
eb6f742b5d
Document CRD not found errors
...
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-08-02 16:41:28 -04:00
Carlisia
e7bb592602
Add --wait support to `ark restore create`
...
Signed-off-by: Carlisia <carlisia@grokkingtech.io>
2018-07-31 17:20:03 -07:00
Steve Kriss
1c26fbde32
remove SnapshotService, replace with direct BlockStore usage
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-31 08:58:11 -07:00
Andy Goldstein
130512187a
Refactor plugin management
...
Refactor plugin management:
- support multiple plugins per executable
- support restarting a plugin process in the event it terminates
- simplify plugin lifecycle management by using separate managers for
each scope (server vs backup vs restore)
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-07-31 08:34:57 -07:00
Steve Kriss
131afb571e
Merge pull request #607 from nrb/restore-metrics
...
Restore metrics
2018-07-27 12:25:56 -07:00
Nolan Brubaker
82f1cd87dc
Merge pull request #680 from carlisia/c-delete-from-etcd
...
Delete backups from etcd if they're not in storage
2018-07-25 18:25:52 -04:00
Carlisia
d2e629f5a8
Delete backups from etcd if they're not in storage
...
This fixes #309 .
Signed-off-by: Carlisia <carlisia@grokkingtech.io>
Co-authored-by: Steve Kriss <steve@heptio.com>
2018-07-25 14:53:50 -07:00
Nolan Brubaker
7cebfe2df0
Add restore attempt and success/failure counters
...
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-07-25 11:22:43 -04:00
Nolan Brubaker
b0af81e780
Merge pull request #689 from lemaral/init-schedule-metrics
...
Init schedule Prometheus metrics
2018-07-23 16:16:26 -04:00
Steve Kriss
e063b7983a
Merge pull request #682 from nrb/support-rbac-1.7
...
Support for rbac v1beta1 on kubernetes v1.7.5+
2018-07-23 12:00:50 -07:00
Nolan Brubaker
dd1e150511
Add RBAC support for 1.7 clusters
...
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-07-23 14:19:03 -04:00
Carlisia
c47a364ab3
Merge pull request #687 from skriss/fix-delete-issues
...
fix delete issues
2018-07-23 10:40:14 -07:00
Alex Lemaresquier
450fa72fbb
Initialize schedule Prometheus metrics to have them created beforehand (see https://prometheus.io/docs/practices/instrumentation/#avoid-missing-metrics )
...
Signed-off-by: Alex Lemaresquier <alex+github@lemaresquier.org>
2018-07-20 23:30:24 +02:00
Steve Kriss
78cbdf95f3
delete old deletion requests for backup when processing a new one
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-20 11:42:42 -07:00
Steve Kriss
1df9a8a38d
exit server if not all Ark CRDs exist at startup
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-18 14:30:42 -07:00
Nolan Brubaker
e11634bfbc
Merge pull request #676 from skriss/dont-create-namespace
...
require namespace for backups/etc. to exist at server startup
2018-07-17 14:26:04 -04:00
Steve Kriss
13f893f1f9
Merge pull request #634 from marpaia/k8s-1.11
...
Update Kubernetes and Client-Go for 1.11.0 / 8.0.0
2018-07-17 08:55:47 -07:00
Mike Arpaia
3efe677007
Update Ark library code to work with Kubernetes 1.11
...
Signed-off-by: Mike Arpaia <mike@arpaia.co>
2018-07-16 20:46:20 -06:00
Steve Kriss
d195512062
require namespace for backups/etc. to exist at server startup
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-13 13:50:12 -07:00
Steve Kriss
706ae07d0d
enable a schedule to be provided as the source for a restore
...
- ScheduleName is added as an API field to the Restore object
- Restore controller validates that exactly one of BackupName
or ScheduleName has been provided
- If ScheduleName is provided, Restore controller populates
BackupName with the name of the most recent successful backup
created from the schedule
- --from-schedule flag is added to `ark restore create` CLI cmd
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-07-09 15:07:38 -07:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
f6761ddd00
Check restore Phase before downloading logs
...
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
2018-05-17 12:20:55 -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
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
Steve Kriss
09c20b51e6
shutdown gracefully on SIGINT/SIGTERM
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-05-10 16:22:14 -07: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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Steve Kriss
e130011d1e
Merge pull request #272 from ncdc/arbitrary-namespaces
...
Support running in any namespace
2018-01-05 14:15:18 -08: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
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
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
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
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
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
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
1210cb36e1
Merge pull request #253 from skriss/update-license
...
Update all license headers
2017-12-19 19:26:54 -05:00
Steve Kriss
3641c2c043
update all license headers
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-12-15 13:38:12 -08:00
Steve Kriss
56c9d68137
switch to logrus.FieldLogger and arktest.NewLogger() everywhere
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-12-13 09:38:00 -08:00
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
995050390c
add plugin add/remove commands
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-11-29 12:22:30 -08: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
c2dc41efd8
Add backup & schedule describers
...
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-11-27 15:22:20 -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
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
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
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
21e2019540
rename Block/ObjectStoreAdapter -> Block/ObjectStore
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-11-08 16:58:47 -08: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
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
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
c1bc52eb65
Update gofmt
...
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
15fe87aea3
Fix clientset imports
...
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-30 13:31:03 -04:00
Andy Goldstein
43449885a1
React to move to k8s.io/api
...
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-30 13:30:27 -04:00
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
e38b6d0f4c
Support cross-compiling for clients
...
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-24 12:26:26 -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
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
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
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
Steve Kriss
9438a8670a
when backing up PVCs, also back up claimed PVs
...
Signed-off-by: Steve Kriss <steve@heptio.com>
2017-10-11 09:54:57 -07:00
Steve Kriss
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
ashish-amarnath
6dc81b42f5
Merge branch 'master' into support-multi-az-pvs
...
Signed-off-by: Ashish Amarnath <ashish.amarnath@gmail.com>
2017-10-06 23:24:41 -07:00
Ashish Amarnath
9fc9dbb413
Preserve PV's AZ info when snapshotting and restoring PVs.
...
- Read PV's AZ info from fault-domain label of the PV object for snapshotting.
- Store PV's AZ info in the VolumeInfo.
- Add tests for reading the label from the PV object.
- Remove availability zone validation in AWS and GCP BlockStorageAdaptor.
- Add volumeAZ as a parameter to methods in the BlockStorageAdapter interface.
- Get AZ from VolumeInfo when restoring PV snapshot.
- Remove references to PV availability zone in docs.
Signed-off-by: Ashish Amarnath <ashish.amarnath@gmail.com>
2017-10-06 23:24:41 -07:00
Steve Kriss
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
a5d4d138b2
Merge pull request #96 from ncdc/fix-config-watch
...
Make config change detection more robust
2017-09-19 09:57:52 -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
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
f31af75dc3
Merge pull request #82 from ncdc/tweak-version-output
...
Tweak version display
2017-09-13 14:14:44 -07: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
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
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
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
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
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
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
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
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
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
e0d2a2d4d0
Remove k8s.io/apiextensions-apiserver from vendor
...
Remove k8s.io/apiextensions-apiserver since we're no longer registering
CRDs in code.
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-08-07 12:38:07 -04:00
Andy Goldstein
2fe501f527
Initial commit
...
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-08-02 13:27:17 -04:00