Skip to content

Granular kubernetes application extensions dependencies - #1683

Merged
Andrei Kvapil (kvaps) merged 9 commits into
mainfrom
kubernetes-app-deps
Dec 5, 2025
Merged

Granular kubernetes application extensions dependencies#1683
Andrei Kvapil (kvaps) merged 9 commits into
mainfrom
kubernetes-app-deps

Conversation

@nbykov0

@nbykov0 Nikita (nbykov0) commented Dec 3, 2025

Copy link
Copy Markdown
Collaborator

What this PR does

More granular k8s app extensions dependencies.

As a part of the change, packages were updated:

  • monitoring-agents: metrics-server moved to a separate package
  • monitoring-agents: prometheus-operator-crds moved to a separate package

Main Cozystack bundles were updated to reflect packages changes.

Release note

Granular k8s extensions dependencies.

Summary by CodeRabbit

  • New Features

    • Added a standalone metrics-server release and a prometheus-operator-crds release.
  • Improvements

    • Expanded Prometheus-related CRDs with new configuration options and status subresources.
    • Adjusted monitoring orchestration so components (cilium, metrics, CRDs) install in a clearer order.
  • Refactor

    • Split metrics-server out of the monitoring-agents bundle and moved Prometheus CRDs into a dedicated package.

✏️ Tip: You can customize this high-level summary in your review settings.

Signed-off-by: nbykov0 <166552198+nbykov0@users.noreply.github.com>
Signed-off-by: nbykov0 <166552198+nbykov0@users.noreply.github.com>
Signed-off-by: nbykov0 <166552198+nbykov0@users.noreply.github.com>
Signed-off-by: nbykov0 <166552198+nbykov0@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Dec 3, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

This PR extracts and adds metrics-server and prometheus-operator-crds as separate Helm chart packages and HelmReleases, updates bundle and HelmRelease dependency graphs to include them, removes prometheus-operator-crds integration from victoria-metrics-operator, adjusts cilium dependsOn entries across several HelmRelease templates, and updates multiple CRD templates and tooling for prometheus-operator-crds.

Changes

Cohort / File(s) Summary
Kubernetes delete hook refactoring
packages/apps/kubernetes/templates/delete.yaml
Job metadata.name renamed to {{ .Release.Name }}-pre-cleanup; hook-delete-policy entries updated (removed hook-failed from Job policy; ServiceAccount annotation ordering changed).
HelmRelease dependency adjustments
packages/apps/kubernetes/templates/helmreleases/...
packages/apps/kubernetes/templates/helmreleases/cert-manager-crds.yaml, .../csi.yaml, .../vertical-pod-autoscaler-crds.yaml, .../volumesnapshot-crd.yaml, .../monitoring-agents.yaml, .../metrics-server.yaml, .../prometheus-operator-crds.yaml
Removed or moved {{ .Release.Name }}-cilium entries across several dependsOn lists; added unconditional cilium dependency to CSI; added new HelmReleases for metrics-server and prometheus-operator-crds; appended prometheus-operator-crds and metrics-server to monitoring-agents dependsOn.
Bundle updates (add releases & deps)
packages/core/platform/bundles/{distro-full,distro-hosted,paas-full,paas-hosted}.yaml
Added prometheus-operator-crds and metrics-server releases; updated victoria-metrics-operator and monitoring-agents dependsOn lists to include new releases.
New metrics-server package
packages/system/metrics-server/{Chart.yaml,Makefile,values.yaml}
New Helm chart metadata, Makefile update target for pulling chart, and default values (defaultArgs, metrics enabled, serviceMonitor enabled).
New prometheus-operator-crds package & chart metadata
packages/system/prometheus-operator-crds/{Chart.yaml,Makefile,values.yaml}
New Helm chart package with Chart.yaml, Makefile update target (fetch CRDs), values enabling individual CRDs and annotations block.
prometheus-operator-crds: CRD schema additions & gating
packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/charts/crds/templates/crd-{podmonitors,probes,servicemonitors,prometheusrules}.yaml
Added Helm conditionals to emit CRDs only when enabled, bumped controller/operator versions, expanded schemas with new fields (proxyUrl, noProxy, proxyConnectHeader, params, convertClassicHistogramsToNHCB, status subresources), and added PrometheusRule CRD template (or in some places removed depending on chart split).
prometheus-operator-crds build tooling
.../charts/prometheus-operator-crds/hack/{renovate-post-upgrade-hook.sh,update_crds.sh}
Added renovate-post-upgrade-hook.sh and an automated update_crds.sh to fetch CRDs and wrap them in Helm conditionals and annotation templating.
prometheus-operator-crds chart bump & docs
packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/{Chart.yaml,README.md}
Bumped chart/appVersion (chart -> 25.0.0, appVersion -> 0.87.0) and updated README to OCI-focused usage.
monitoring-agents refactor
packages/system/monitoring-agents/{Makefile,values.yaml}
Removed metrics-server repo/pull steps from Makefile; removed metrics-server top-level block and its sub-keys from values.yaml.
victoria-metrics-operator cleanup
packages/system/victoria-metrics-operator/{Makefile,charts/prometheus-operator-crds/...}
Removed prometheus-operator-crds fetch/update steps from Makefile, deleted crd-prometheusrules.yaml, removed old update_crds.sh, and removed CRD annotations from values.yaml.
prometheus-operator-crds chart internals (chart bump)
packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/charts/prometheus-operator-crds/Chart.yaml
Increased appVersion and chart version inside vendored chart to newer releases.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

  • Files/areas to focus on:
    • CRD schema changes (podmonitors, probes, servicemonitors): new fields, status subresources, and validation patterns.
    • New and modified HelmRelease dependsOn ordering and unconditional vs conditional entries (cilium, metrics-server, prometheus-operator-crds).
    • Bundle YAMLs updating dependency graphs across distro/paas variants.
    • New scripts: update_crds.sh and renovate-post-upgrade-hook.sh behavior and error handling.
    • Removal of CRD generation from victoria-metrics-operator and ensuring no remaining references to deleted files.

Possibly related PRs

Suggested labels

lgtm

Suggested reviewers

  • kvaps
  • lllamnyp

Poem

🐇✨
I hopped through charts and CRD boughs,
Split metrics out and swept the prow;
Prometheus maps grew finer lines,
Dependencies sang new designs.
A carrot for each CI pass now!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly summarizes the main objective: reorganizing Kubernetes application extension dependencies into more granular packages (metrics-server and prometheus-operator-crds separated).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch kubernetes-app-deps

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.

@nbykov0 Nikita (nbykov0) changed the title Kubernetes app deps Granular kubernetes application extensions dependencies Dec 3, 2025
@nbykov0 Nikita (nbykov0) self-assigned this Dec 3, 2025
@nbykov0
Nikita (nbykov0) marked this pull request as ready for review December 3, 2025 16:07
@dosubot dosubot Bot added size/L This PR changes 100-499 lines, ignoring generated files kind/feature Categorizes issue or PR as related to a new feature labels Dec 3, 2025

@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: 5

🧹 Nitpick comments (3)
packages/system/prometheus-operator-crds/Chart.yaml (1)

2-2: Consider adding chart metadata.

While not required, adding a description field and type field would improve discoverability:

description: Prometheus Operator Custom Resource Definitions
type: application
packages/system/metrics-server/Chart.yaml (1)

2-2: Consider adding chart metadata for consistency.

Similar to prometheus-operator-crds, consider adding:

description: Kubernetes Metrics Server for Cozystack
type: application
packages/system/metrics-server/Makefile (1)

1-10: Add .PHONY declaration for Make targets.

The Makefile lacks a .PHONY declaration, which helps Make distinguish targets from files and improves portability.

+.PHONY: update
+
 export NAME=metrics-server
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 52ebcae and 3f3ee43.

⛔ Files ignored due to path filters (1)
  • packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/Chart.lock is excluded by !**/*.lock
📒 Files selected for processing (32)
  • packages/apps/kubernetes/templates/delete.yaml (2 hunks)
  • packages/apps/kubernetes/templates/helmreleases/cert-manager-crds.yaml (0 hunks)
  • packages/apps/kubernetes/templates/helmreleases/csi.yaml (1 hunks)
  • packages/apps/kubernetes/templates/helmreleases/metrics-server.yaml (1 hunks)
  • packages/apps/kubernetes/templates/helmreleases/monitoring-agents.yaml (1 hunks)
  • packages/apps/kubernetes/templates/helmreleases/prometheus-operator-crds.yaml (1 hunks)
  • packages/apps/kubernetes/templates/helmreleases/vertical-pod-autoscaler-crds.yaml (0 hunks)
  • packages/apps/kubernetes/templates/helmreleases/volumesnapshot-crd.yaml (0 hunks)
  • packages/core/platform/bundles/distro-full.yaml (1 hunks)
  • packages/core/platform/bundles/distro-hosted.yaml (1 hunks)
  • packages/core/platform/bundles/paas-full.yaml (1 hunks)
  • packages/core/platform/bundles/paas-hosted.yaml (1 hunks)
  • packages/system/metrics-server/Chart.yaml (1 hunks)
  • packages/system/metrics-server/Makefile (1 hunks)
  • packages/system/metrics-server/values.yaml (1 hunks)
  • packages/system/monitoring-agents/Makefile (0 hunks)
  • packages/system/monitoring-agents/values.yaml (0 hunks)
  • packages/system/prometheus-operator-crds/Chart.yaml (1 hunks)
  • packages/system/prometheus-operator-crds/Makefile (1 hunks)
  • packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/Chart.yaml (2 hunks)
  • packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/README.md (3 hunks)
  • packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/charts/crds/templates/crd-podmonitors.yaml (41 hunks)
  • packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/charts/crds/templates/crd-probes.yaml (38 hunks)
  • packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/charts/crds/templates/crd-prometheusrules.yaml (1 hunks)
  • packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/charts/crds/templates/crd-servicemonitors.yaml (42 hunks)
  • packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/hack/renovate-post-upgrade-hook.sh (1 hunks)
  • packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/hack/update_crds.sh (1 hunks)
  • packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/values.yaml (1 hunks)
  • packages/system/victoria-metrics-operator/Makefile (0 hunks)
  • packages/system/victoria-metrics-operator/charts/prometheus-operator-crds/charts/crds/templates/crd-prometheusrules.yaml (0 hunks)
  • packages/system/victoria-metrics-operator/charts/prometheus-operator-crds/hack/update_crds.sh (0 hunks)
  • packages/system/victoria-metrics-operator/charts/prometheus-operator-crds/values.yaml (0 hunks)
💤 Files with no reviewable changes (9)
  • packages/system/victoria-metrics-operator/Makefile
  • packages/apps/kubernetes/templates/helmreleases/vertical-pod-autoscaler-crds.yaml
  • packages/system/victoria-metrics-operator/charts/prometheus-operator-crds/hack/update_crds.sh
  • packages/system/victoria-metrics-operator/charts/prometheus-operator-crds/charts/crds/templates/crd-prometheusrules.yaml
  • packages/apps/kubernetes/templates/helmreleases/cert-manager-crds.yaml
  • packages/apps/kubernetes/templates/helmreleases/volumesnapshot-crd.yaml
  • packages/system/monitoring-agents/Makefile
  • packages/system/victoria-metrics-operator/charts/prometheus-operator-crds/values.yaml
  • packages/system/monitoring-agents/values.yaml
🧰 Additional context used
📓 Path-based instructions (2)
**/Chart.yaml

📄 CodeRabbit inference engine (AGENTS.md)

Use Helm Charts with the umbrella pattern and vendor upstream charts in charts/ directory

Files:

  • packages/system/prometheus-operator-crds/Chart.yaml
  • packages/system/metrics-server/Chart.yaml
  • packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/Chart.yaml
**/charts/**

📄 CodeRabbit inference engine (AGENTS.md)

Do not directly modify upstream charts; use vendoring approach instead

Files:

  • packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/hack/update_crds.sh
  • packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/README.md
  • packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/values.yaml
  • packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/hack/renovate-post-upgrade-hook.sh
  • packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/charts/crds/templates/crd-prometheusrules.yaml
  • packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/charts/crds/templates/crd-probes.yaml
  • packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/charts/crds/templates/crd-podmonitors.yaml
  • packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/Chart.yaml
  • packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/charts/crds/templates/crd-servicemonitors.yaml
🧠 Learnings (2)
📚 Learning: 2025-11-27T11:21:45.808Z
Learnt from: CR
Repo: cozystack/cozystack PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-27T11:21:45.808Z
Learning: Applies to **/Chart.yaml : Use Helm Charts with the umbrella pattern and vendor upstream charts in `charts/` directory

Applied to files:

  • packages/system/prometheus-operator-crds/Chart.yaml
  • packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/README.md
  • packages/system/metrics-server/Makefile
  • packages/system/metrics-server/Chart.yaml
  • packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/Chart.yaml
📚 Learning: 2025-11-27T11:21:45.808Z
Learnt from: CR
Repo: cozystack/cozystack PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-27T11:21:45.808Z
Learning: Applies to **/charts/** : Do not directly modify upstream charts; use vendoring approach instead

Applied to files:

  • packages/system/metrics-server/Chart.yaml
🧬 Code graph analysis (3)
packages/system/prometheus-operator-crds/Chart.yaml (1)
api/v1alpha1/cozystackresourcedefinitions_types.go (1)
  • Chart (93-100)
packages/apps/kubernetes/templates/helmreleases/prometheus-operator-crds.yaml (2)
api/v1alpha1/cozystackresourcedefinitions_types.go (1)
  • Chart (93-100)
scripts/installer.sh (1)
  • ensure_fluxcd (27-46)
packages/system/metrics-server/Chart.yaml (1)
api/v1alpha1/cozystackresourcedefinitions_types.go (1)
  • Chart (93-100)
🪛 checkmake (0.2.2)
packages/system/prometheus-operator-crds/Makefile

[warning] 1-1: Missing required phony target "all"

(minphony)


[warning] 1-1: Missing required phony target "clean"

(minphony)


[warning] 1-1: Missing required phony target "test"

(minphony)

packages/system/metrics-server/Makefile

[warning] 1-1: Missing required phony target "all"

(minphony)


[warning] 1-1: Missing required phony target "clean"

(minphony)


[warning] 1-1: Missing required phony target "test"

(minphony)

🪛 YAMLlint (1.37.1)
packages/apps/kubernetes/templates/helmreleases/prometheus-operator-crds.yaml

[error] 4-4: syntax error: expected , but found ''

(syntax)

packages/apps/kubernetes/templates/helmreleases/metrics-server.yaml

[error] 4-4: syntax error: expected , but found ''

(syntax)

packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/charts/crds/templates/crd-prometheusrules.yaml

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)

packages/apps/kubernetes/templates/delete.yaml

[error] 9-9: syntax error: expected , but found ''

(syntax)

packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/charts/crds/templates/crd-probes.yaml

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)

packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/charts/crds/templates/crd-podmonitors.yaml

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)

packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/charts/crds/templates/crd-servicemonitors.yaml

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)

🔇 Additional comments (28)
packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/README.md (1)

12-62: LGTM: Documentation improvements.

The README updates appropriately transition the chart to OCI-based distribution with consistent registry references and clear installation guidance.

packages/system/prometheus-operator-crds/Makefile (1)

6-10: Chart vendoring approach is appropriate.

The update target correctly fetches the upstream chart and applies selective filtering to retain only the needed CRD templates (servicemonitor, podmonitor, prometheusrule, probe). This aligns with the coding guideline to vendor upstream charts rather than directly modify them.

packages/apps/kubernetes/templates/delete.yaml (1)

8-8: Inconsistent hook-delete-policy between Job and ServiceAccount.

The Job (line 8) has hook-succeeded,before-hook-creation while the ServiceAccount (line 75) has hook-succeeded,before-hook-creation,hook-failed. Verify this asymmetry is intentional. If both should have consistent policies, apply:

-    "helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation
+    "helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation,hook-failed

Also applies to: 75-75

packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/charts/crds/templates/crd-servicemonitors.yaml (3)

1-2: Conditional CRD rendering pattern is appropriate.

Wrapping the entire CRD in a conditional based on .Values.servicemonitors.enabled allows operators to control which CRDs are deployed. This follows Helm best practices for optional resources.


11-12: Version annotations and new schema fields are consistent with upstream updates.

The controller-gen and operator.prometheus.io version bumps (v0.17.2 → v0.19.0, 0.81.0 → 0.87.0) align with the addition of new fields like convertClassicHistogramsToNHCB. The descriptions correctly document version requirements (Prometheus >= v3.0.0).

Also applies to: 86-90


1301-1403: Status subresource addition provides observability.

The comprehensive status subresource definition with binding information and conditions aligns with Kubernetes API conventions and enables users to monitor CRD acceptance and binding status. The structure is well-documented.

packages/system/prometheus-operator-crds/Chart.yaml (1)

1-3: Chart structure follows umbrella pattern.

The minimal Chart.yaml appropriately serves as an umbrella chart wrapper for the prometheus-operator-crds package. The version placeholder will be set during build.

packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/hack/renovate-post-upgrade-hook.sh (1)

1-7: Bash script follows best practices.

The Renovate hook script correctly uses strict mode (set -euo pipefail), robust directory detection, and delegates to the update_crds.sh script. The implementation is solid.

packages/system/metrics-server/Chart.yaml (1)

1-3: Chart structure follows umbrella pattern.

The metrics-server Chart.yaml mirrors the prometheus-operator-crds pattern, appropriately serving as a wrapper chart with version set during build.

packages/apps/kubernetes/templates/helmreleases/monitoring-agents.yaml (1)

47-50: Dependency chain adds necessary prerequisites.

The additions of prometheus-operator-crds and metrics-server as dependencies ensure monitoring-agents deployment only occurs after these components are ready. Both HelmRelease names match the defined releases in the codebase (packages/apps/kubernetes/templates/helmreleases/prometheus-operator-crds.yaml and packages/apps/kubernetes/templates/helmreleases/metrics-server.yaml), and the ordering correctly places CRDs first, which is appropriate.

packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/Chart.yaml (1)

13-13: Helm chart version bumps are consistent with upstream prometheus-operator updates.

The appVersion and version changes reflect the chart upgrade path and are consistent with the CRD schema enhancements. The local crds dependency reference maintains the umbrella chart pattern correctly.

Also applies to: 42-42

packages/apps/kubernetes/templates/helmreleases/csi.yaml (1)

37-41: CSI dependency on cilium is appropriately ordered.

Adding cilium to CSI's dependsOn ensures proper initialization sequence for the networking layer before storage drivers are deployed. The templating pattern is consistent with other HelmRelease manifests.

packages/system/metrics-server/values.yaml (1)

1-14: Metrics-server values configuration is well-configured for standalone deployment.

The default arguments cover essential settings (certificate directory, kubelet discovery, metric resolution) and TLS configuration. Enabling serviceMonitor and metrics integrations appropriately wires metrics-server into the monitoring stack.

packages/core/platform/bundles/distro-full.yaml (2)

90-100: Bundle dependency chain is well-ordered for CRD and metrics server components.

The introduction of prometheus-operator-crds before metrics-server and victoria-metrics-operator ensures CRDs are available when dependent components deploy. Metrics-server correctly depends on prometheus-operator-crds for ServiceMonitor integration.


102-115: Verify namespace consistency for prometheus-operator-crds across bundles.

The prometheus-operator-crds release is placed in namespace cozy-victoria-metrics-operator while metrics-server is in cozy-monitoring. Verify this namespace separation is intentional and consistent across all bundle files (distro-full, distro-hosted, paas-full, paas-hosted).

packages/core/platform/bundles/paas-hosted.yaml (1)

89-112: Verify metrics-server dependency differences between bundles.

In paas-hosted.yaml, metrics-server depends only on prometheus-operator-crds (line 99), whereas in distro-full.yaml it also depends on cilium (line 100). Confirm this difference is intentional and reflects the distinct networking setup of hosted vs. full distros.

packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/values.yaml (1)

1-55: CRD values structure enables granular control of Prometheus Operator resources.

The values block provides per-CRD enable/disable flags with consistent structure and documentation, allowing operators to selectively control which CRD types are installed. All major Prometheus Operator CRD types are included.

packages/apps/kubernetes/templates/helmreleases/prometheus-operator-crds.yaml (1)

1-37: Static analysis warning about YAML syntax is a false positive for Helm templating.

YAMLlint reports a syntax error on line 4 due to the Helm template variable {{ .Release.Name }}. This is valid Helm templating that will render correctly at runtime; the linter is evaluating the raw template without processing Helm syntax. No fix is required.

The HelmRelease structure is correct: it references the cozystack-system chart repository, targets the cozy-victoria-metrics-operator namespace for both release and storage, and conditionally depends on a self-reference HelmRelease if one exists in the namespace.

packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/charts/crds/templates/crd-prometheusrules.yaml (2)

1-10: Static analysis warning about Helm conditional is a false positive.

YAMLlint reports a syntax error on line 1 at the Helm conditional {{ if .Values.prometheusrules.enabled -}}. This is valid Helm templating syntax; the linter does not process Helm template directives. No fix is required.


1-272: PrometheusRule CRD template is comprehensive with proper status subresource support.

The CRD definition includes:

  • Detailed OpenAPI schema for PrometheusRule spec (groups, rules with intervals, labels, limits, partial response strategy)
  • Status subresource (line 271) tracking workload bindings and configuration conditions
  • Comprehensive validation patterns for time intervals and strategy values
  • Proper CRD metadata with versioning annotations

The conditional gating (line 1) allows operators to control whether this CRD is installed via the prometheusrules.enabled flag in values. The schema aligns with prometheus-operator v0.87.0.

packages/core/platform/bundles/distro-hosted.yaml (1)

64-68: Missing network dependencies in metrics-server declaration.

The metrics-server entry in distro-hosted.yaml declares only dependsOn: [prometheus-operator-crds], but the corresponding HelmRelease template (packages/apps/kubernetes/templates/helmreleases/metrics-server.yaml) has explicit dependencies on cilium (and conditionally on the parent HelmRelease).

For consistency with the template and to ensure proper initialization ordering in network-dependent scenarios, consider whether cilium should be included in the dependency list.

packages/core/platform/bundles/paas-full.yaml (1)

151-155: Verify intentional dependency divergence between bundles.

The metrics-server entry in paas-full includes [cilium,kubeovn,prometheus-operator-crds] dependencies, whereas distro-hosted includes only [prometheus-operator-crds]. This aligns with paas-full's full-featured nature, but the discrepancy should be intentional and documented.

Confirm this design is intentional and that distro-hosted's omission of cilium/kubeovn does not create ordering issues for the metrics-server HelmRelease template.

packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/charts/crds/templates/crd-podmonitors.yaml (2)

1-12: Helm conditional wrapping valid; YAMLlint error is false positive.

The file is correctly wrapped with a Helm conditional {{- if .Values.podmonitors.enabled -}}. The YAMLlint error reporting is a false positive caused by the linter's inability to process Helm template syntax. The YAML structure itself is valid once templated.

(YAMLlint false positive; code is correct)


1289-1398: Status subresource properly added to CRD.

The addition of the status subresource with WorkloadBinding and ConfigResourceCondition structures aligns with Prometheus Operator's convention for tracking CRD binding status. The structure follows the pattern seen in related workload monitor types and enables Prometheus to report configuration acceptance status.

packages/system/prometheus-operator-crds/charts/prometheus-operator-crds/charts/crds/templates/crd-probes.yaml (4)

1-12: Helm conditional wrapping valid; YAMLlint error is false positive.

Like crd-podmonitors, this file is correctly wrapped with Helm conditional syntax. The YAMLlint error is a false positive due to the linter not processing Helm templates.


672-699: Params mechanism improves probe configurability.

The addition of the params section allows passing HTTP query parameters to probes, with proper validation (minItems: 1, list-map-keys on name). This provides flexibility for blackbox-exporter modules and other probe-based configurations.


705-758: Prober-level proxy configuration aligns with best practices.

The addition of proxy configuration fields (noProxy, proxyConnectHeader, proxyFromEnvironment, proxyUrl) at the prober level enables enterprises to handle egress through proxies. This mirrors similar additions in crd-podmonitors and reflects modern operational requirements.


1284-1386: Status subresource consistent with CRD pattern.

The status subresource structure matches crd-podmonitors and maintains consistency across Prometheus Operator CRDs. This enables workload binding status tracking.

Comment thread packages/apps/kubernetes/templates/delete.yaml
Comment thread packages/apps/kubernetes/templates/helmreleases/metrics-server.yaml
Comment thread packages/system/prometheus-operator-crds/Makefile Outdated
Signed-off-by: nbykov0 <166552198+nbykov0@users.noreply.github.com>
Signed-off-by: nbykov0 <166552198+nbykov0@users.noreply.github.com>
Signed-off-by: nbykov0 <166552198+nbykov0@users.noreply.github.com>
Signed-off-by: nbykov0 <166552198+nbykov0@users.noreply.github.com>
Signed-off-by: nbykov0 <166552198+nbykov0@users.noreply.github.com>

@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: 2

♻️ Duplicate comments (1)
packages/apps/kubernetes/templates/delete.yaml (1)

8-9: Fix YAML syntax error: quote the annotation value.

The helm.sh/hook-delete-policy annotation value must be quoted to be valid YAML. Unquoted comma-separated values cause parsing errors.

Apply this diff to fix the syntax error:

     "helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation
   name: {{ .Release.Name }}-pre-cleanup

Should be:

-    "helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation
+    "helm.sh/hook-delete-policy": "hook-succeeded,before-hook-creation"
     name: {{ .Release.Name }}-pre-cleanup

This issue was flagged in previous review comments and remains unresolved.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3f3ee43 and b1a7e95.

📒 Files selected for processing (13)
  • packages/apps/kubernetes/templates/delete.yaml (2 hunks)
  • packages/apps/kubernetes/templates/helmreleases/cert-manager-crds.yaml (0 hunks)
  • packages/apps/kubernetes/templates/helmreleases/csi.yaml (1 hunks)
  • packages/apps/kubernetes/templates/helmreleases/monitoring-agents.yaml (1 hunks)
  • packages/apps/kubernetes/templates/helmreleases/prometheus-operator-crds.yaml (1 hunks)
  • packages/apps/kubernetes/templates/helmreleases/vertical-pod-autoscaler-crds.yaml (0 hunks)
  • packages/apps/kubernetes/templates/helmreleases/volumesnapshot-crd.yaml (0 hunks)
  • packages/core/platform/bundles/distro-full.yaml (1 hunks)
  • packages/core/platform/bundles/distro-hosted.yaml (1 hunks)
  • packages/core/platform/bundles/paas-full.yaml (1 hunks)
  • packages/core/platform/bundles/paas-hosted.yaml (1 hunks)
  • packages/system/prometheus-operator-crds/Makefile (1 hunks)
  • packages/system/victoria-metrics-operator/Makefile (0 hunks)
💤 Files with no reviewable changes (4)
  • packages/system/victoria-metrics-operator/Makefile
  • packages/apps/kubernetes/templates/helmreleases/volumesnapshot-crd.yaml
  • packages/apps/kubernetes/templates/helmreleases/vertical-pod-autoscaler-crds.yaml
  • packages/apps/kubernetes/templates/helmreleases/cert-manager-crds.yaml
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/core/platform/bundles/distro-full.yaml
  • packages/core/platform/bundles/paas-full.yaml
🧰 Additional context used
🪛 checkmake (0.2.2)
packages/system/prometheus-operator-crds/Makefile

[warning] 1-1: Missing required phony target "all"

(minphony)


[warning] 1-1: Missing required phony target "clean"

(minphony)


[warning] 1-1: Missing required phony target "test"

(minphony)

🪛 YAMLlint (1.37.1)
packages/apps/kubernetes/templates/helmreleases/prometheus-operator-crds.yaml

[error] 4-4: syntax error: expected , but found ''

(syntax)

packages/apps/kubernetes/templates/delete.yaml

[error] 9-9: syntax error: expected , but found ''

(syntax)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build
🔇 Additional comments (5)
packages/apps/kubernetes/templates/helmreleases/monitoring-agents.yaml (1)

47-50: Dependency additions align with new package extraction.

The two new dependsOn entries correctly reference the separately extracted prometheus-operator-crds and metrics-server releases, maintaining proper dependency ordering.

packages/core/platform/bundles/paas-hosted.yaml (1)

89-112: Bundle dependency graph is well-structured and consistent.

The new releases are properly introduced with correct namespace assignments, and all dependency relationships establish a clear, acyclic hierarchy. The metrics-server dependency on prometheus-operator-crds and the updates to victoria-metrics-operator and monitoring-agents follow the intended package extraction strategy.

packages/core/platform/bundles/distro-hosted.yaml (1)

58-83: Bundle dependency graph is consistent and well-integrated.

The new releases and dependency updates mirror the paas-hosted bundle with intentional configuration differences (distro-hosted omits vertical-pod-autoscaler-crds from monitoring-agents). The dependency hierarchy is acyclic and follows the intended package extraction strategy.

packages/apps/kubernetes/templates/helmreleases/csi.yaml (1)

40-41: The cilium HelmRelease always exists and will be available. The cilium.yaml file unconditionally defines a HelmRelease with name: {{ .Release.Name }}-cilium in the same {{ .Release.Namespace }}, exactly matching the CSI dependency reference at lines 40-41. Cilium is a core network component with no conditional deployment logic, making this dependency valid and necessary for CSI to function.

Likely an incorrect or invalid review comment.

packages/apps/kubernetes/templates/helmreleases/prometheus-operator-crds.yaml (1)

1-37: YAMLlint error at line 4 is a false positive from template syntax; file structure is valid.

The YAMLlint error is due to the static analyzer not recognizing Go template delimiters ({{ }}), which is expected for Helm templates. The file structure follows the established pattern used consistently across all HelmRelease files in the codebase, including the conditional dependsOn block with optional dependencies. The template is syntactically valid and will render correctly.

Comment thread packages/apps/kubernetes/templates/delete.yaml
Comment thread packages/system/prometheus-operator-crds/Makefile
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Dec 5, 2025
@@ -0,0 +1,10 @@
export NAME=metrics-server

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nikita (@nbykov0) please run make fix-charts from packages/system

@nbykov0 Nikita (nbykov0) Dec 5, 2025

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

No changes, as the make would only update Charts.yaml.

@dosubot dosubot Bot removed the lgtm This PR has been approved by a maintainer label Dec 5, 2025
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Dec 5, 2025
@kvaps
Andrei Kvapil (kvaps) merged commit b1a55f5 into main Dec 5, 2025
22 checks passed
@kvaps
Andrei Kvapil (kvaps) deleted the kubernetes-app-deps branch December 5, 2025 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature Categorizes issue or PR as related to a new feature lgtm This PR has been approved by a maintainer size/L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants