[release-4.22] CNTRLPLANE-4321: Cherry-pick kube-scheduler metrics support - #9490
Conversation
…erts The kube-scheduler previously auto-generated self-signed serving certificates via --cert-dir. This change adds a CA-signed serving certificate, a Service, and a ServiceMonitor to enable Prometheus metrics scraping with proper mTLS authentication.
Add unit tests for scheduler component options, ServiceMonitor adapter, and server certificate reconciliation. Regenerate test fixtures after adding Service, ServiceMonitor, and CA-signed serving certificate support.
The built-in system:monitoring ClusterRole only grants access to /metrics. This adds a ClusterRole and ClusterRoleBinding in the guest cluster to allow the metrics client to scrape /metrics/resources on kube-scheduler, which exposes kube_pod_resource_request and kube_pod_resource_limit metrics.
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@michaelryanmcneill: This pull request references CNTRLPLANE-4314 which is a valid jira issue. 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 openshift-eng/jira-lifecycle-plugin repository. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
|
/label area/control-plane-operator |
|
@michaelryanmcneill: The label(s) 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-sigs/prow repository. |
The cherry-picked fixtures from main had stale desired-state-hash values that don't match the release-4.22 CPOv2 framework output. Regenerated with UPDATE=true go test. Signed-off-by: michaelryanmcneill <michael@michaelryanmcneill.com>
|
/test "Verify / Verify" |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## release-4.22 #9490 +/- ##
================================================
+ Coverage 36.53% 36.57% +0.03%
================================================
Files 777 779 +2
Lines 95363 95458 +95
================================================
+ Hits 34840 34909 +69
- Misses 57682 57707 +25
- Partials 2841 2842 +1
🚀 New features to boost your workflow:
|
|
/test verify-deps |
|
/test e2e-aws-upgrade-hypershift-operator |
|
/verified by e2e-aws ( |
|
@michaelryanmcneill: This PR has been marked as verified by 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 openshift-eng/jira-lifecycle-plugin repository. |
|
@michaelryanmcneill: This pull request references CNTRLPLANE-4321 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 task to target the "4.22.0" version, but no target version was set. 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 openshift-eng/jira-lifecycle-plugin repository. |
|
/jira refresh |
|
@celebdor: This pull request references CNTRLPLANE-4321 which is a valid jira issue. 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 openshift-eng/jira-lifecycle-plugin repository. |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: michaelryanmcneill, muraee 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 |
|
/retest-required |
|
/lgtm |
|
Scheduling tests matching the |
|
/jira refresh |
|
@michaelryanmcneill: This pull request references CNTRLPLANE-4321 which is a valid jira issue. 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 openshift-eng/jira-lifecycle-plugin repository. |
|
/test e2e-aws-upgrade-hypershift-operator |
1 similar comment
|
/test e2e-aws-upgrade-hypershift-operator |
|
/retest-required |
|
/override ci/prow/e2e-aws-upgrade-hypershift-operator |
|
@csrwng: Overrode contexts on behalf of csrwng: ci/prow/e2e-aws-upgrade-hypershift-operator 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-sigs/prow repository. |
|
/jira refresh |
|
@michaelryanmcneill: This pull request references CNTRLPLANE-4321 which is a valid jira issue. 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 openshift-eng/jira-lifecycle-plugin repository. |
|
@michaelryanmcneill: The label(s) 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-sigs/prow repository. |
|
/retitle [release-4.22] CNTRLPLANE-4321: Cherry-pick kube-scheduler metrics support |
|
/jira refresh |
|
@michaelryanmcneill: This pull request references CNTRLPLANE-4321 which is a valid jira issue. 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 openshift-eng/jira-lifecycle-plugin repository. |
|
/refresh |
|
@michaelryanmcneill: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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-sigs/prow repository. I understand the commands that are listed here. |
7273000
into
openshift:release-4.22
What this PR does / why we need it:
Cherry-picks PRs #8489 and #8680 to
release-4.22to enable Prometheus metrics scraping for the kube-scheduler control plane component.PR #8489 adds a CA-signed serving certificate, Service, and ServiceMonitor for the kube-scheduler, replacing the previously auto-generated self-signed certificates. This enables proper mTLS authentication for Prometheus metrics scraping of
/metricsand/metrics/resourcesendpoints.PR #8680 adds the necessary RBAC (ClusterRole and ClusterRoleBinding) in the hosted cluster for the
system:kube-schedulerservice account to access the/metrics/resourcesendpoint.Conflict resolution notes:
hostedcontrolplane_controller.go: The v1reconcileOLMAndMiscCertsfunction was refactored out in release-4.22. The scheduler cert reconciliation was added directly to the existingreconcilePKIfunction instead.kube_scheduler/component.go: Keptutil.AvailabilityProberOpts{}(release-4.22) instead ofpodspec.AvailabilityProberOpts{}(main), while adding the ServiceMonitor manifest adapter.Which issue(s) this PR fixes:
Fixes CNTRLPLANE-4314
Special notes for your reviewer:
hostedcontrolplane_controller.gois the key area to review — the scheduler cert was placed between KCM and CVO certs inreconcilePKI, matching the logical placement from the original PR.Version423(would be skipped on 4.22) and depends ontest/e2e/v2/utilwhich doesn't exist on this branch.Checklist: