This repository has been archived by the owner on Mar 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 740
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* backup-operator: Add BackupIntervalInSecond This commit added BackupIntervalInSecond in BackupPolicy, which perform periodic backup as #1841 issue describe. This commit is part of #1841. By specifying BackupIntervalInSecond, user can let etcd-backup-operator do periodic backup. The specification of BackupIntervalInSecond is following - unit in sec - >0 means interval. - =0 means explicit disable interval backup, it will just do one time backup. * backup: Add validation of BackupIntervalInSecond This commit implement validation of BackupIntervalInSecond. After this commit, backup-operator will make sure BackupIntervalInSecond follow following restrictions - <0 is not allowed, failed validation - 0 is valid and disable periodic backup - >0 is valid and means interval * backup: Add LastSuccessDate Current backup status is only designed for one-shot snapshot. Always it show lastest results but it would be nice if we could record the last time to successfully take a snapshot. * backup: Add MaxBackups in BackupPolicy This commit added MaxBackups attributs which let backup-operator delete older snapshots if the number of snapshots exceeded than MaxBackups. Specification of MaxBackups is following - <0 is not allowed, which cause validation failure - =0 is to indicate MaxBackups is infinite, which let not operator delete any exisiting snapshots - >0 is to indicate the max number of snapshot * backup: Use path without adding info if one-shot After support periodic backup, backup-operator added revision number and date to s3 path as following <bucket name>/<object name>_v<rev>_<date>. This behaviour has been applied even if backup is one-shot backup, therfore this change broke exisiting behaviour. This commit brough back original behaviour which use s3 path without adding anything <bucket name>/<object name>, if backup is not periodic * backup: Reset reason if backup succeeded * backup: Update the codegen files * backup: fix typo * backup: Refactoring * backup: Use meta/v1.Time instead of time.Time After I generated the code based on k8s object (zz_generated.deepcopy.go), we happened to be in failing to build. This is because all k8s custom resource's fileds should implement DeepCopyInto but time.Time we added doesn't implement it. For this purpose we should have used meta/v1.Time which is the implementation to implement all necessary function for k8s object and same function of time.Time. And also this commit include some refactoring which is pointed out in code-review * backup: minor fixes (naming, extra space) * backup: Add periodically backup example * backup: add e2e slow test for periodic backup * Update generated k8s code license for new year(2019) * backup: Minor fix "composite literal uses unkeyed" * backup: Update CHANGELOG.md for periodic support * backup: Move periodbackup test after restore test restore test expected backup file to be present but periodic backup test actually cleanup backup file to be created so we failed to perform restore test because of that. that's why we moved periodic test after restore test * backup: Fixed the bug to get operator in infinite-loop * backup: Only Retry in the case of transient error
- Loading branch information
Showing
19 changed files
with
531 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: "etcd.database.coreos.com/v1beta2" | ||
kind: "EtcdBackup" | ||
metadata: | ||
name: example-etcd-cluster-periodic-backup | ||
spec: | ||
etcdEndpoints: [<etcd-cluster-endpoints>] | ||
storageType: S3 | ||
backupPolicy: | ||
# 0 > enable periodic backup | ||
backupIntervalInSecond: 125 | ||
maxBackups: 4 | ||
s3: | ||
# The format of "path" must be: "<s3-bucket-name>/<path-to-backup-file>" | ||
# e.g: "mybucket/etcd.backup" | ||
path: <full-s3-path> | ||
awsSecret: <aws-secret> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.