Skip to content

fix(prometheus-operator-crds): ship full upstream CRD bundle - #2660

Merged
Aleksei Sviridkin (lexfrei) merged 2 commits into
mainfrom
daniil/fix-prometheus-operator-crds-full-bundle
Jun 16, 2026
Merged

fix(prometheus-operator-crds): ship full upstream CRD bundle#2660
Aleksei Sviridkin (lexfrei) merged 2 commits into
mainfrom
daniil/fix-prometheus-operator-crds-full-bundle

Conversation

@myasnikovdaniil

@myasnikovdaniil myasnikovdaniil commented May 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Drop the rm -f line in packages/system/prometheus-operator-crds/Makefile so the full upstream CRD bundle (10 CRDs) ships instead of the 4-CRD subset.
  • Pin helm pull --version 25.0.0 to keep the operator CRD version at v0.87.0 (operator version bump is intentionally out of scope here).
  • Re-run make update to repopulate charts/crds/templates/ with the 6 previously-stripped CRDs: Alertmanager, AlertmanagerConfig, Prometheus, PrometheusAgent, ScrapeConfig, ThanosRuler. The 4 already-vendored CRDs are byte-identical (version pin holds).

Why

The bundle was originally trimmed to the 4 service-discovery CRDs that VictoriaMetrics operator needs (ServiceMonitor, PodMonitor, PrometheusRule, Probe). That was correct when the chart was vendored inside system/victoria-metrics-operator (ba5c785cc, Dec 2023), but the prune was carried over verbatim when the chart was extracted to its own package, and again when the CRD release was propagated into tenant Kubernetes clusters (1e2b66131, Dec 2025).

In tenant clusters the partial set blocks third-party apps that ship their own prometheus-operator (e.g. kube-prometheus-stack): they cannot deploy Prometheus/Alertmanager instances because the platform-managed CRD set is incomplete, and --server-side --force-conflicts workarounds get reverted by Flux as it re-reconciles the narrower release manifest.

With the full bundle shipping, tenant apps can set crds.enabled: false on their kube-prometheus-stack release and consume the platform CRDs directly — the standard pattern for platform-level CRDs shared between multiple stacks.

Test plan

  • helm template ./charts/prometheus-operator-crds renders 10 CustomResourceDefinition resources, all in monitoring.coreos.com API group.
  • helm template packages/apps/kubernetes -f tests/values/common.yaml renders cleanly (75 kinds).
  • helm unittest packages/apps/kubernetes — 6 suites, 123 tests, all pass.
  • No in-repo consumer hardcodes the 4-CRD list (verified by grep).
  • Smoke-test on a tenant cluster: confirm kube-prometheus-stack with crds.enabled: false installs cleanly and the operator can manage Prometheus/Alertmanager instances against the platform CRDs.

Out of scope

  • Bumping the operator CRD version past v0.87.0 — separate concern.
  • Switching from HelmRelease to a Flux Kustomization for CRD application — bigger refactor; current Helm ownership is fine now that the bundle is complete and downstream apps can opt out of installing CRDs.

Summary by CodeRabbit

  • Chores
    • Pinned the prometheus-operator-crds Helm chart pull to version 25.0.0 for consistent regeneration.
    • Streamlined the update workflow by removing the existing generated charts directory before pulling the chart, improving build cleanliness.
    • Removed the extra post-pull cleanup step that previously deleted selected generated CRD templates.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request updates the prometheus-operator-crds package to include the complete set of upstream CRDs. By removing the manual pruning of the CRD bundle and pinning the Helm chart version, the platform now provides a comprehensive set of monitoring resources. This change facilitates better interoperability for tenant applications that require standard Prometheus Operator CRDs, preventing conflicts and allowing for a cleaner management pattern within the cluster.

Highlights

  • Full CRD Bundle Restoration: Removed the cleanup step in the Makefile that was pruning the Prometheus Operator CRD set, allowing all 10 upstream CRDs to be shipped instead of a limited subset.
  • Version Pinning: Pinned the Helm chart version to 25.0.0 to ensure stability and maintain the current operator version (v0.87.0) while enabling the full CRD bundle.
  • Improved Compatibility: Enables tenant applications (like kube-prometheus-stack) to use platform-managed CRDs by setting crds.enabled: false, resolving conflicts with third-party operator deployments.
New Features

🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Ignored Files
  • Ignored by pattern: **/charts/** (6)
    • packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/charts/crds/templates/crd-alertmanagerconfigs.yaml
    • packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/charts/crds/templates/crd-alertmanagers.yaml
    • packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/charts/crds/templates/crd-prometheusagents.yaml
    • packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/charts/crds/templates/crd-prometheuses.yaml
    • packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/charts/crds/templates/crd-scrapeconfigs.yaml
    • packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/charts/crds/templates/crd-thanosrulers.yaml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment Gemini (@gemini-code-assist) Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on Gemini (@gemini-code-assist) comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions github-actions Bot added size/XS This PR changes 0-9 lines, ignoring generated files area/uncategorized PR auto-labeler could not map title scope to a known area/*; please review kind/bug Categorizes issue or PR as related to a bug labels May 15, 2026
@coderabbitai

coderabbitai Bot commented May 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a5e07965-7109-4bb6-8514-b96e9c10b41c

📥 Commits

Reviewing files that changed from the base of the PR and between 01b7341 and 97cf585.

📒 Files selected for processing (7)
  • packages/system/prometheus-operator-crds/Makefile
  • packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/charts/crds/templates/crd-alertmanagerconfigs.yaml
  • packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/charts/crds/templates/crd-alertmanagers.yaml
  • packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/charts/crds/templates/crd-prometheusagents.yaml
  • packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/charts/crds/templates/crd-prometheuses.yaml
  • packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/charts/crds/templates/crd-scrapeconfigs.yaml
  • packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/charts/crds/templates/crd-thanosrulers.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/system/prometheus-operator-crds/Makefile

📝 Walkthrough

Walkthrough

The Prometheus Operator CRDs Makefile is updated to pin the chart version to 25.0.0 and simplify the pull process by removing the post-extraction template cleanup step, instead starting with a complete directory removal and fresh extraction.

Changes

CRDs Chart Update

Layer / File(s) Summary
Helm pull with pinned version and cleanup removal
packages/system/prometheus-operator-crds/Makefile
The update target now explicitly removes the charts/prometheus-operator-crds directory before pulling, pins the helm pull command to --version 25.0.0, and removes the subsequent selective deletion of CRD templates from the extracted chart.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A makefile springs fresh with version pinned tight,
Twenty-five point zero shines in the night,
Old directories swept, no templates to prune,
Helm charts pull clean beneath the June moon. 📦

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main change: shipping the full upstream Prometheus Operator CRD bundle instead of a pruned subset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch daniil/fix-prometheus-operator-crds-full-bundle

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.

@dosubot dosubot Bot added the area/monitoring Issues or PRs related to the monitoring stack (vlogs, vmstack, grafana, workloadmonitor) label May 15, 2026

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request updates the prometheus-operator-crds package by pinning the Helm chart to version 25.0.0 and removing the manual filtering of CRD templates in the Makefile. The reviewer identified a missing release-note block in the PR description, which is required by the style guide, and suggested adding a command to remove the target directory before pulling the chart to ensure a clean state.

helm repo update prometheus-community
helm pull prometheus-community/prometheus-operator-crds --untar --untardir charts
rm -f -- `find charts/prometheus-operator-crds/charts/crds/templates -maxdepth 1 -mindepth 1 | grep -v 'servicemonitor\|podmonitor\|prometheusrule\|probe'`
helm pull prometheus-community/prometheus-operator-crds --version 25.0.0 --untar --untardir charts

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.

low

The pull request description is missing the required release-note block. According to the repository style guide (Rule 51), every PR must include a release note block in the following format:

```release-note
type(scope): human-readable changelog entry

<details>
<summary>References</summary>

1. PR body must contain a release note block. <sup>([link](https://github.com/cozystack/cozystack/blob/main/.gemini/styleguide.md))</sup>
</details>

helm repo update prometheus-community
helm pull prometheus-community/prometheus-operator-crds --untar --untardir charts
rm -f -- `find charts/prometheus-operator-crds/charts/crds/templates -maxdepth 1 -mindepth 1 | grep -v 'servicemonitor\|podmonitor\|prometheusrule\|probe'`
helm pull prometheus-community/prometheus-operator-crds --version 25.0.0 --untar --untardir charts

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.

low

To ensure a clean state and avoid stale files from previous versions or manual edits, it is recommended to remove the target directory before running helm pull.

	rm -rf charts/prometheus-operator-crds
	helm pull prometheus-community/prometheus-operator-crds --version 25.0.0 --untar --untardir charts

@lexfrei Aleksei Sviridkin (lexfrei) removed the area/uncategorized PR auto-labeler could not map title scope to a known area/*; please review label May 25, 2026
@myasnikovdaniil myasnikovdaniil self-assigned this May 28, 2026
@myasnikovdaniil
myasnikovdaniil force-pushed the daniil/fix-prometheus-operator-crds-full-bundle branch from a720bdb to f132741 Compare June 5, 2026 08:56
@github-actions github-actions Bot added the area/uncategorized PR auto-labeler could not map title scope to a known area/*; please review label Jun 5, 2026
@myasnikovdaniil
myasnikovdaniil force-pushed the daniil/fix-prometheus-operator-crds-full-bundle branch from f132741 to b3a3d5c Compare June 8, 2026 15:02
@myasnikovdaniil
myasnikovdaniil changed the base branch from main to daniil/split-drop-retry June 8, 2026 15:02
@lexfrei
Aleksei Sviridkin (lexfrei) changed the base branch from daniil/split-drop-retry to main June 9, 2026 14:21

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.

LGTM — restores the full upstream prometheus-operator CRD bundle through the package's own make update path; the change is mechanical, reproducible, version-pinned, and introduces no CRD-ownership conflicts.

Business context: the vendored bundle was pruned to the 4 service-discovery CRDs VictoriaMetrics operator needs. In tenant clusters that partial set blocks third-party apps shipping their own prometheus-operator (e.g. kube-prometheus-stack) from creating Prometheus/Alertmanager instances. Shipping the full 10-CRD bundle lets those apps set crds.enabled: false and consume the platform CRDs.

Verified

  • Only the Makefile + 6 new CRD files change; the 4 pre-existing CRDs (servicemonitors, podmonitors, prometheusrules, probes) are untouched → byte-identical, confirming the --version 25.0.0 pin holds the operator CRDs at v0.87.0.
  • helm template renders exactly 10 monitoring.coreos.com CRDs.
  • None of the 6 added kinds (Prometheus, Alertmanager, AlertmanagerConfig, PrometheusAgent, ScrapeConfig, ThanosRuler) are defined by any other package → no Flux ownership conflict.
  • The tenant CRD HelmRelease is reconciled by Flux helm-controller (not client-side kubectl), so the large-CRD "metadata.annotations: Too long" failure mode does not apply.
  • The earlier suggestion to rm -rf the chart dir before helm pull is already implemented by the second commit.

Non-blocking follow-ups

  1. The tenant prometheus-operator-crds HelmRelease has remediation.retries: -1 and no timeout (defaults to 5m); this PR roughly 2.5×'s its payload (4→10 CRDs). CRD application is fast so 5m is very likely sufficient, but it is the same latent remediation-cycle shape that #2727 addresses for csi — a timeout: 10m here would be consistent.
  2. The PR body is missing the release-note block (style-guide nit).

@lexfrei
Aleksei Sviridkin (lexfrei) force-pushed the daniil/fix-prometheus-operator-crds-full-bundle branch from b3a3d5c to 01b7341 Compare June 10, 2026 17:25
The chart previously stripped the bundle to 4 CRDs (ServiceMonitor,
PodMonitor, PrometheusRule, Probe) — the set VictoriaMetrics operator
needs for service discovery. This was correct when the chart was
vendored inside system/victoria-metrics-operator (commit ba5c785,
2023), but the prune was carried over when the chart was extracted
to its own package, and again when the CRDs were propagated into
tenant Kubernetes clusters (commit 1e2b661, 2025).

In tenant clusters the partial set blocks third-party apps that ship
their own prometheus-operator (e.g. kube-prometheus-stack) — the
missing CRDs (Prometheus, Alertmanager, AlertmanagerConfig,
PrometheusAgent, ScrapeConfig, ThanosRuler) prevent the operator from
deploying its instances against the platform-managed CRD set.

Drop the rm -f line in the Makefile so the full upstream bundle ships,
and pin --version 25.0.0 to keep the operator CRD version at v0.87.0
(operator version bump is a separate concern, out of scope here).

Tenant apps can now set crds.enabled: false on their kube-prometheus-
stack release and consume the platform CRDs directly.

Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
Add `rm -rf charts/prometheus-operator-crds` before `helm pull` in the
update target so stale files from previous chart versions don't linger
across updates. This matches the convention used by cilium,
external-secrets-operator, external-dns, and cert-manager Makefiles.

Address review feedback from gemini-code-assist on
packages/system/prometheus-operator-crds/Makefile:9.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
@myasnikovdaniil
myasnikovdaniil force-pushed the daniil/fix-prometheus-operator-crds-full-bundle branch from 01b7341 to 97cf585 Compare June 16, 2026 09:22
@lexfrei
Aleksei Sviridkin (lexfrei) merged commit 8a23f84 into main Jun 16, 2026
9 of 10 checks passed
@lexfrei
Aleksei Sviridkin (lexfrei) deleted the daniil/fix-prometheus-operator-crds-full-bundle branch June 16, 2026 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/monitoring Issues or PRs related to the monitoring stack (vlogs, vmstack, grafana, workloadmonitor) area/uncategorized PR auto-labeler could not map title scope to a known area/*; please review kind/bug Categorizes issue or PR as related to a bug size/XS This PR changes 0-9 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants