Skip to content
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

[release-4.18] Enable RTE metrics to be scraped securely by Prometheus #1141

Conversation

rbaturov
Copy link
Contributor

@rbaturov rbaturov commented Jan 7, 2025

This is a combined backport PR for #1107 and #1130.

This PR encompasses and integrates all the needed infrastructure to enable secured communication for scraping metrics by Prometheus, now for RTE.

To validate that this PR is functioning correctly, please follow these steps:

  1. build image of the operator (make docker-build docker-push)
  2. run: make deploy
  3. Attach to one of the prometheus pods oc exec -it prometheus-k8s-0 -n openshift-monitoring /bin/bash
  4. run:
curl -v \
--cacert /etc/prometheus/configmaps/serving-certs-ca-bundle/service-ca.crt \
-H "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" \
https://numaresources-rte-metrics-service.numaresources.svc:2112/metrics

rbaturov and others added 8 commits January 7, 2025 10:32
* 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]>
Introduce higher-level objectstate/rte Manifests object
to enable future integration between deployer manifests
and operator-specific RTE metrics manifests.

This change only create room for the future integration
adding a higher level object. No changes in behavior
besides required API changes.

Signed-off-by: Francesco Romani <[email protected]>
Incorporate the operator-specific metrics manifests
in the newly introduced higher level objectstate Manifests.
This enables us to remove all the custom code.

Signed-off-by: Francesco Romani <[email protected]>
add coding shortcuts to remove the repetitive code.
No intended changes in behavior.

Signed-off-by: Francesco Romani <[email protected]>
make sure to render the Service manifests in render mode.

Signed-off-by: Francesco Romani <[email protected]>
@openshift-ci openshift-ci bot requested review from ffromani and swatisehgal January 7, 2025 08:40
@rbaturov rbaturov changed the title Enable secure metrics rte 4.18 [release-4.18] Enable RTE metrics to be scraped securely by Prometheus Jan 7, 2025
Copy link
Collaborator

@swatisehgal swatisehgal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Let's capture in the PR description that we are backporting #1130 as well.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 7, 2025
@rbaturov
Copy link
Contributor Author

rbaturov commented Jan 7, 2025

/lgtm

Let's capture in the PR description that we are backporting #1130 as well.

Thanks @swatisehgal.
Done

@ffromani
Copy link
Member

ffromani commented Jan 7, 2025

/approve

Copy link
Contributor

openshift-ci bot commented Jan 7, 2025

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 7, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit 68c494c into openshift-kni:release-4.18 Jan 7, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants