-
Notifications
You must be signed in to change notification settings - Fork 14
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
CNF-11234: Enable RTE metrics to be scraped securely by Prometheus #1107
CNF-11234: Enable RTE metrics to be scraped securely by Prometheus #1107
Conversation
Skipping CI for Draft Pull Request. |
/retest |
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'm not sure we need a separate manifest set. I'. mot saying I'm against it but I'd like to see if/how we can merge it with the existing manifest set
config/rbac/role.yaml
Outdated
- apiGroups: | ||
- "" | ||
resources: | ||
- serviceaccounts | ||
verbs: | ||
- '*' | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- services | ||
verbs: | ||
- '*' |
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.
ok, this is a role, hence it is ONLY granted in the NROP namespace, right? Stll this is very broad, we need to narrow down AND document in the commit message why do we need these permissions
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, you are right. we want in only in the NROP 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.
@ffromani
I've tried to create a separate role (not clusterRole) and a RoleBinding.
But adding the label
//+kubebuilder:rbac:groups="",resources=services,verbs=*
followed by make manifests
appends its in the clusterRole.
Not sure how we can avoide this and append this in the dedicated role.
|
||
for _, obj := range r.RTEMetricsManifests.ToObjects() { | ||
// Check if the object already exists | ||
existingObj := obj.DeepCopyObject().(client.Object) |
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.
why do we need the cast here?
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 I'll remove the casting:
I'll get this error when using r.Client.Get
:
cannot use existingObj (variable of type runtime.Object) as client.Object value in argument to r.Client.Get: runtime.Object does not implement client.Object (missing method GetAnnotations)
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.
and why do we use DeepCopyObject()
and not DeepCopy()
?
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.
@ffromani This because the client.Object implements DeepCopyObject() and not DeepCopy()
I agree on this one. |
1efaad4
to
b827ccd
Compare
b827ccd
to
7b5b369
Compare
7b5b369
to
15b513e
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.
/approve
/lgtm
good starting point for 4.19 and onwards
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ffromani, rbaturov The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold need to check RBAC rules again |
/lgtm cancel |
Regarding this, it is correct that now I have granted permission to the operator to manage service objects across the entire cluster and not narrowed it down to NROP namespace. |
15b513e
to
3ddbf0e
Compare
3ddbf0e
to
63eef4a
Compare
/retest-required |
2 similar comments
/retest-required |
/retest-required |
the first retest it's a freebie, but past that we need to check why tests are failing and only when we are confident it's actually an infra issue we should retest |
I saw there was a timeout. I'm not sure this is the infra indeed, I wanted to give it a try before deep diving into that |
@rbaturov: This pull request references CNF-11234 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.19.0" version, but no target version was set. In 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 openshift-eng/jira-lifecycle-plugin repository. |
63eef4a
to
91efaab
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.
/lgtm
we can narrow down permissions later on
/hold cancel |
91efaab
to
2edf895
Compare
2edf895
to
a063be5
Compare
a063be5
to
fbeca08
Compare
* Enabled metrics by default by setting --metrics-mode=httptls. * Added an RTE metrics package and associated manifests. Currently, this includes only the Service manifest. * The Service manifest includes a special annotation monitored by the Service CA operator. This operator generates the tls.key and tls.crt files in the rte-metrics-service-cert secret, which is consumed by the RTE worker container. * Updated the DaemonSet configuration to include the required volume and volumeMount for accessing the metrics secret. * Deployment of this Service is required for metrics functionality. Signed-off-by: Ronny Baturov <[email protected]>
As part of enabling metrics for RTE, a Service resource is created during the deployment of the RTE metrics manifests by the operator. This commit grants the operator pod the necessary permissions to deploy the Service CR. Signed-off-by: Ronny Baturov <[email protected]>
* Integrating RTE metrics manifests to be deployed by the operator * This adds unit test for metrics components creation Signed-off-by: Ronny Baturov <[email protected]>
Signed-off-by: Ronny Baturov <[email protected]>
fbeca08
to
ae455f8
Compare
/lgtm |
This is a follow-up PR for Enable NROP metrics to be to scraped securely by Prometheus .
This PR encompasses and integrates all the needed infrastructure to enable secured communication for scraping metrics by Prometheus, now for RTE.
A follow-up PR will be posted for e2e tests later.
To validate that this PR is functioning correctly, please follow these steps:
make docker-build docker-push
)make deploy
oc exec -it prometheus-k8s-0 -n openshift-monitoring /bin/bash