Skip to content

feat(base-cluster/monitoring): add alert about deprecated APIs#2021

Merged
cwrau merged 2 commits intomainfrom
feat/base-cluster/add-alert-about-deprecated-apis
Mar 16, 2026
Merged

feat(base-cluster/monitoring): add alert about deprecated APIs#2021
cwrau merged 2 commits intomainfrom
feat/base-cluster/add-alert-about-deprecated-apis

Conversation

@cwrau
Copy link
Copy Markdown
Member

@cwrau cwrau commented Mar 13, 2026

Summary by CodeRabbit

  • New Features

    • Added a new Prometheus alert that monitors and triggers notifications when deprecated Kubernetes APIs are used in your cluster.
  • Chores

    • Updated internal naming conventions and formatting for monitoring rule configurations.

Copilot AI review requested due to automatic review settings March 13, 2026 14:43
@cwrau cwrau requested a review from teutonet-bot as a code owner March 13, 2026 14:43
@cwrau cwrau enabled auto-merge March 13, 2026 14:43
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 13, 2026

📝 Walkthrough

Walkthrough

The PR updates Prometheus alerting rule templates across the Helm chart, renaming the certificate expiration template from expirationRule to expirationAlert, applying whitespace formatting adjustments to existing rules, and introducing a new PrometheusRule for detecting deprecated Kubernetes API usage.

Changes

Cohort / File(s) Summary
Template Rename
charts/base-cluster/templates/cert-manager/rules/certificate-expiration.yaml
Renamed template definition and references from expirationRule to expirationAlert for consistent naming conventions.
Whitespace & Formatting
charts/base-cluster/templates/flux/rules/flux-status.yaml, charts/base-cluster/templates/nfs-server-provisioner/rules/storage-size.yaml
Applied trailing trim modifiers (-}}) to Helm template conditionals for consistent formatting without altering control flow.
New Deprecated APIs Alert
charts/base-cluster/templates/global/rules/deprecated-apis.yaml
Introduces new PrometheusRule template that conditionally deploys alerting for deprecated Kubernetes API usage with critical severity, tracking by group/version/resource/subresource.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • tasches
  • teutonet-bot
  • marvinWolff

Poem

🐰 Alert templates hop with care,
New names and formatting so fair,
Deprecated APIs now in sight,
With critical warnings shining bright,
Prometheus watches through the night! 📊

🚥 Pre-merge checks | ✅ 3
✅ 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 accurately describes the primary change: adding a new Prometheus alert rule for deprecated Kubernetes APIs to the monitoring configuration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/base-cluster/add-alert-about-deprecated-apis
📝 Coding Plan
  • Generate coding plan for human review comments

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.

@gemini-code-assist
Copy link
Copy Markdown

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 enhances the base-cluster monitoring capabilities by adding a critical alert for deprecated Kubernetes API usage. This new alert will proactively notify administrators when older APIs, scheduled for removal, are still in use, facilitating timely updates and preventing potential cluster disruptions. Additionally, the PR includes minor refactoring to improve the clarity of existing monitoring rule definitions and standardizes Helm template syntax for better maintainability.

Highlights

  • Deprecated API Alert: A new Prometheus alert was introduced to detect and notify about the usage of deprecated Kubernetes APIs, helping to ensure cluster compatibility with future Kubernetes versions.
  • Template Renaming: The base-cluster.cert-manager.expirationRule template was renamed to base-cluster.cert-manager.expirationAlert for improved clarity and consistency.
  • Helm Syntax Standardization: Helm template syntax was standardized across multiple monitoring rule files by consistently using - for trimming whitespace.
Changelog
  • charts/base-cluster/templates/cert-manager/rules/certificate-expiration.yaml
    • Renamed the base-cluster.cert-manager.expirationRule template to base-cluster.cert-manager.expirationAlert.
    • Standardized Helm template whitespace trimming.
  • charts/base-cluster/templates/flux/rules/flux-status.yaml
    • Standardized Helm template whitespace trimming.
  • charts/base-cluster/templates/global/rules/certificate-expiration.yaml
    • Added a new PrometheusRule named deprecated-apis to alert on the use of deprecated Kubernetes APIs.
  • charts/base-cluster/templates/nfs-server-provisioner/rules/storage-size.yaml
    • Standardized Helm template whitespace trimming.
Activity
  • No human activity has been recorded on this pull request yet.
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-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 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 counter productive. You can react with 👍 and 👎 on @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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

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.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request renames a Helm template for certificate expiration rules, adjusts whitespace control in several Helm templates, and introduces a new PrometheusRule to alert on deprecated Kubernetes API usage. A review comment suggests simplifying the PromQL expression within this new deprecated API alert for improved clarity and efficiency.

Comment thread charts/base-cluster/templates/global/rules/deprecated-apis.yaml
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new PrometheusRule alert for deprecated Kubernetes API usage and makes minor whitespace/naming cleanups across several existing rule template files.

Changes:

  • Adds a new DeprecatedAPIUsed PrometheusRule that fires when deprecated Kubernetes APIs are still being called, using the apiserver_requested_deprecated_apis metric.
  • Renames the cert-manager template helper from expirationRule to expirationAlert for consistency.
  • Normalizes whitespace trimming (-}}) in several template files (flux-status.yaml, storage-size.yaml).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
charts/base-cluster/templates/global/rules/certificate-expiration.yaml New file containing the deprecated APIs PrometheusRule alert (but incorrectly named).
charts/base-cluster/templates/cert-manager/rules/certificate-expiration.yaml Renames template helper from expirationRule to expirationAlert.
charts/base-cluster/templates/flux/rules/flux-status.yaml Whitespace normalization (adds trimming dashes and indentation).
charts/base-cluster/templates/nfs-server-provisioner/rules/storage-size.yaml Whitespace normalization (adds trimming dashes and indentation).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread charts/base-cluster/templates/global/rules/deprecated-apis.yaml
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

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 the current code and only fix it if needed.

Inline comments:
In `@charts/base-cluster/templates/global/rules/certificate-expiration.yaml`:
- Around line 1-28: The template file is misnamed—its content defines the
PrometheusRule template "base-cluster.monitoring.deprecatedAPIsAlert" (resource
name deprecated-apis and alert DeprecatedAPIUsed) but the filename is
certificate-expiration.yaml; rename the file to match its purpose (e.g.,
deprecated-apis.yaml) and update any chart references if present so the template
path and filename align with the template name to avoid confusion and
maintenance issues.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a7c73f5b-f15d-49b3-98dc-53cf69efa84b

📥 Commits

Reviewing files that changed from the base of the PR and between d874a56 and 6290dea.

📒 Files selected for processing (4)
  • charts/base-cluster/templates/cert-manager/rules/certificate-expiration.yaml
  • charts/base-cluster/templates/flux/rules/flux-status.yaml
  • charts/base-cluster/templates/global/rules/certificate-expiration.yaml
  • charts/base-cluster/templates/nfs-server-provisioner/rules/storage-size.yaml

Comment thread charts/base-cluster/templates/global/rules/deprecated-apis.yaml
@cwrau cwrau force-pushed the feat/base-cluster/add-alert-about-deprecated-apis branch from 6290dea to 8bdde68 Compare March 16, 2026 08:32
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
charts/base-cluster/templates/global/rules/deprecated-apis.yaml (1)

28-28: Minor inconsistency: end directive indentation.

The closing {{- end -}} is indented with 2 spaces, while other templates in this PR (e.g., storage-size.yaml line 30, flux-status.yaml line 49) have the end directive at different indentation levels. For consistency with storage-size.yaml which places {{- end }} at column 0, consider removing the leading spaces.

Suggested fix
           period: WorkingHours
-  {{- end -}}
+{{- end -}}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@charts/base-cluster/templates/global/rules/deprecated-apis.yaml` at line 28,
The closing Helm template delimiter '{{- end -}}' in the deprecated-apis.yaml
fragment is indented by two spaces; move it to column 0 (remove the leading
spaces) so the '{{- end -}}' delimiter matches the indentation style used in
storage-size.yaml and flux-status.yaml, ensuring consistent template formatting
across the chart.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@charts/base-cluster/templates/global/rules/deprecated-apis.yaml`:
- Line 28: The closing Helm template delimiter '{{- end -}}' in the
deprecated-apis.yaml fragment is indented by two spaces; move it to column 0
(remove the leading spaces) so the '{{- end -}}' delimiter matches the
indentation style used in storage-size.yaml and flux-status.yaml, ensuring
consistent template formatting across the chart.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d043e7da-c866-47ae-a5ce-f95e9f4a6841

📥 Commits

Reviewing files that changed from the base of the PR and between 6290dea and 8bdde68.

📒 Files selected for processing (4)
  • charts/base-cluster/templates/cert-manager/rules/certificate-expiration.yaml
  • charts/base-cluster/templates/flux/rules/flux-status.yaml
  • charts/base-cluster/templates/global/rules/deprecated-apis.yaml
  • charts/base-cluster/templates/nfs-server-provisioner/rules/storage-size.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • charts/base-cluster/templates/cert-manager/rules/certificate-expiration.yaml

@cwrau cwrau added this pull request to the merge queue Mar 16, 2026
Merged via the queue into main with commit cb334dd Mar 16, 2026
31 of 32 checks passed
@cwrau cwrau deleted the feat/base-cluster/add-alert-about-deprecated-apis branch March 16, 2026 11:15
github-merge-queue Bot pushed a commit that referenced this pull request Mar 17, 2026
🤖 I have created a release *beep* *boop*
---


##
[11.1.0](base-cluster-v11.0.1...base-cluster-v11.1.0)
(2026-03-16)


### Features

* **base-cluster/ingress:** add auto detection of need for proxy
protocol
([#1951](#1951))
([a94de1a](a94de1a))
* **base-cluster/ingress:** allow external ingress controller
([#1859](#1859))
([1442431](1442431))
* **base-cluster/kyverno:** allow setting kyverno resources
([#1986](#1986))
([71b9db4](71b9db4))
* **base-cluster/monitoring:** add alert about base-cluster updates
([#1937](#1937))
([a3c63a7](a3c63a7))
* **base-cluster/monitoring:** add alert about deprecated APIs
([#2021](#2021))
([cb334dd](cb334dd))


### Bug Fixes

* **base-cluster/deadMansSwitch:** fix alertmanager healthchecks URL
([#2019](#2019))
([d874a56](d874a56))
* **base-cluster/ingress:** disable traefik apiCheck
([#1902](#1902))
([d45bd69](d45bd69))
* **base-cluster/ingress:** they now have the redirections nested under
http
([#1952](#1952))
([dca2502](dca2502))
* **base-cluster/monitoring:** adjust for short-lived certificates
([#1921](#1921))
([41062b2](41062b2))
* **base-cluster/monitoring:** only roll out alloy tracing ports if
enabled
([#2005](#2005))
([ea44c4d](ea44c4d))
* **base-cluster:** Revert "chore(base-cluster/dependencies): update
helm release traefik to v39
([#1936](#1936))"
([#1954](#1954))
([5d2ae36](5d2ae36))


### Miscellaneous Chores

* **base-cluster/dependencies:** update common docker tag to v1.8.0
([#1939](#1939))
([38b1c7e](38b1c7e))
* **base-cluster/dependencies:** update docker.io/curlimages/curl docker
tag to v8.18.0
([#1896](#1896))
([f046977](f046977))
* **base-cluster/dependencies:** update
docker.io/grafana/grafana-image-renderer docker tag to v5.0.13
([#1885](#1885))
([474e903](474e903))
* **base-cluster/dependencies:** update
docker.io/grafana/grafana-image-renderer docker tag to v5.2.3
([#1897](#1897))
([84b647b](84b647b))
* **base-cluster/dependencies:** update
docker.io/grafana/grafana-image-renderer docker tag to v5.3.0
([#1922](#1922))
([ef6f80f](ef6f80f))
* **base-cluster/dependencies:** update
docker.io/grafana/grafana-image-renderer docker tag to v5.4.0
([#1931](#1931))
([50171d8](50171d8))
* **base-cluster/dependencies:** update
docker.io/grafana/grafana-image-renderer docker tag to v5.5.0
([#1968](#1968))
([ee276e2](ee276e2))
* **base-cluster/dependencies:** update
docker.io/grafana/grafana-image-renderer docker tag to v5.5.1
([#1988](#1988))
([f765f5e](f765f5e))
* **base-cluster/dependencies:** update docker.io/vladgh/gpg docker tag
to v1.3.7
([#1886](#1886))
([4b2c33b](4b2c33b))
* **base-cluster/dependencies:** update helm release alloy to v1.5.2
([#1891](#1891))
([41b25e9](41b25e9))
* **base-cluster/dependencies:** update helm release alloy to v1.5.3
([#1949](#1949))
([d8bda90](d8bda90))
* **base-cluster/dependencies:** update helm release alloy to v1.6.0
([#1975](#1975))
([76632e4](76632e4))
* **base-cluster/dependencies:** update helm release external-dns to
v1.20.0
([#1905](#1905))
([ff53477](ff53477))
* **base-cluster/dependencies:** update helm release
kube-prometheus-stack to v80.13.3
([#1892](#1892))
([9775868](9775868))
* **base-cluster/dependencies:** update helm release
kube-prometheus-stack to v80.14.4
([#1906](#1906))
([f62458d](f62458d))
* **base-cluster/dependencies:** update helm release
kube-prometheus-stack to v81
([#1923](#1923))
([9e9915d](9e9915d))
* **base-cluster/dependencies:** update helm release
kube-prometheus-stack to v81.2.1
([#1934](#1934))
([30fa0dd](30fa0dd))
* **base-cluster/dependencies:** update helm release
kube-prometheus-stack to v81.3.2
([#1950](#1950))
([95a9398](95a9398))
* **base-cluster/dependencies:** update helm release
kube-prometheus-stack to v81.5.0
([#1962](#1962))
([1a9bab8](1a9bab8))
* **base-cluster/dependencies:** update helm release
kube-prometheus-stack to v81.5.2
([#1982](#1982))
([07c2249](07c2249))
* **base-cluster/dependencies:** update helm release
kube-prometheus-stack to v81.6.6
([#1989](#1989))
([2bf4f3c](2bf4f3c))
* **base-cluster/dependencies:** update helm release
kube-prometheus-stack to v82
([#1995](#1995))
([45ef213](45ef213))
* **base-cluster/dependencies:** update helm release loki to v6.49.0
([#1908](#1908))
([f36dd6d](f36dd6d))
* **base-cluster/dependencies:** update helm release loki to v6.51.0
([#1928](#1928))
([6ac27d6](6ac27d6))
* **base-cluster/dependencies:** update helm release loki to v6.53.0
([#1974](#1974))
([0bc6e68](0bc6e68))
* **base-cluster/dependencies:** update helm release oauth2-proxy to v10
([#1913](#1913))
([7e551b5](7e551b5))
* **base-cluster/dependencies:** update helm release oauth2-proxy to
v10.1.1
([#1944](#1944))
([3f97108](3f97108))
* **base-cluster/dependencies:** update helm release oauth2-proxy to
v10.1.2
([#1961](#1961))
([c0bc91d](c0bc91d))
* **base-cluster/dependencies:** update helm release oauth2-proxy to
v10.1.3
([#1979](#1979))
([9b95c4b](9b95c4b))
* **base-cluster/dependencies:** update helm release oauth2-proxy to
v10.1.4
([#2001](#2001))
([8ffa211](8ffa211))
* **base-cluster/dependencies:** update helm release reflector to v10
([#1924](#1924))
([0051c34](0051c34))
* **base-cluster/dependencies:** update helm release reflector to
v10.0.19
([#1999](#1999))
([a2b5189](a2b5189))
* **base-cluster/dependencies:** update helm release reflector to
v10.0.2
([#1935](#1935))
([333393e](333393e))
* **base-cluster/dependencies:** update helm release reflector to
v10.0.4
([#1956](#1956))
([3eef9a0](3eef9a0))
* **base-cluster/dependencies:** update helm release reflector to
v10.0.8
([#1978](#1978))
([b2f97f9](b2f97f9))
* **base-cluster/dependencies:** update helm release reflector to
v9.1.45
([#1893](#1893))
([ff100d9](ff100d9))
* **base-cluster/dependencies:** update helm release tempo to v1.24.3
([#1904](#1904))
([99099bf](99099bf))
* **base-cluster/dependencies:** update helm release tempo to v1.24.4
([#1957](#1957))
([7d67bf3](7d67bf3))
* **base-cluster/dependencies:** update helm release tempo to v1.26.1
([#1976](#1976))
([517da93](517da93))
* **base-cluster/dependencies:** update helm release tempo to v1.26.7
([#2000](#2000))
([6cabd54](6cabd54))
* **base-cluster/dependencies:** update helm release traefik to v38
([#1914](#1914))
([106c7cf](106c7cf))
* **base-cluster/dependencies:** update helm release traefik to v39
([#1936](#1936))
([5b39257](5b39257))
* **base-cluster/dependencies:** update helm release traefik to v39
([#1959](#1959))
([6efe111](6efe111))
* **base-cluster/dependencies:** update helm release traefik to v39.0.1
([#1992](#1992))
([27d7316](27d7316))
* **base-cluster/monitoring:** migrate helm repo to new URL
([#1955](#1955))
([9263d6a](9263d6a))
* **base-cluster/tetragon:** update flux apiVersion
([#1900](#1900))
([ff93afb](ff93afb))
* **base-cluster:** update kyverno
([#1918](#1918))
([a503ef6](a503ef6))
* migrate kyverno config
([71b9db4](71b9db4))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants