Skip to content

feat(base-cluster/ingress-nginx): use risk-level Critical when annotations are enabled#1417

Merged
cwrau merged 1 commit intoteutonet:mainfrom
ol-teuto:nginx-annotations-risk-level
Mar 25, 2025
Merged

feat(base-cluster/ingress-nginx): use risk-level Critical when annotations are enabled#1417
cwrau merged 1 commit intoteutonet:mainfrom
ol-teuto:nginx-annotations-risk-level

Conversation

@ol-teuto
Copy link
Copy Markdown
Member

@ol-teuto ol-teuto commented Mar 17, 2025

This sets annotations-risk-level to Critical when nginx configuration snippets are enabled, restoring the default setting from before ingress-nginx release 1.12.

Summary by CodeRabbit

  • New Features
    • Introduced a conditional risk level configuration that automatically applies a "Critical" status when snippet-based annotations are enabled, enhancing overall risk management without affecting other existing settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 17, 2025

Walkthrough

The changes modify the NGINX ingress configuration in the Helm chart by adding a conditional setting named annotations-risk-level within the controller’s configuration. When .Values.ingress.allowNginxConfigurationSnippets evaluates to true, the chart renders this option with the value "Critical". No other parts of the configuration are altered.

Changes

File Path Change Summary
charts/base-cluster/.../ingress/nginx.yaml Added conditional annotations-risk-level in the controller’s config to render "Critical" based on .Values.ingress.allowNginxConfigurationSnippets.

Sequence Diagram(s)

sequenceDiagram
    participant V as .Values
    participant R as Helm Renderer
    participant I as NGINX Controller

    V->>R: Provide ingress.allowNginxConfigurationSnippets flag
    alt Flag is True
        R->>I: Render annotations-risk-level = "Critical"
    else Flag is False
        R->>I: Omit annotations-risk-level
    end
Loading

Poem

I'm a rabbit dancing through config fields,
Hopping over YAML rows with skill,
Adding a twist where "Critical" yields,
My whiskers twitch with joy at the new thrill!
Leaping through lines in a merry display,
Scala and carrots make coding a bright day!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b43ab74 and 075ab4e.

📒 Files selected for processing (1)
  • charts/base-cluster/templates/ingress/nginx.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • charts/base-cluster/templates/ingress/nginx.yaml
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: check licenses
  • GitHub Check: generateDiffCommentBody
  • GitHub Check: lint helm chart (base-cluster)

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 0

🧹 Nitpick comments (2)
charts/base-cluster/values.schema.json (1)

1338-1342: New Annotations Risk Level Property Added.

The addition of the annotationsRiskLevel property—with its type set to string, enumerated values ["Critical", "High", "Medium", "Low"], and an informative description referencing the Kubernetes documentation—is clear and directly aligns with the PR objectives. This will allow users to control annotation risk levels in a granular way.

charts/base-cluster/templates/ingress/nginx.yaml (1)

43-45: Conditional Rendering of Annotations-Risk-Level in Template.

The conditional block correctly checks for the presence of .Values.ingress.annotationsRiskLevel before rendering the annotations-risk-level configuration. For improved consistency and to guard against potential YAML parsing issues (e.g., if a future risk level value contains special characters or spaces), consider applying the quote function, as in:

annotations-risk-level: {{ . | quote }}

This is a minor nitpick that ensures robust output formatting.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 24db445 and 94d468b.

📒 Files selected for processing (2)
  • charts/base-cluster/templates/ingress/nginx.yaml (1 hunks)
  • charts/base-cluster/values.schema.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: check licenses
  • GitHub Check: generateDiffCommentBody
  • GitHub Check: lint helm chart (base-cluster)

Comment thread charts/base-cluster/templates/ingress/nginx.yaml Outdated
@teutonet-bot
Copy link
Copy Markdown
Contributor

teutonet-bot commented Mar 17, 2025

🤖 I have diffed this beep boop

"/$namespace/$kind/$name.yaml" for normal resources
"/$namespace/HelmRelease/$name/$namespace/$kind/$name.yaml" for HelmReleases <- this is recursive
'null' means it's either cluster-scoped or it's in the default namespace for the HelmRelease

charts/base-cluster/ci/monitoring-ingress-unauthenticated-values.yaml

charts/base-cluster/ci/rbac-values.yaml has no changes

charts/base-cluster/ci/pagerduty-values.yaml

charts/base-cluster/ci/velero-backupStorageLocations-gen-values.yaml

charts/base-cluster/ci/flux-gitrepositories-gen-values.yaml

charts/base-cluster/ci/imagepullsecrets-values.yaml has no changes

charts/base-cluster/values.yaml has no changes

charts/base-cluster/ci/artifacthub-values.yaml has no changes

charts/base-cluster/ci/disabled-ingress-values.yaml

charts/base-cluster/ci/priorityclasses-values.yaml

[charts/base-cluster/ci/deadmansswitch-values.yaml](

<title> Error </title> <script src="https://unpkg.com/htmx.org@2.0.2" integrity="sha384-Y7hw+L/jvKeWIRRkqWYfPcvVxHzVzn5REgzbawhxAuQGwX1XWe70vji+VSeHOThJ" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script> <script defer src="https://media.ethicalads.io/media/client/ethicalads.min.js"></script> <script> function key(event, letter) { return (event.charCode == letter.charCodeAt() || event.charCode == letter.charCodeAt() + 32) } </script> <script>
    </script>
    <style></style>
    
    
</head>

<body hx-on:keydown="var path=window.location.pathname; if ((event.key=='n' || event.key=='N') && path && path !== '/' && !path.includes('/duplicate/') && !path.includes('/dashboard/') && !path.includes('/accounts/') && !path.includes('/properties/')) { window.location.href = '/'; }">
    <div id="container">
        
        <div class="topbuttons">
            
                <a href="/accounts/login/"
                   title="Personal dashboard, preferences, API token"
                   class="button"><b>Sign in</b></a>
            
            <a href="/" title="Create a new paste (shortcut: 'N')" class=" button">New</a>
            <a href="/api/v2/"
               title="Paste creation API, with code samples"
               class=" activebutton  button">API</a>
            <a href="/help/"
               title="Usage tips, shortcuts"
               class="  button">Help</a>
            <a href="/about/"
               title="Updates, stats, backstory"
               class=" button">About</a>
        </div>
        
<div class="error">
    <h3>Sorry!</h3>
    Sorry, maximum content size is 1,000,000 characters. Your submission is 2,540,033. Your IP will be blocked if you exceed this limit again in the next 60 seconds.
    <hr>
    <p>
        Something unexpected? Please create a <a href="https://dpaste.freshdesk.com/support/tickets/new">support ticket</a>.
    </p>
</div>
<p>
    <a class="button" href="{$ url 'create' %}" onclick="history.back();return false;">Go back</a>
</p>

    </div>
    
    
    <script>
        window.fwSettings={'widget_id':22000000180 };
        !function(){if("function"!=typeof window.FreshworksWidget){var n=function(){n.q.push(arguments)};n.q=[],window.FreshworksWidget=n}}();
    </script>
    <script defer src='https://widget.freshworks.com/widgets/22000000180.js'></script>
</body>
)

charts/base-cluster/ci/monitoring-oidc-values.yaml

charts/base-cluster/ci/basic-values.yaml has no changes

charts/base-cluster/ci/monitoring-oidc-ingress-disabled-values.yaml

charts/base-cluster/ci/limitrange-resourcequota-values.yaml

@ol-teuto ol-teuto force-pushed the nginx-annotations-risk-level branch from 94d468b to b43ab74 Compare March 17, 2025 13:17
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: 0

🧹 Nitpick comments (2)
charts/base-cluster/templates/ingress/nginx.yaml (2)

22-22: Clarify Double Negation in allowSnippetAnnotations

The expression using | not | not on .Values.ingress.annotationsRiskLevel is effectively coercing its value to a boolean. While this pattern ensures that a defined (non-empty) risk level becomes true, its intent may not be immediately clear. Consider adding an inline comment to explain that this conversion enables snippet annotations when any valid risk level is provided.


43-45: Verify and Document Conditional Rendering for annotations-risk-level

The with block that conditionally renders annotations-risk-level is straightforward and correctly limits the configuration to cases where .Values.ingress.annotationsRiskLevel is set. For added clarity, it may be beneficial to note that the acceptable string values are defined in the JSON schema (i.e. "Critical", "High", "Medium", "Low"). This can help maintain consistency and aid future maintainers in understanding the linkage between configuration and schema.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 94d468b and b43ab74.

📒 Files selected for processing (2)
  • charts/base-cluster/templates/ingress/nginx.yaml (2 hunks)
  • charts/base-cluster/values.schema.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • charts/base-cluster/values.schema.json
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: check licenses
  • GitHub Check: generateDiffCommentBody
  • GitHub Check: lint helm chart (base-cluster)

@ol-teuto ol-teuto requested a review from cwrau March 21, 2025 08:33
Comment thread charts/base-cluster/templates/ingress/nginx.yaml Outdated
@ol-teuto ol-teuto force-pushed the nginx-annotations-risk-level branch from b43ab74 to 075ab4e Compare March 21, 2025 09:14
@ol-teuto ol-teuto changed the title feat(base-cluster/ingress-nginx): allow setting annotations-risk-level feat(base-cluster/ingress-nginx): use risk-level Critical when annotations are enabled Mar 21, 2025
@ol-teuto ol-teuto requested a review from cwrau March 25, 2025 08:12
@cwrau cwrau enabled auto-merge (squash) March 25, 2025 09:10
@cwrau cwrau disabled auto-merge March 25, 2025 09:43
@cwrau cwrau merged commit a9d8ef2 into teutonet:main Mar 25, 2025
51 of 60 checks passed
github-merge-queue Bot pushed a commit that referenced this pull request May 27, 2025
🤖 I have created a release *beep* *boop*
---


##
[8.0.0](base-cluster-v7.2.1...base-cluster-v8.0.0)
(2025-05-27)


### ⚠ BREAKING CHANGES

* **base-cluster/ingress:** add option traefik for ingress controller
and make it default
([#1420](#1420))
* **base-cluster/monitoring:** migrate promtail to alloy
([#1347](#1347))

### Features

* **base-cluster/ingress-nginx:** use risk-level Critical when
annotations are enabled
([#1417](#1417))
([a9d8ef2](a9d8ef2))
* **base-cluster/ingress:** add option traefik for ingress controller
and make it default
([#1420](#1420))
([f62b197](f62b197))
* **base-cluster/ingress:** rename oauth-proxies to have a clean name
([#1434](#1434))
([27a28d5](27a28d5))
* **base-cluster/monitoring:** migrate promtail to alloy
([#1347](#1347))
([24db445](24db445))
* **base-cluster/monitoring:** rename alloy to be a generic name
([#1433](#1433))
([3f5826a](3f5826a))


### Bug Fixes

* **base-cluster/cert-manager:** metrics collection
([#1397](#1397))
([71e1189](71e1189))
* **base-cluster/rbac:** *RoleBindings should always be prefixed to
avoid collision
([#1484](#1484))
([75de246](75de246))


### Miscellaneous Chores

* **base-cluster/monitoring:** remove deprecated plugin
([#1478](#1478))
([ee22df5](ee22df5))
* **base-cluster:** formatting
([#1424](#1424))
([853f146](853f146))
* **base-cluster:** pin all versions
([#1447](#1447))
([ec8a430](ec8a430))

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

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Added support for the Traefik ingress controller, now recommended and
available as an alternative to NGINX.
- Updated ingress configuration to use a new provider option, allowing
selection between "nginx", "traefik", or "none".
- Expanded documentation with detailed migration guides and ingress
controller comparisons.

- **Breaking Changes**
- Traefik is now the default ingress controller; configuration for
disabling ingress has changed.
- Monitoring stack migrated from promtail to alloy; Loki deployment
updated and namespace changed.
  - Deprecated properties and configuration options removed or replaced.

- **Bug Fixes**
  - Improved metrics collection in cert-manager.
  - Resolved RBAC role binding name collisions.

- **Chores**
  - Updated container image versions and removed deprecated plugins.
- Reformatted and reorganized chart metadata and documentation for
clarity.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

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.

3 participants