Skip to content

fix(t8s-cluster): use plain values for autoScaling#2002

Open
cwrau wants to merge 1 commit intomainfrom
fix/t8s-cluster/autoscaling-values-types
Open

fix(t8s-cluster): use plain values for autoScaling#2002
cwrau wants to merge 1 commit intomainfrom
fix/t8s-cluster/autoscaling-values-types

Conversation

@cwrau
Copy link
Member

@cwrau cwrau commented Feb 24, 2026

That way this is patchable in the teuto-portal until this is completely
supported

Summary by CodeRabbit

Release Notes

  • Chores
    • Restructured replica configuration: replicas now use two separate fields (replicas and maxReplicas) instead of a nested min/max structure.
    • Updated autoscaling logic to activate only when configured replica bounds differ.
    • Enhanced configuration schema validation for improved consistency.

Copilot AI review requested due to automatic review settings February 24, 2026 15:33
@cwrau cwrau enabled auto-merge February 24, 2026 15:33
@gemini-code-assist
Copy link

Summary of Changes

Hello @cwrau, 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 refactors the autoscaling configuration for node pools within the t8s-cluster Helm chart. The change simplifies the replicas definition from a nested min/max object to distinct replicas and maxReplicas integer fields. This modification enhances the patchability of these values, particularly for integration with external management portals, while maintaining proper validation and functionality for cluster autoscaling.

Highlights

  • Simplified Autoscaling Configuration: The nodePools.autoscaling.replicas field has been changed from a nested object with min and max properties to a single integer value, and a new maxReplicas integer field has been introduced.
  • Improved Patchability: This refactoring provides a flatter configuration structure, making it easier to patch these autoscaling values, especially for external systems like the teuto-portal.
  • Updated Autoscaling Logic and Validation: The Helm templates have been adjusted to correctly interpret and apply the new replicas and maxReplicas values, including new validation to ensure replicas does not exceed maxReplicas.
  • Schema Enforcement: The values.schema.json file has been updated to reflect the new integer types for replicas and maxReplicas, ensuring configuration consistency.
Changelog
  • charts/t8s-cluster/ci/autoscaling-values.yaml
    • Updated nodePools.autoscaling.replicas from an object with min and max to a single integer value.
    • Added nodePools.autoscaling.maxReplicas as a new integer field.
  • charts/t8s-cluster/templates/management-cluster/autoscaler.yaml
    • Modified the logic to determine if autoscaling is enabled by comparing replicas and maxReplicas.
  • charts/t8s-cluster/templates/management-cluster/cluster.yaml
    • Refactored the template to use the new replicas and maxReplicas fields.
    • Introduced validation to ensure replicas is not greater than maxReplicas.
    • Conditionally rendered minReplicas and maxReplicas only when they differ, otherwise rendering a single replicas field.
  • charts/t8s-cluster/values.schema.json
    • Updated the schema for nodePools.replicas to be an integer.
    • Added a new schema entry for nodePools.maxReplicas as an integer.
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.

@coderabbitai
Copy link

coderabbitai bot commented Feb 24, 2026

Warning

Rate limit exceeded

@cwrau has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 16 minutes and 18 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 41e4eca and 9a363a6.

📒 Files selected for processing (4)
  • charts/t8s-cluster/ci/autoscaling-values.yaml
  • charts/t8s-cluster/templates/management-cluster/autoscaler.yaml
  • charts/t8s-cluster/templates/management-cluster/cluster.yaml
  • charts/t8s-cluster/values.schema.json
📝 Walkthrough

Walkthrough

This pull request restructures the autoscaling configuration format across the t8s-cluster Helm chart. It replaces the nested {min, max} replicas object with flat replicas and maxReplicas fields, updating the values file, JSON schema, and Helm templates to enforce this new structure and adjust autoscaler enablement logic accordingly.

Changes

Cohort / File(s) Summary
Schema and Values Configuration
charts/t8s-cluster/values.schema.json, charts/t8s-cluster/ci/autoscaling-values.yaml
Replaces complex replicas schema (union of integer or object with min/max) with simple scalar integer; introduces separate maxReplicas field with minimum value of 1. Values file updated from min: 1, max: 3 to replicas: 1, maxReplicas: 3.
Template Logic
charts/t8s-cluster/templates/management-cluster/autoscaler.yaml, charts/t8s-cluster/templates/management-cluster/cluster.yaml
Autoscaler enablement now compares replicas vs maxReplicas numerically instead of checking map structure. Cluster nodePools template validates that replicas ≤ maxReplicas and renders either minReplicas/maxReplicas or singular replicas based on equality.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

t8s-cluster

Suggested reviewers

  • tasches
  • marvinWolff
  • teutonet-bot

Poem

🐰 A rabbit hops through configs neat,
Where min and max once danced as one,
Now split and flat, they're cleaner, sweet,
With replicas and maxReplicas spun!
The schema shines, the templates sing,
Autoscaling logic takes its wing! ✨

🚥 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 'fix(t8s-cluster): use plain values for autoScaling' clearly describes the main change: converting autoscaling configuration from complex nested structures to plain scalar values.
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 fix/t8s-cluster/autoscaling-values-types

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.

Copy link

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 refactors the autoscaling configuration structure for node pools from a nested object format to flat fields. The change replaces replicas: {min: X, max: Y} with replicas: X and maxReplicas: Y, making these values independently patchable in teuto-portal.

Changes:

  • Simplified schema from oneOf union type to flat integer fields for replicas and maxReplicas
  • Updated template logic to use the new flat structure while maintaining validation and autoscaler detection
  • Updated CI test values to reflect the new configuration format

Reviewed changes

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

File Description
charts/t8s-cluster/values.schema.json Refactored schema from oneOf with nested object to flat replicas and maxReplicas properties
charts/t8s-cluster/templates/management-cluster/cluster.yaml Updated template logic to handle new flat structure with proper defaulting and validation
charts/t8s-cluster/templates/management-cluster/autoscaler.yaml Updated autoscaler enablement detection to work with new flat structure
charts/t8s-cluster/ci/autoscaling-values.yaml Updated test values to use new flat structure format

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

Copy link

@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/t8s-cluster/values.schema.json (1)

212-215: Consider adding a description to maxReplicas to clarify its role.

There's no description on the new maxReplicas property, unlike other properties that document their purpose. A short note (e.g., "When set and different from replicas, enables autoscaling with replicas as minReplicas") would help consumers understand when to set it.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@charts/t8s-cluster/values.schema.json` around lines 212 - 215, The schema
property "maxReplicas" lacks a descriptive "description" field; add a concise
description for maxReplicas (e.g., explaining it enables autoscaling when
different from replicas and that replicas acts as minReplicas) to the JSON
schema so consumers understand its role—update the "maxReplicas" object in
values.schema.json to include a "description" string describing when and how to
use maxReplicas.
🤖 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/t8s-cluster/values.schema.json`:
- Around line 212-215: The schema property "maxReplicas" lacks a descriptive
"description" field; add a concise description for maxReplicas (e.g., explaining
it enables autoscaling when different from replicas and that replicas acts as
minReplicas) to the JSON schema so consumers understand its role—update the
"maxReplicas" object in values.schema.json to include a "description" string
describing when and how to use maxReplicas.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between aa7d054 and 41e4eca.

📒 Files selected for processing (4)
  • charts/t8s-cluster/ci/autoscaling-values.yaml
  • charts/t8s-cluster/templates/management-cluster/autoscaler.yaml
  • charts/t8s-cluster/templates/management-cluster/cluster.yaml
  • charts/t8s-cluster/values.schema.json

Copy link

@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 refactors the autoscaling configuration for node pools in the t8s-cluster Helm chart. It changes the replicas field from a map with min and max to a single replicas integer and introduces a new maxReplicas field. This simplifies the configuration in autoscaling-values.yaml and updates the corresponding Helm templates (autoscaler.yaml and cluster.yaml) and the values.schema.json to reflect these changes. The validation logic for minReplicas and maxReplicas has also been updated to align with the new structure.

That way this is patchable in the teuto-portal until this is completely
supported
@cwrau cwrau force-pushed the fix/t8s-cluster/autoscaling-values-types branch from 41e4eca to 9a363a6 Compare February 24, 2026 15:47
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