Skip to content

USHIFT-6951: Add metrics-server as optional MicroShift component#6808

Open
copejon wants to merge 18 commits into
openshift:mainfrom
copejon:ushift-6951/metrics-server
Open

USHIFT-6951: Add metrics-server as optional MicroShift component#6808
copejon wants to merge 18 commits into
openshift:mainfrom
copejon:ushift-6951/metrics-server

Conversation

@copejon

@copejon copejon commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Add metrics-server as an optional MicroShift component deployed via kustomize manifests and packaged as microshift-metrics-server and microshift-metrics-server-release-info RPM sub-packages.

This is PR 1/3 splitting #6763 into independently-mergeable patches. The three PRs can merge in any order.
Siblings: #6809 (kube-state-metrics), #6810 (node-exporter)

What's included

  • Kustomize manifests (assets/optional/metrics-server/) — Deployment, APIService, RBAC, NetworkPolicy, PDB, service-ca TLS, and openshift-monitoring namespace
  • Kubelet client cert provisioning — dedicated cert under kube-apiserver-to-kubelet-signer, applied as Secret + ConfigMap after the namespace exists (pkg/cmd/metrics.go)
  • Healthcheck registrationmergeWorkloads() function and metrics-server map entry in optional workload paths
  • RPM sub-packages%package metrics-server and %package metrics-server-release-info with per-file installs
  • Otel-collector drop-inotelcol.d/ directory structure and microshift-metrics-server.yaml scrape config; service file updated to load drop-in configs via bash wrapper
  • Auto-rebase integrationupdate_metrics_images() in rebase.sh + assets_metrics.yaml for all three exporters (shared infrastructure lives in this PR)
  • Test infra — RPM names added to test/bin/common.sh

Summary by CodeRabbit

Release Notes

  • New Features
    • Added metrics-server as an optional component, including namespace setup, RBAC, TLS assets, hardened deployment, metrics service exposure, and API registration.
    • Added OpenTelemetry Collector scraping for metrics-server via a new collector drop-in configuration.
  • Chores
    • Added metrics-server optional RPM subpackages and packaging for manifests and release metadata.
    • Updated the MicroShift observability service command handling and improved optional workload merge behavior for checks.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 5, 2026
@openshift-ci-robot

openshift-ci-robot commented Jun 5, 2026

Copy link
Copy Markdown

@copejon: This pull request references USHIFT-6951 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 "5.0.0" version, but no target version was set.

Details

In response to this:

Add metrics-server as an optional MicroShift component deployed via kustomize manifests and packaged as microshift-metrics-server and microshift-metrics-server-release-info RPM sub-packages.

This is PR 1/3 splitting #6763 into independently-mergeable patches. The three PRs can merge in any order.

What's included

  • Kustomize manifests (assets/optional/metrics-server/) — Deployment, APIService, RBAC, NetworkPolicy, PDB, service-ca TLS, and openshift-monitoring namespace
  • Kubelet client cert provisioning — dedicated cert under kube-apiserver-to-kubelet-signer, applied as Secret + ConfigMap after the namespace exists (pkg/cmd/metrics.go)
  • Healthcheck registrationmergeWorkloads() function and metrics-server map entry in optional workload paths
  • RPM sub-packages%package metrics-server and %package metrics-server-release-info with per-file installs
  • Otel-collector drop-inotelcol.d/ directory structure and microshift-metrics-server.yaml scrape config; service file updated to load drop-in configs via bash wrapper
  • Auto-rebase integrationupdate_metrics_images() in rebase.sh + assets_metrics.yaml for all three exporters (shared infrastructure lives in this PR)
  • Test infra — RPM names added to test/bin/common.sh

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.

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

This PR adds metrics-server as an optional observability component to MicroShift. It includes Kubernetes manifests with RBAC and security hardening, TLS certificate provisioning, OpenTelemetry integration, RPM packaging, and build automation to generate per-architecture image overrides and release metadata during rebasing.

Changes

Metrics-Server Component Integration

Layer / File(s) Summary
Kubernetes manifests and resource definitions
assets/optional/metrics-server/00-namespace.yaml, assets/optional/metrics-server/01-service-account.yaml, assets/optional/metrics-server/01-cluster-role.yaml, assets/optional/metrics-server/01-cluster-role-binding.yaml, assets/optional/metrics-server/01-cluster-role-binding-auth-delegator.yaml, assets/optional/metrics-server/01-role-binding-auth-reader.yaml, assets/optional/metrics-server/02-configmap-audit-profiles.yaml, assets/optional/metrics-server/03-deployment.yaml, assets/optional/metrics-server/04-service.yaml, assets/optional/metrics-server/04-api-service.yaml, assets/optional/metrics-server/kustomization.yaml, assets/optional/metrics-server/kustomization.aarch64.yaml, assets/optional/metrics-server/kustomization.x86_64.yaml, assets/optional/metrics-server/release-metrics-server-aarch64.json, assets/optional/metrics-server/release-metrics-server-x86_64.json
Creates openshift-monitoring namespace with pod-security enforcement; defines ServiceAccount, ClusterRole granting read access to nodes/metrics, pods, nodes; sets up ClusterRoleBindings and RoleBinding for API server authentication; deploys container with TLS/cipher config, kubelet connectivity, HTTPS probes, and security hardening (non-root, read-only root, no privilege escalation, dropped capabilities); includes audit profiles ConfigMap; exposes via Service on port 443 and APIService registering metrics.k8s.io/v1beta1; base kustomization lists all resources; architecture-specific overlays pin image digests; release JSON files track per-architecture image metadata.
TLS certificate provisioning
pkg/cmd/init.go, pkg/cmd/run.go, pkg/util/cryptomaterial/certinfo.go, pkg/components/metrics.go
Registers metrics-server kubelet client CSR with midnight-aligned validity and system:metrics-server user info; provides MetricsServerKubeletClientCertDir helper; implements ProvisionMetricsServerCerts to create TLS Secret and CA ConfigMap in openshift-monitoring namespace; integrates provisioning as background goroutine after kustomize startup.
OpenTelemetry Collector integration
packaging/observability/microshift-observability.service, packaging/observability/otelcol.d/microshift-metrics-server.yaml, test/assets/observability/otel_config.yaml
Updates systemd service to load drop-in configs from otelcol.d/; adds Prometheus receiver scraping metrics-server HTTPS endpoint with Kubernetes discovery scoped to openshift-monitoring namespace and target relabeling; connects to batch processor and OTLP exporter; adds test OTLP exporter configuration.
RPM packaging and optional component framework
packaging/rpm/microshift.spec, pkg/healthcheck/microshift_optional_workloads.go, test/bin/common.sh
Adds microshift-metrics-server (x86_64/aarch64) and microshift-metrics-server-release-info (noarch) subpackages; observability depends on metrics-server; installs manifests to /usr/lib/microshift/manifests.d/080-microshift-metrics-server with arch-specific overlays and release JSON; adds workload merging for namespace-scoped optional components; registers metrics-server in RPM lists.
Build automation and rebase framework
scripts/auto-rebase/rebase.sh, scripts/auto-rebase/assets_metrics.yaml
Extends download_release() to clone optional component repos (cluster-monitoring-operator); implements update_metrics_images to generate per-arch release JSON with pinned digests and kustomization overlays by extracting image references from manifests and mapping to OCP release tags; registers metrics-server, kube-state-metrics, and node-exporter in asset mappings with MicroShift customization notes.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (14 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'USHIFT-6951: Add metrics-server as optional MicroShift component' directly and specifically describes the main change: introducing metrics-server as an optional component with full supporting infrastructure.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed PR adds metrics-server component manifests, Go source code, and configuration files. No Ginkgo test files (*_test.go) or test names are introduced in this PR.
Test Structure And Quality ✅ Passed No Ginkgo test files were added or modified in this PR. Test changes are limited to RPM list config and observability assets, not test code. Check is not applicable.
Microshift Test Compatibility ✅ Passed No new Ginkgo e2e tests are added in this PR. Check is not applicable to manifests, Go component code, or build infrastructure changes.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo e2e tests (It(), Describe(), Context(), When()) are added in this PR. The PR adds metrics-server as a Kubernetes component with manifests, configuration files, RPM packaging, and supp...
Topology-Aware Scheduling Compatibility ✅ Passed Deployment uses 1 replica, OS-only nodeSelector (not control-plane targeting), and appropriate master node toleration. No problematic anti-affinity, topology spread, or scheduling constraints that...
Ote Binary Stdout Contract ✅ Passed No OTE stdout contract violations found. All logging in modified code occurs within goroutines or functions, not in main process-level code. fmt.Sprintf returns strings without writing to stdout.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No Ginkgo e2e tests were added in this PR; changes are manifests, packaging, and library code only. Check not applicable.
No-Weak-Crypto ✅ Passed No weak crypto detected. Metrics-server uses only strong TLS ciphers (ECDHE with AES-GCM/CHACHA20-POLY1305, SHA256/384 hashing), standard Kubernetes Secret/ConfigMap storage, and standard file I/O...
Container-Privileges ✅ Passed Container security hardening properly enforced: allowPrivilegeEscalation: false, ALL capabilities dropped, read-only root filesystem, runs as non-root. Namespace uses privileged PSS standard which...
No-Sensitive-Data-In-Logs ✅ Passed No sensitive data exposure in logs found. Certificate content is read but never logged. Logging statements use generic descriptions and file paths only, never exposing secrets, tokens, or PII.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci Bot requested review from eslutsky and pacevedom June 5, 2026 04:30
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 5, 2026
@copejon copejon force-pushed the ushift-6951/metrics-server branch from a185390 to 2f00a69 Compare June 5, 2026 06:29

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 9

🧹 Nitpick comments (1)
packaging/observability/microshift-observability.service (1)

11-11: ⚡ Quick win

Use an argv array instead of a concatenated shell string

Building ARGS as a string is brittle (word-splitting/path edge cases). Use a bash array and quoted expansion.

Proposed change
-ExecStart=/bin/bash -c 'ARGS="--config=file:/etc/microshift/observability/opentelemetry-collector.yaml"; for f in /etc/microshift/observability/otelcol.d/*.yaml; do [ -f "$$f" ] && ARGS="$$ARGS --config=file:$$f"; done; exec /usr/bin/opentelemetry-collector $$ARGS'
+ExecStart=/bin/bash -c 'args=(--config=file:/etc/microshift/observability/opentelemetry-collector.yaml); for f in /etc/microshift/observability/otelcol.d/*.yaml; do [ -f "$$f" ] && args+=(--config=file:$$f); done; exec /usr/bin/opentelemetry-collector "$${args[@]}"'
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packaging/observability/microshift-observability.service` at line 11, The
ExecStart line builds a brittle space-joined ARGS string; change it to build a
bash array and use quoted array expansion when executing the collector:
initialize ARGS=() (or ARGS=()), append elements as
ARGS+=(--config="file:/etc/microshift/observability/opentelemetry-collector.yaml")
and inside the loop for f in /etc/microshift/observability/otelcol.d/*.yaml; do
[ -f "$f" ] && ARGS+=(--config="file:$f"); done; finally exec
/usr/bin/opentelemetry-collector "${ARGS[@]}" so that each --config is a
separate argv element and you avoid word-splitting/path edge cases for the
ExecStart/ARGS usage.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@assets/optional/metrics-server/00-namespace.yaml`:
- Around line 7-9: The namespace-level PodSecurity labels
pod-security.kubernetes.io/enforce, pod-security.kubernetes.io/audit, and
pod-security.kubernetes.io/warn are set to "privileged" which is too permissive;
change their values to a safer profile (e.g., "baseline" or "restricted") unless
you have a documented exception, and ensure the three keys (enforce, audit,
warn) are updated consistently to the chosen profile so namespace-wide policies
default to the tightened posture.

In `@assets/optional/metrics-server/03-deployment.yaml`:
- Around line 67-70: The metrics-server container currently only specifies
resource requests; add a matching limits block under the same resources section
for the metrics-server container to enforce CPU and memory caps (e.g.,
limits.cpu: 100m and limits.memory: 100Mi). Update the Deployment's container
resources block (the metrics-server container in the manifest) to include both
requests and limits so it conforms to the "Resource limits (cpu, memory) on
every container" guideline.
- Around line 71-75: The container securityContext currently sets
allowPrivilegeEscalation, readOnlyRootFilesystem and runAsNonRoot but does not
drop Linux capabilities; update the Pod/Container spec by adding a capabilities
block under securityContext (e.g., in the same container spec that contains
allowPrivilegeEscalation/readOnlyRootFilesystem/runAsNonRoot) with
capabilities.drop set to ["ALL"] so all capabilities are removed by default and
then explicitly add back any minimal capabilities only if absolutely required
elsewhere; ensure the change is applied alongside the existing
terminationMessagePolicy and other securityContext fields.

In `@assets/optional/metrics-server/kustomization.yaml`:
- Around line 3-13: The kustomization.yaml resources list is missing the two
RPM-installed manifests; update the resources array (the same block that
currently lists 00-namespace.yaml, 03-deployment.yaml, 04-service.yaml, etc.) to
include network-policy-downstream.yaml and pod-disruption-budget.yaml so both
NetworkPolicy and PodDisruptionBudget are applied; add those two filenames to
the resources list in assets/optional/metrics-server/kustomization.yaml.

In `@pkg/cmd/metrics.go`:
- Around line 44-50: The polling closure passed to wait.PollUntilContextTimeout
currently treats any Get() error as "not ready" and keeps retrying; change the
logic in the closure used with wait.PollUntilContextTimeout so that after
calling clientset.CoreV1().Namespaces().Get(ctx, ns, metav1.GetOptions{}), if
err == nil return true,nil; if apierrors.IsNotFound(err) log and return
false,nil to keep retrying; for any other error return false, err (so the poll
stops and surfaces auth/TLS/transport failures). Ensure you import/use
apierrors.IsNotFound and update the closure around
clientset.CoreV1().Namespaces().Get accordingly.
- Around line 24-31: The current check uses
util.PathExists(metricsServerManifestPath) so provisioning proceeds whenever the
file exists even if the metrics component is not enabled; change the gating to
verify the component is enabled and that any configured kustomization paths are
present (e.g., read the configured kustomizationPaths or component flag used by
your installer and ensure they are enabled) before attempting cert provisioning.
Update the logic around util.PathExists(metricsServerManifestPath) to first
consult the metrics enablement/config (the same config that controls
installation) and validate each configured kustomization path exists, returning
early if the component is disabled or no configured paths are present.

In `@scripts/auto-rebase/assets_metrics.yaml`:
- Around line 34-37: Update the two YAML asset entries so they match the rest of
the PR naming convention: change the "file" values
"release-metrics-aarch64.json" and "release-metrics-x86_64.json" to
"release-metrics-server-aarch64.json" and "release-metrics-server-x86_64.json"
respectively in the assets_metrics.yaml file (the two "- file:" entries shown),
leaving the corresponding "ignore" values unchanged.

In `@scripts/auto-rebase/assets.yaml`:
- Around line 304-326: The asset list under the optional/metrics-server/ entry
is missing the two manifests that the packaging script expects; update the files
list for the optional/metrics-server/ dir to include entries for
network-policy-downstream.yaml and pod-disruption-budget.yaml so the asset set
matches packaging/rpm/microshift.spec; ensure the new entries use the same
indentation/format as the existing file: ... entries (e.g., add "- file:
network-policy-downstream.yaml" and "- file: pod-disruption-budget.yaml" under
the files: block for the optional/metrics-server/ dir).

In `@scripts/auto-rebase/rebase.sh`:
- Around line 1184-1187: The script currently skips unknown images when
release_tag is empty (checking release_tag, orig_image, component_dir) which
allows silent incomplete kustomization.*.yaml outputs; change the behavior to
fail-fast by replacing the continue path with a non-zero exit (e.g., >&2 echo
descriptive error including orig_image and component_dir, then exit 1) so the
rebase.sh run stops immediately on unmapped images and surfaces the problem to
CI.

---

Nitpick comments:
In `@packaging/observability/microshift-observability.service`:
- Line 11: The ExecStart line builds a brittle space-joined ARGS string; change
it to build a bash array and use quoted array expansion when executing the
collector: initialize ARGS=() (or ARGS=()), append elements as
ARGS+=(--config="file:/etc/microshift/observability/opentelemetry-collector.yaml")
and inside the loop for f in /etc/microshift/observability/otelcol.d/*.yaml; do
[ -f "$f" ] && ARGS+=(--config="file:$f"); done; finally exec
/usr/bin/opentelemetry-collector "${ARGS[@]}" so that each --config is a
separate argv element and you avoid word-splitting/path edge cases for the
ExecStart/ARGS usage.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 25baa466-07b1-4aa1-90d3-a9e96b03c015

📥 Commits

Reviewing files that changed from the base of the PR and between 93e835e and 2f00a69.

📒 Files selected for processing (27)
  • assets/optional/metrics-server/00-namespace.yaml
  • assets/optional/metrics-server/01-cluster-role-binding-auth-delegator.yaml
  • assets/optional/metrics-server/01-cluster-role-binding.yaml
  • assets/optional/metrics-server/01-cluster-role.yaml
  • assets/optional/metrics-server/01-role-binding-auth-reader.yaml
  • assets/optional/metrics-server/01-service-account.yaml
  • assets/optional/metrics-server/02-configmap-audit-profiles.yaml
  • assets/optional/metrics-server/03-deployment.yaml
  • assets/optional/metrics-server/04-api-service.yaml
  • assets/optional/metrics-server/04-service.yaml
  • assets/optional/metrics-server/kustomization.aarch64.yaml
  • assets/optional/metrics-server/kustomization.x86_64.yaml
  • assets/optional/metrics-server/kustomization.yaml
  • assets/optional/metrics-server/release-metrics-server-aarch64.json
  • assets/optional/metrics-server/release-metrics-server-x86_64.json
  • packaging/observability/microshift-observability.service
  • packaging/observability/otelcol.d/microshift-metrics-server.yaml
  • packaging/rpm/microshift.spec
  • pkg/cmd/init.go
  • pkg/cmd/metrics.go
  • pkg/cmd/run.go
  • pkg/healthcheck/microshift_optional_workloads.go
  • pkg/util/cryptomaterial/certinfo.go
  • scripts/auto-rebase/assets.yaml
  • scripts/auto-rebase/assets_metrics.yaml
  • scripts/auto-rebase/rebase.sh
  • test/bin/common.sh

Comment thread assets/optional/metrics-server/00-namespace.yaml
Comment thread assets/optional/metrics-server/03-deployment.yaml Outdated
Comment thread assets/optional/metrics-server/03-deployment.yaml Outdated
Comment thread assets/optional/metrics-server/kustomization.yaml
Comment thread pkg/components/metrics.go
Comment thread pkg/components/metrics.go
Comment thread scripts/auto-rebase/assets_metrics.yaml Outdated
Comment thread scripts/auto-rebase/assets.yaml Outdated
Comment thread scripts/auto-rebase/rebase.sh Outdated
@copejon copejon force-pushed the ushift-6951/metrics-server branch from 2f00a69 to 2552538 Compare June 5, 2026 06:46

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@assets/optional/metrics-server/02-configmap-audit-profiles.yaml`:
- Around line 2-38: The embedded audit policy YAMLs are malformed because keys
and values are written with JSON-style quoted strings; update
metadata-profile.yaml, none-profile.yaml, request-profile.yaml and
requestresponse-profile.yaml inside the ConfigMap data to valid YAML by removing
the unnecessary quotes around keys (apiVersion, kind, metadata, name,
omitStages, rules, level) and unquoting list items (e.g., RequestReceived), and
ensure each rule is a proper mapping (e.g., - level: Metadata) with correct
indentation so each policy is valid Kubernetes audit policy YAML.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 070ff4b2-5dbd-4430-8057-ef1fec980558

📥 Commits

Reviewing files that changed from the base of the PR and between 2f00a69 and 2552538.

⛔ Files ignored due to path filters (3)
  • etcd/vendor/github.com/openshift/microshift/pkg/config/config.go is excluded by !**/vendor/**
  • etcd/vendor/github.com/openshift/microshift/pkg/config/dns.go is excluded by !**/vendor/**
  • etcd/vendor/github.com/openshift/microshift/pkg/util/cryptomaterial/certinfo.go is excluded by !**/vendor/**
📒 Files selected for processing (27)
  • assets/optional/metrics-server/00-namespace.yaml
  • assets/optional/metrics-server/01-cluster-role-binding-auth-delegator.yaml
  • assets/optional/metrics-server/01-cluster-role-binding.yaml
  • assets/optional/metrics-server/01-cluster-role.yaml
  • assets/optional/metrics-server/01-role-binding-auth-reader.yaml
  • assets/optional/metrics-server/01-service-account.yaml
  • assets/optional/metrics-server/02-configmap-audit-profiles.yaml
  • assets/optional/metrics-server/03-deployment.yaml
  • assets/optional/metrics-server/04-api-service.yaml
  • assets/optional/metrics-server/04-service.yaml
  • assets/optional/metrics-server/kustomization.aarch64.yaml
  • assets/optional/metrics-server/kustomization.x86_64.yaml
  • assets/optional/metrics-server/kustomization.yaml
  • assets/optional/metrics-server/release-metrics-server-aarch64.json
  • assets/optional/metrics-server/release-metrics-server-x86_64.json
  • packaging/observability/microshift-observability.service
  • packaging/observability/otelcol.d/microshift-metrics-server.yaml
  • packaging/rpm/microshift.spec
  • pkg/cmd/init.go
  • pkg/cmd/metrics.go
  • pkg/cmd/run.go
  • pkg/healthcheck/microshift_optional_workloads.go
  • pkg/util/cryptomaterial/certinfo.go
  • scripts/auto-rebase/assets.yaml
  • scripts/auto-rebase/assets_metrics.yaml
  • scripts/auto-rebase/rebase.sh
  • test/bin/common.sh
✅ Files skipped from review due to trivial changes (5)
  • assets/optional/metrics-server/kustomization.aarch64.yaml
  • test/bin/common.sh
  • scripts/auto-rebase/assets_metrics.yaml
  • assets/optional/metrics-server/release-metrics-server-x86_64.json
  • assets/optional/metrics-server/release-metrics-server-aarch64.json
🚧 Files skipped from review as they are similar to previous changes (19)
  • pkg/cmd/run.go
  • assets/optional/metrics-server/kustomization.x86_64.yaml
  • assets/optional/metrics-server/01-cluster-role-binding-auth-delegator.yaml
  • assets/optional/metrics-server/00-namespace.yaml
  • assets/optional/metrics-server/kustomization.yaml
  • assets/optional/metrics-server/01-cluster-role.yaml
  • scripts/auto-rebase/assets.yaml
  • assets/optional/metrics-server/01-role-binding-auth-reader.yaml
  • packaging/observability/microshift-observability.service
  • packaging/observability/otelcol.d/microshift-metrics-server.yaml
  • assets/optional/metrics-server/04-api-service.yaml
  • assets/optional/metrics-server/01-cluster-role-binding.yaml
  • pkg/cmd/init.go
  • pkg/healthcheck/microshift_optional_workloads.go
  • assets/optional/metrics-server/01-service-account.yaml
  • pkg/cmd/metrics.go
  • assets/optional/metrics-server/03-deployment.yaml
  • packaging/rpm/microshift.spec
  • scripts/auto-rebase/rebase.sh

Comment thread assets/optional/metrics-server/02-configmap-audit-profiles.yaml
@copejon copejon force-pushed the ushift-6951/metrics-server branch from 2552538 to 6f8a50b Compare June 5, 2026 07:24
@coderabbitai coderabbitai Bot added the ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review label Jun 5, 2026
@copejon copejon force-pushed the ushift-6951/metrics-server branch from 6f8a50b to 82550e8 Compare June 5, 2026 07:37
@coderabbitai coderabbitai Bot removed the ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review label Jun 5, 2026
@copejon copejon force-pushed the ushift-6951/metrics-server branch 2 times, most recently from 9cc9d0e to 261c1a0 Compare June 5, 2026 08:12

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
scripts/auto-rebase/rebase.sh (1)

1191-1193: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Do not skip unmapped manifest images.

Still valid from the earlier review: warning-and-continue here can emit a partial kustomization.${arch}.yaml, so the rebase succeeds with broken output.

Patch
                 if [[ -z "${release_tag}" ]]; then
-                    >&2 echo "WARNING: Unknown metrics image '${orig_image}' in ${component_dir}, skipping"
-                    continue
+                    >&2 echo "ERROR: Unknown metrics image '${orig_image}' in ${component_dir}"
+                    return 1
                 fi
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/auto-rebase/rebase.sh` around lines 1191 - 1193, The current block in
rebase.sh that checks if [[ -z "${release_tag}" ]] and then echoes a warning and
continues causes partial kustomization.${arch}.yaml output when an image
(orig_image) isn't in the mapping; instead, stop skipping: when release_tag is
empty, still emit the image into the kustomization entry (use orig_image as the
image reference or a sensible fallback) and log the warning but do not use
continue; update the code paths that write into kustomization.${arch}.yaml so
they handle unmapped images (referencing variables release_tag, orig_image and
component_dir) and ensure the resulting kustomization.${arch}.yaml always
includes an image entry for every manifest image.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/auto-rebase/rebase.sh`:
- Around line 1169-1176: The script assumes jq successfully finds a pullspec;
validate that the jq result is non-empty before writing files: after computing
release_tag and new_image (from the jq command that selects .from.name), check
if new_image is empty (or if new_digest parsed from new_image is empty), and if
so emit a clear error mentioning the release_tag and json_key and exit with a
non-zero status instead of writing component_release_json; apply the same guard
to the other identical block (the one that mirrors lines ~1196-1204) so
malformed release-*.json / kustomization.*.yaml are never created when the
payload tag is missing.

---

Duplicate comments:
In `@scripts/auto-rebase/rebase.sh`:
- Around line 1191-1193: The current block in rebase.sh that checks if [[ -z
"${release_tag}" ]] and then echoes a warning and continues causes partial
kustomization.${arch}.yaml output when an image (orig_image) isn't in the
mapping; instead, stop skipping: when release_tag is empty, still emit the image
into the kustomization entry (use orig_image as the image reference or a
sensible fallback) and log the warning but do not use continue; update the code
paths that write into kustomization.${arch}.yaml so they handle unmapped images
(referencing variables release_tag, orig_image and component_dir) and ensure the
resulting kustomization.${arch}.yaml always includes an image entry for every
manifest image.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 33a078aa-483a-4842-a2dd-2d3d185e3f96

📥 Commits

Reviewing files that changed from the base of the PR and between 82550e8 and 4aa1099.

⛔ Files ignored due to path filters (3)
  • etcd/vendor/github.com/openshift/microshift/pkg/config/config.go is excluded by !**/vendor/**
  • etcd/vendor/github.com/openshift/microshift/pkg/config/dns.go is excluded by !**/vendor/**
  • etcd/vendor/github.com/openshift/microshift/pkg/util/cryptomaterial/certinfo.go is excluded by !**/vendor/**
📒 Files selected for processing (27)
  • assets/optional/metrics-server/00-namespace.yaml
  • assets/optional/metrics-server/01-cluster-role-binding-auth-delegator.yaml
  • assets/optional/metrics-server/01-cluster-role-binding.yaml
  • assets/optional/metrics-server/01-cluster-role.yaml
  • assets/optional/metrics-server/01-role-binding-auth-reader.yaml
  • assets/optional/metrics-server/01-service-account.yaml
  • assets/optional/metrics-server/02-configmap-audit-profiles.yaml
  • assets/optional/metrics-server/03-deployment.yaml
  • assets/optional/metrics-server/04-api-service.yaml
  • assets/optional/metrics-server/04-service.yaml
  • assets/optional/metrics-server/kustomization.aarch64.yaml
  • assets/optional/metrics-server/kustomization.x86_64.yaml
  • assets/optional/metrics-server/kustomization.yaml
  • assets/optional/metrics-server/release-metrics-server-aarch64.json
  • assets/optional/metrics-server/release-metrics-server-x86_64.json
  • packaging/observability/microshift-observability.service
  • packaging/observability/otelcol.d/microshift-metrics-server.yaml
  • packaging/rpm/microshift.spec
  • pkg/cmd/init.go
  • pkg/cmd/metrics.go
  • pkg/cmd/run.go
  • pkg/healthcheck/microshift_optional_workloads.go
  • pkg/util/cryptomaterial/certinfo.go
  • scripts/auto-rebase/assets.yaml
  • scripts/auto-rebase/assets_metrics.yaml
  • scripts/auto-rebase/rebase.sh
  • test/bin/common.sh
✅ Files skipped from review due to trivial changes (4)
  • packaging/observability/microshift-observability.service
  • assets/optional/metrics-server/kustomization.yaml
  • assets/optional/metrics-server/kustomization.aarch64.yaml
  • test/bin/common.sh
🚧 Files skipped from review as they are similar to previous changes (20)
  • assets/optional/metrics-server/release-metrics-server-aarch64.json
  • assets/optional/metrics-server/01-service-account.yaml
  • pkg/healthcheck/microshift_optional_workloads.go
  • assets/optional/metrics-server/01-cluster-role.yaml
  • assets/optional/metrics-server/04-api-service.yaml
  • assets/optional/metrics-server/00-namespace.yaml
  • assets/optional/metrics-server/01-cluster-role-binding.yaml
  • assets/optional/metrics-server/02-configmap-audit-profiles.yaml
  • assets/optional/metrics-server/04-service.yaml
  • pkg/cmd/run.go
  • assets/optional/metrics-server/03-deployment.yaml
  • packaging/observability/otelcol.d/microshift-metrics-server.yaml
  • scripts/auto-rebase/assets_metrics.yaml
  • assets/optional/metrics-server/kustomization.x86_64.yaml
  • pkg/cmd/init.go
  • scripts/auto-rebase/assets.yaml
  • packaging/rpm/microshift.spec
  • assets/optional/metrics-server/01-role-binding-auth-reader.yaml
  • pkg/cmd/metrics.go
  • assets/optional/metrics-server/01-cluster-role-binding-auth-delegator.yaml

Comment thread scripts/auto-rebase/rebase.sh Outdated
@copejon

copejon commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

@CodeRabbit review

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@copejon copejon force-pushed the ushift-6951/metrics-server branch from f70198d to 0a515ed Compare June 5, 2026 18:33
@copejon

copejon commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

@CodeRabbit review

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot added the ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review label Jun 8, 2026
Comment thread test/assets/observability/otel_config.yaml
@copejon

copejon commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

@CodeRabbit help

@copejon copejon force-pushed the ushift-6951/metrics-server branch from f204ce6 to 9893ecd Compare June 9, 2026 22:21
@copejon

copejon commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

/test e2e-aws-tests-bootc-periodic-arm-el10

@copejon copejon force-pushed the ushift-6951/metrics-server branch from 9893ecd to 01cda48 Compare June 11, 2026 05:26
@copejon copejon force-pushed the ushift-6951/metrics-server branch from 7b1cdef to 2c93779 Compare June 17, 2026 09:37
@pmtk

pmtk commented Jun 17, 2026

Copy link
Copy Markdown
Member

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 17, 2026
@pmtk

pmtk commented Jun 17, 2026

Copy link
Copy Markdown
Member

/lgtm cancel

@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Jun 17, 2026
@pmtk

pmtk commented Jun 17, 2026

Copy link
Copy Markdown
Member

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 17, 2026
@openshift-ci

openshift-ci Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: copejon, pmtk

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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

copejon added 4 commits June 17, 2026 09:22
Signed-off-by: Jonathan H. Cope <jcope@redhat.com>
Signed-off-by: Jonathan H. Cope <jcope@redhat.com>
use resourceapply for idempotent secret/configmap apply with retry,
return (false, nil) on transient API errors so polling continues,
propagate errors synchronously instead of fire-and-forget goroutine

Signed-off-by: Jonathan H. Cope <jcope@redhat.com>
add KubeletServingCAPath containing only kubelet-signer and
kube-csr-signer; use it instead of the broader KubeletClientCAPath

Signed-off-by: Jonathan H. Cope <jcope@redhat.com>
@copejon copejon force-pushed the ushift-6951/metrics-server branch from 2c93779 to 8aea5c2 Compare June 17, 2026 14:32
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Jun 17, 2026
@openshift-ci

openshift-ci Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

New changes are detected. LGTM label has been removed.

@copejon

copejon commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

/retest

Comment thread pkg/cmd/init.go
Comment on lines +374 to +377
).WithCABundle(
cryptomaterial.KubeletServingCAPath(certsDir),
[]string{"kubelet-signer"},
[]string{"kubelet-signer", "kube-csr-signer"},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

wondering if this would fit in the previous CA bundle, there is only 1 difference and its just CAs.

Comment thread pkg/components/metrics.go

var metricsEventRecorder events.Recorder = events.NewLoggingEventRecorder("microshift-metrics-server", clock.RealClock{})

func ProvisionMetricsServerCerts(ctx context.Context, cfg *config.Config) error {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Wondering if this function should be asynchronous. For an optional component it would block MicroShift readiness until its ready, and this is the only component doing this that I know of.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ah that's a good point. will fix

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment thread pkg/cmd/run.go
// Provision certs for optional components after kustomize creates their namespaces.
if err := components.ProvisionMetricsServerCerts(runCtx, cfg); err != nil {
return fmt.Errorf("failed to provision metrics-server certs: %w", err)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

hi @copejon if I understand this block correctly, it blocks the go routine until the metrics server is installed and running. Also if there's any failure it reports microshift failed to start, right? Is this the desired behavior? It looks to me an overkill to report microshift failure if an extra component instalation fails.

Comment thread pkg/components/metrics.go
err = wait.PollUntilContextTimeout(ctx, 2*time.Second, 1*time.Minute, true, func(ctx context.Context) (bool, error) {
_, _, err := resourceapply.ApplyConfigMap(ctx, clientset.CoreV1(), metricsEventRecorder, cm)
if err != nil {
return false, fmt.Errorf("applying kubelet serving CA configmap: %w", err)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

hi @copejon, I'm comparing the error handeling of this ConfigMap apply function with the previous Secret apply function and I see few differences I don't quite understand, can you please review it?

  • Secret in line 92 does not return error only log the error, but ConfigMap on line 122 returns the error.
  • Secret in line 98 return error with %w and ConfigMap in line 127 return error with %v

copejon added 6 commits June 19, 2026 12:18
Remove otelcol drop-in config, revert observability service ExecStart
to single-config mode, and drop otelcol-related lines from the RPM
spec. Observability integration is deferred to a follow-up PR.

Signed-off-by: Jonathan H. Cope <jcope@redhat.com>
Move MS asset tracking and image update logic out of the shared
rebase.sh. Delete the separate assets_metrics.yaml and update
presubmit.py to reference the new unified asset file.

Signed-off-by: Jonathan H. Cope <jcope@redhat.com>
Add rebase_cluster_monitoring_operator.sh and its asset manifest for
rebasing metrics exporters from the cluster-monitoring-operator repo.
The script handles download, manifest copy, and image updates for all
three exporters, keyed on which asset directories exist on the branch.

Signed-off-by: Jonathan H. Cope <jcope@redhat.com>
…tical across the 3 PRs

Signed-off-by: Jonathan H. Cope <jcope@redhat.com>
Signed-off-by: Jonathan H. Cope <jcope@redhat.com>
@copejon copejon force-pushed the ushift-6951/metrics-server branch from 8aea5c2 to e6f9dc8 Compare June 19, 2026 21:43
@copejon

copejon commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

Scheduling failures blocking some of the tests from starting: There are no nodes that your pod can schedule to

/test e2e-aws-tests-bootc-el10
/test e2e-aws-tests-periodic-arm
/test ocp-full-conformance-serial-rhel-eus

@openshift-ci

openshift-ci Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

@copejon: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-tests-bootc-arm-el9 e6f9dc8 link true /test e2e-aws-tests-bootc-arm-el9
ci/prow/ocp-full-conformance-serial-rhel-eus e6f9dc8 link true /test ocp-full-conformance-serial-rhel-eus
ci/prow/e2e-aws-tests-bootc-periodic-el10 e6f9dc8 link true /test e2e-aws-tests-bootc-periodic-el10
ci/prow/e2e-aws-tests-bootc-periodic-arm-el10 e6f9dc8 link true /test e2e-aws-tests-bootc-periodic-arm-el10
ci/prow/e2e-aws-tests-bootc-el9 e6f9dc8 link true /test e2e-aws-tests-bootc-el9
ci/prow/e2e-aws-tests-periodic e6f9dc8 link true /test e2e-aws-tests-periodic
ci/prow/e2e-aws-tests-periodic-arm e6f9dc8 link true /test e2e-aws-tests-periodic-arm

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants