-
Notifications
You must be signed in to change notification settings - Fork 24
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
NETOBSERV-565 added service monitors for flp prometheus and console plugin #188
Conversation
return &monitoringv1.ServiceMonitor{ | ||
ObjectMeta: metav1.ObjectMeta{ | ||
Name: constants.PluginServiceMonitorName, | ||
Namespace: constants.DefaultOperatorNamespace, |
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.
Namespace: constants.DefaultOperatorNamespace, | |
Namespace: b.namespace, |
Namespace should be taken from CRD
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.
LGTM in terms of code, not tested yet. Thanks @KalmanMeth !
I'm going to test it |
@KalmanMeth it doesn't work for me, there is a permission issue when trying to read the servicemonitor CRD to determine if they can be installed. So to check ServiceMonitor, you can edit this file to add |
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.
There's something more to do: manage namespace changes. It is possible to update the netobserv installation to change its namespace, so what the operator does in that case is to remove all the created resources and recreate them in the other namespace.
You don't have to implement all of this, you just need to declare the servicemonitor resource when the reconcilers are created, see here: https://github.com/netobserv/network-observability-operator/blob/main/controllers/consoleplugin/consoleplugin_reconciler.go#L32-L56
- you need to add a reference in
ownedObjects
- you need to call
nobjMngr.AddManagedObject
once it's done, upon namespace change, the controller will take care of deleting these resources and re-creating them.
Same thing to do for FLP monolith, FLP ingester and FLP transformer
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
5703bf4
to
84adc6d
Compare
@jotak I added code to check for |
@KalmanMeth sorry for the delay, I'll take another look today |
So I still get the same error (plus also an error saying missing permissions to get/create servicemonitors) The exact error I get (in logs) is:
This is logical: we must tell that we need extra permissions, to read/write ServiceMonitors. This is done via kubebuilder annotations, cf in
Then run: make generate It will amend automatically The other thing is, my previous comment to add the discovery mechanism was to avoid having to read the servicemonitor CRD as you do in |
84adc6d
to
4af397a
Compare
flag.StringVar(&config.EBPFAgentImage, "ebpf-agent-image", "", "The image of the eBPF agent") | ||
flag.StringVar(&config.FlowlogsPipelineImage, "flowlogs-pipeline-image", "", "The image of Flowlogs Pipeline") | ||
flag.StringVar(&config.ConsolePluginImage, "console-plugin-image", "", "The image of the Console Plugin") | ||
flag.StringVar(&config.EBPFAgentImage, "ebpf-agent-image", "quay.io/netobserv/netobserv-ebpf-agent:main", "The image of the eBPF agent") |
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.
@KalmanMeth this will not be needed once we merge #203
@jotak I made updates according to your comments. I hope it is now satisfactory. |
e76cc16
to
873ca3c
Compare
de72361
to
28f385c
Compare
Hi Kalman,
Let me know if you have an idea for point 1. For point 2, I can try doing a fix and adding it to your PR (I know this part of the code is tricky to apprehend) ; If we can't get that fixed quickly we can go ahead & merge, and address them in follow-ups |
- ServiceMonitor in FLP uses the builder's label selector for targets - Refactor a bit FLP reconcilers to move some data in a common struct - Add tests on generated names/labels in pub/sub/monolith scenarios - More consistent naming in builders
Fix servicemonitors for pub/sub FLP
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.
/lgtm
thanks!
Follow-up JIRA for the console plugin issue: https://issues.redhat.com/browse/NETOBSERV-765
Fix shutdown time
To view the metrics in the console, apply the following: