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.
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.
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.
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.
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
| } | ||
| } | ||
|
|
||
| if r.NooBaa.Spec.NotificationsPVC != nil { |
There was a problem hiding this comment.
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.
I agree with Jacky. we should probably consolidate the PVCs, and handle it in a similar way
There was a problem hiding this comment.
-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.
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.
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.
Following a discussion with Amit and Jacky:
- Add
BucketNotificationsSpecthat 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.
Changes are the two new commits from this week, LMKWYT
ef58771 to
a2cc936
Compare
dannyzaken
left a comment
There was a problem hiding this comment.
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 <alphaprinz@gmail.com>
…dapt reconcile. (noobaa#1467) Signed-off-by: Amit Prinz Setter <alphaprinz@gmail.com>
-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: