-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zookeeper backup controller #413
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Ilya Bumarskov <[email protected]>
Signed-off-by: Ilya Bumarskov <[email protected]>
Signed-off-by: Ilya Bumarskov <[email protected]>
Signed-off-by: Ilya Bumarskov <[email protected]>
Signed-off-by: Ilya Bumarskov <[email protected]>
79d8c03
to
64d0b89
Compare
Codecov ReportBase: 85.05% // Head: 85.23% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #413 +/- ##
==========================================
+ Coverage 85.05% 85.23% +0.18%
==========================================
Files 12 14 +2
Lines 1606 1924 +318
==========================================
+ Hits 1366 1640 +274
- Misses 155 184 +29
- Partials 85 100 +15
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
deploy/role.yaml
Outdated
- zookeeper.pravega.io | ||
resources: | ||
- '*' | ||
- zookeeperbackups |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would not zookeeperbackups
be already included in the first line ('*'
)?
It might be easier to enhance the operator docker image with the backup script (e.g., copy the script here https://github.com/pravega/zookeeper-operator/blob/master/Dockerfile#L34) and use it in the CronJob with a different entrypoint. This way we won't need to maintain an extra docker image or pull it to a cluster, as it would already be present in the system. |
Good point, |
Hi @ibumarskov where did this land? I am currently evaluating my options for having automated backup of our cluster.. any plans of getting this pr to master |
Signed-off-by: Ilya Bumarskov <[email protected]>
…r-operator into zk-backup-controller
…into pravega-master
Hi, currently I have not enough time for this task. You can finish the task if you want. |
Signed-off-by: ibumarskov <[email protected]>
6b1471c
to
d98262d
Compare
Signed-off-by: Ilya Bumarskov <[email protected]>
d98262d
to
a53eebc
Compare
…into pravega-master
532e03b
to
06853d8
Compare
06853d8
to
c9583f4
Compare
@ibumarskov would you like to update this PR |
ed8c666
to
1e7c76c
Compare
please add |
with that change i managed to get a backup scheduled after running |
type ZookeeperBackupStatus struct { | ||
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster | ||
// Important: Run "make" to regenerate code after modifying this file | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty struct
|
||
func (r *ZookeeperBackupReconciler) Reconcile(_ context.Context, request reconcile.Request) (reconcile.Result, error) { | ||
r.Log = logBk.WithValues("Request.Namespace", request.Namespace, "Request.Name", request.Name) | ||
r.Log.Info("Reconciling ZookeeperBackup") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this message is needed, it would be nice to log the name and the namespace of the CR, otherwise there is no value in the log message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually name (CR) and namespace should be added to each log entry. ZookeeperCluster reconcile function has the same logging. Example:
{"level":"info","ts":1649845790.4947126,"logger":"controller_zookeepercluster","msg":"Reconciling ZookeeperCluster","Request.Namespace":"tf","Request.Name":"tf-zookeeper"}
} | ||
changed := zookeeperBackup.WithDefaults() | ||
if changed { | ||
r.Log.Info("Setting default settings for zookeeper-backup") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the name and the namespace of the CR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All logs are provided with name/namespaces:
r.Log = logBk.WithValues("Request.Namespace", request.Namespace, "Request.Name", request.Name)
zkCluster := zookeeperBackup.Spec.ZookeeperCluster | ||
err = r.Client.Get(context.TODO(), types.NamespacedName{Name: zkCluster, Namespace: zookeeperBackup.Namespace}, foundZookeeperCluster) | ||
if err != nil && errors.IsNotFound(err) { | ||
r.Log.Error(err, fmt.Sprintf("Zookeeper cluster '%s' not found", zkCluster)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, log ZookeeperBackup name and the namespace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same.
8222c56
to
5d124c4
Compare
- Add backup crd to charts (makefile) - Add validation of BACKUPS_TO_KEEP variable - Improve logging Signed-off-by: ibumarskov <[email protected]>
5d124c4
to
42522e7
Compare
so a bit of feedback, I scheduled a backup yesterday, but i named the cluster wrong, the backup scheduled niceley, but i found it hard to find status on the backup, wat would have been nice was a
or something similar, and maybe when it compleets
|
also I am not sure that i get it right.. but i would expect this to work
|
Hi @ibumarskov I'm also interested in this. Are there plans to get this merged into master soon? |
@anishakj ZookeeperClusterList returns same error: |
Change log description
Implementation of automatic data backup.
Purpose of the change
Implement #408
What the code does
Adds a dedicated controller responsible for automatic backups of zookeeper data. Current
implementation provides periodic copying of transaction logs and snapshots (on-disk representation of the data) to
dedicated persistence volume with specified storage class within kubernetes cluster.
How to verify it
Create CR for zookeper backup controller
Exmaple CR of zookeeper backup:
Additional required actions:
Build backup docker image and upload it to hub.docker with image name pravega/zkbackup:0.1