-
Notifications
You must be signed in to change notification settings - Fork 88
Bug 1771810: Add e2e to verify kso metrics accessible #191
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
Conversation
|
@sallyom: This pull request references Bugzilla bug 1771810, which is invalid:
Comment DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Is it required to access the metrics through kubectl? Or, is the goal of the PR to verify (using any method) the metrics are accessible? If so, would it be easier to access the metrics from the metrics endpoint? (I am just asking, I have never consumed the metrics other than directly from a component while running in the same binary). |
The goal is to access metrics and also verify cluster CA -this will eventually be used to verify successful cert rotation- what I landed upon (after days of trial and error) is to access metrics via internal service url with curl cmd secured via cluster CA (generated by service-ca-operator/annotated configmap). I also had a version using the external route, and go code instead of curl - but I could not utilize service CA - only way that worked was to set InsecureSkipVerify in TLSconfig - but exec-ing in a pod using internal url works perfectly. I'm open to using anything that works, though!! |
|
/test e2e-aws-operator |
bf8effb to
fe1b5e7
Compare
I have zero experience in this area. Though, as long as it's used in tests, I have no objection. Are you aware of other components/operator that test the same? Or, are you pioneering it right now? :) |
|
@sallyom @ingvagabund hello from the monitoring team! :-) 👋 @paulfantom asked me to help out here, so don't hesitate also to ping me on #forum-monitoring in slack. I do recommend that you access your metrics via the exposed Thanos routes (which internally forward to Prometheus). That way you will verify that your metrics are being successfully scraped and hence also verifies the RBAC setup towards your scraping targets. I would not advise to check metrics in your local metrics endpoint only. Regarding querying metrics you could do the approach done here or create your own http client (as we did) after finding out the external route and token: https://github.com/openshift/cluster-monitoring-operator/blob/8e5623597b94d2f62c38bc427c23a820a01f002f/test/e2e/framework/route_client.go#L47-L76 |
thanks @s-urbaniak yes, I was under impression that a TLSconfig secured via CAbundle was required, but as it turns out it is not - so, I am going w/ the external prom url /route client - i had that working a few days ago but only w/ InsecureSkipVerify - and I thought we needed to avoid that but alas after much discussion we do not - so I'm back to using the route (very similar to the route_client setup you pointed to). That will live in library-go/test/library/metrics/query.go. |
|
@sallyom sounds good, yes we are also "InsecureSkipVerify'ing" the TLS connection via the exposed routes right now. |
2c95a69 to
b7e0a6a
Compare
089811d to
aaa6d16
Compare
|
/bugzilla refresh |
|
@sallyom: This pull request references Bugzilla bug 1771810, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
9a76910 to
02f6c18
Compare
|
/retest |
soltysh
left a comment
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
/approve
/hold
for nit resolution
Makefile
Outdated
| $(call add-bindata,v4.1.0,./bindata/v4.1.0/...,bindata,v410_00_assets,pkg/operator/v410_00_assets/bindata.go) | ||
|
|
||
| e2e: GO_TEST_PACKAGES :=./test/e2e | ||
| e2e: GO_TEST_FLAGS += -v |
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 don't think we need that verbosity, if the test fails, we'll get it, otherwise it's not needed.
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.
removed it
test/e2e/scheduler_test.go
Outdated
| } | ||
|
|
||
| // do something with result, eventually this will be tested b4 and after rotation to ensure values differ | ||
| fmt.Printf("result from prometheus query `scheduler_scheduling_duration_seconds_sum`: %v", response) |
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 change this to t.Logf
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.
done
|
/retest |
soltysh
left a comment
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
/hold cancel
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sallyom, soltysh The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@sallyom: All pull requests linked via external trackers have merged. Bugzilla bug 1771810 has been moved to the MODIFIED state. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
example #2 for using library-go/test/metrics functions. This PR adds an e2e to verify cluster-kube-scheduler-operator metrics are accessible.
see openshift/library-go#602