-
Notifications
You must be signed in to change notification settings - Fork 102
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
Bucket Notifcations #1467
Bucket Notifcations #1467
Conversation
pkg/system/phase2_creating.go
Outdated
//mount them so core can read them | ||
notificatoinSecrets := &corev1.SecretList{} | ||
noobaaNotifSelector, _ := labels.Parse("app=noobaa,noobaa=notifications") | ||
util.KubeList(notificatoinSecrets, &client.ListOptions{Namespace: options.Namespace, LabelSelector: noobaaNotifSelector}) |
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.
What happens if we don't find any secret? Do we have a default? we should reject? warn?
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.
Using default doesn't make sense, because user at least needs to specify url for remote server and its protocol (http/kafka).
I can look into going into reject, but that can be done in operator only if there are no secrets at all. It would still be possible to be missing some of the secrets and operator won't have a way to know that.
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.
I think we should give the user as much info as we can. If we don't have any secrets and we know the feature won't work this way - we should at least write a warning in the logs (I think we should also Reject)
It can be nice to also check that the secret has the needed fields we expect and maybe add some documentation about how the secret is supposed to look.
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.
maybe the user should give us the specific secret that he wants us to use and we won't just list all the secrets? WDYT?
pkg/system/phase2_creating.go
Outdated
@@ -450,6 +450,16 @@ func (r *Reconciler) setDesiredCoreEnv(c *corev1.Container) { | |||
} | |||
} | |||
} | |||
|
|||
if r.NooBaa.Spec.NotificationsPVC != nil { |
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.
I think we should support something similar to what we have for bucket logging. We should create a pvc in case we are in ODF. Also, don't think we should have two if any one of them is turned on. I think we should have a segment like bucketNotifications and inside we should have enabled, yes or no and an optional pvc in case bucket logging is not enabled and we are not in ODF.
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.
I agree with Jacky. we should probably consolidate the PVCs, and handle it in a similar way
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.
-Regarding PVC in ODF - OK, I will copy bucket logging notification behavior in ODF case.
-Regarding single PVC - are you sure using a single PVC is better, performance-wise or user-experience-wise? If so, should I rename it (in our code) BucketLoggingPVC? Sth like "PersistentLogsPVC"?
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.
For using a single PVC for both bucket logging and bucket notifications, the change that makes most sense to me is that we remove pvc name from both of them and add a new field in noobaa crd for a "persistent files pvc", which both will use. Otherwise the features parameters are mixed.
Let me know what you think or if you have a different structure in mind.
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.
It makes sense to me as well, PersistentLogsPVC sounds like a good name - just need a better explanation in the noobaa CR about the use of this PVC for both guaranteed logging and bucket notifications.
// NotificationsPVC (optional) specifies the name of the Persistent Volume Claim (PVC) to be used | ||
// for notifications persistent files. | ||
// +optional | ||
NotificationsPVC *string `json:"notificationsPVC,omitempty"` |
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.
Following a discussion with Amit and Jacky:
- Add
BucketNotificationsSpec
that containsenable
, optionlpvc
, array of secrets. - we will use separate PVCs for bucket logging and bucket notifications.
- Reuse common code between notifications and logging.
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.
Changes are the two new commits from this week, LMKWYT
ef58771
to
a2cc936
Compare
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.
I added one small comment, other than that LGTM.
I will let Jacky give the final approval as he is more familiar with this code.
Don't forget to squash your commits.
a0f6e9d
to
559f1d5
Compare
…dapt reconcile. Signed-off-by: Amit Prinz Setter <[email protected]>
-New field notificationsPVC in noobaa that is mounted to endpoints and core
-Secrets containing info on how to connect to remote server are mounted to core
Explain the changes
Testing Instructions: