Skip to content

Conversation

@RoseSecurity
Copy link
Contributor

@RoseSecurity RoseSecurity commented Feb 17, 2025

what and why

  • Change the default metrics server charts to being from: https://kubernetes-sigs.github.io/metrics-server/
  • Remove unused variables (TFLint)
  • Make pod labels configurable

testing

  • Tested and validated in our current infra deployment

references

Summary by CodeRabbit

  • Documentation

    • Revised input parameter descriptions to use Markdown formatting for improved clarity.
  • Chores

    • Updated configuration settings, including default chart source and version for enhanced consistency.
  • New Features

    • Introduced a new configuration option for customizing the metrics server component.
    • Updated existing variables related to the metrics server for better alignment with current standards.
  • Tests

    • Adjusted expected values in test assertions to reflect updated application and metadata versions.

@RoseSecurity RoseSecurity requested review from a team as code owners February 17, 2025 14:24
@coderabbitai
Copy link

coderabbitai bot commented Feb 17, 2025

Walkthrough

This pull request updates documentation and configuration for a Terraform module. The README now uses Markdown line breaks instead of HTML breaks in variable descriptions. In the Terraform configuration files, changes include removing an obsolete local variable, updating namespace sourcing and label merging for the metrics server module, and modifying default values and descriptions for several variables, along with introducing a new variable for the metrics server component.

Changes

File(s) Change Summary
README.md Replaced <br/> elements with Markdown line breaks in the descriptions for input variables (e.g., additional_tag_map, attributes, context, etc.).
src/main.tf Removed a local variable block for enabled; updated the source for kubernetes_namespace; added kubernetes_namespace_labels that merges tags with the namespace; updated podLabels by changing repo from "bitnami" to "kubernetes-sigs-github-io" and replacing a hardcoded component with var.metrics_server_component.
src/variables.tf Updated default values for chart_repository (to "https://kubernetes-sigs.github.io/metrics-server/") and chart_version (to "3.11.0"); revised eks_component_name description with proper capitalization; added a new variable metrics_server_component with type string and a default value of "eks-metrics-server".
test/component_test.go Adjusted import statements and updated expected values in assertions for metadata.AppVersion (to "0.6.4") and metadata.Version (to "3.11.0").

Sequence Diagram(s)

sequenceDiagram
    participant Var as variables.tf
    participant Main as main.tf
    participant MS as Metrics Server Module

    Var->>Main: Provide updated variable defaults & new metrics_server_component
    Main->>MS: Forward updated config (namespace, labels, podLabels)
    Note over Main,MS: Metrics Server module processes new settings
Loading

Poem

I'm the rabbit of code, hopping through the night,
Transforming <br/> to Markdown feels just right.
Metrics Server now dons a brand new brand,
With variables updated across the land.
A hoppy change in every line, oh what a delight!


📜 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 64cd79e and c8635bd.

📒 Files selected for processing (1)
  • test/component_test.go (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Mergify Merge Protections
  • GitHub Check: Mergify Merge Protections
  • GitHub Check: Summary
🔇 Additional comments (3)
test/component_test.go (3)

7-9: Import reordering and re-addition of atmos package is correct.

The reordering of imports and re-addition of the atmos package aligns with the overall changes in this PR. This ensures that the testing infrastructure has the necessary dependencies for interacting with the official metrics server charts.

Also applies to: 14-14


48-48: Updated app version matches the official metrics server chart.

The assertion has been correctly updated to expect app version "0.6.4" instead of "0.6.2", which reflects the version that comes with the official metrics server chart being migrated to in this PR.


55-55: Chart version update reflects migration from Bitnami to official charts.

This assertion change from "6.2.6" to "3.11.0" properly aligns with the PR's objective of upgrading from Bitnami charts to the official metrics server charts. The version numbering scheme is different between the two chart providers.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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 plan to trigger planning for file edits and PR creation.
  • @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.

@RoseSecurity RoseSecurity added major Breaking changes (or first stable release) enhancement New feature or request labels Feb 17, 2025
@mergify
Copy link

mergify bot commented Feb 17, 2025

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 Require terratest

Wonderful, this rule succeeded.

This rule require terratest status

  • check-success = test/terratest

@RoseSecurity RoseSecurity added the needs-cloudposse Needs Cloud Posse assistance label Feb 17, 2025
@mergify
Copy link

mergify bot commented Feb 17, 2025

Important

Cloud Posse Engineering Team Review Required

This pull request modifies files that require Cloud Posse's review. Please be patient, and a core maintainer will review your changes.

To expedite this process, reach out to us on Slack in the #pr-reviews channel.

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.

Actionable comments posted: 0

🧹 Nitpick comments (2)
src/main.tf (1)

1-4: State Migration Validation for Namespace Resource
The moved block correctly migrates the namespace resource from kubernetes_namespace.default to module.metrics_server.kubernetes_namespace.default. Please verify that the state migration has been executed safely in existing environments.

README.md (1)

118-121: Minor Grammar and Style Suggestions
A couple of minor grammatical improvements are recommended:

  • In the description for id_length_limit, consider changing “Set to null for keep the existing setting…” to “Set to null to keep the existing setting…”
  • In the descriptions for name and namespace inputs, adding a comma after “Usually” (e.g., “Usually, the component or solution name…” and “Usually, an abbreviation…”) can enhance clarity.
    These are small nitpicks that could improve the overall quality of the documentation.

Also applies to: 138-139

🧰 Tools
🪛 LanguageTool

[grammar] ~118-~118: Did you mean “too false to”?
Context: ..."> enabled | Set to false to prevent the module from creating any re...

(TOO_ADJECTIVE_TO)


[grammar] ~120-~120: This verb might not be in the correct form.
Context: ...se so the full diff of what is changing can been seen in the plan | bool | false | n...

(MD_BE)


[grammar] ~121-~121: The verb ‘keep’ seems to be in the wrong form here.
Context: ... for unlimited length.
Set to null for keep the existing setting, which defaults to...

(FOR_VB)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 862a5b3 and 325db4b.

📒 Files selected for processing (3)
  • README.md (1 hunks)
  • src/main.tf (3 hunks)
  • src/variables.tf (2 hunks)
🧰 Additional context used
🪛 LanguageTool
README.md

[grammar] ~118-~118: Did you mean “too false to”?
Context: ..."> enabled | Set to false to prevent the module from creating any re...

(TOO_ADJECTIVE_TO)


[grammar] ~120-~120: This verb might not be in the correct form.
Context: ...se so the full diff of what is changing can been seen in the plan | bool | false | n...

(MD_BE)


[grammar] ~121-~121: The verb ‘keep’ seems to be in the wrong form here.
Context: ... for unlimited length.
Set to null for keep the existing setting, which defaults to...

(FOR_VB)


[typographical] ~138-~138: Consider adding a comma after ‘Usually’ for more clarity.
Context: ... name | ID element. Usually the component or solution name, e.g. 'a...

(RB_LY_COMMA)


[typographical] ~139-~139: Consider adding a comma after ‘Usually’ for more clarity.
Context: ...space](#input_namespace) | ID element. Usually an abbreviation of your organization na...

(RB_LY_COMMA)

⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: component / terraform / Lint (./src)
  • GitHub Check: Mergify Merge Protections
  • GitHub Check: Mergify Merge Protections
  • GitHub Check: Summary
🔇 Additional comments (8)
src/main.tf (2)

23-24: Introduce Configurable Namespace Labels
The addition of kubernetes_namespace_labels = merge(module.this.tags, { name = var.kubernetes_namespace }) enhances flexibility by allowing pod label customization. Confirm that merging tags in this manner does not unintentionally override any critical labels.


44-46: Update Pod Labels for Metrics Server
The modifications in the podLabels block—updating the repo value to "kubernetes-sigs-github-io" and setting component to use the new variable var.metrics_server_component—align the configuration with the official metrics server charts. Ensure that the documentation and any downstream dependencies reflect these label changes.

src/variables.tf (4)

18-22: Update Chart Repository URL
The default for chart_repository has been updated from Bitnami to the official metrics server repository URL. Verify that the URL "https://kubernetes-sigs.github.io/metrics-server/" is correct and that any automated tooling (e.g., CI/CD pipelines) is updated to reflect this change.


24-28: Upgrade Chart Version
The default value for chart_version has been changed from "6.2.6" to "3.11.0". Please ensure this version is compatible with your deployment and that any breaking changes in the new chart version have been addressed.


102-107: Correct EKS Component Description
The description for eks_component_name has been updated to "The name of the EKS component", which improves readability and professional consistency.


108-113: Introduce Metrics Server Component Variable
A new variable metrics_server_component has been added with a default value of "eks-metrics-server". This allows the component name to be configurable and avoids hardcoding. Ensure that references to this variable in the module (e.g., in podLabels) and in the documentation are updated accordingly.

README.md (2)

3-7: Documentation Banner and Badge Section
No functionality change; the banner and badges remain intact. The removal of HTML <br/> tags in favor of Markdown line breaks elsewhere (as seen later) improves consistency.


104-148: Refine Input Variable Descriptions Formatting
The input variable descriptions have been updated to replace HTML <br/> tags with Markdown line breaks. This update improves the readability and consistency of the documentation for variables such as additional_tag_map, attributes, delimiter, and others. Please review the rendered Markdown to ensure that the format meets your documentation standards.

🧰 Tools
🪛 LanguageTool

[grammar] ~118-~118: Did you mean “too false to”?
Context: ..."> enabled | Set to false to prevent the module from creating any re...

(TOO_ADJECTIVE_TO)


[grammar] ~120-~120: This verb might not be in the correct form.
Context: ...se so the full diff of what is changing can been seen in the plan | bool | false | n...

(MD_BE)


[grammar] ~121-~121: The verb ‘keep’ seems to be in the wrong form here.
Context: ... for unlimited length.
Set to null for keep the existing setting, which defaults to...

(FOR_VB)


[typographical] ~138-~138: Consider adding a comma after ‘Usually’ for more clarity.
Context: ... name | ID element. Usually the component or solution name, e.g. 'a...

(RB_LY_COMMA)


[typographical] ~139-~139: Consider adding a comma after ‘Usually’ for more clarity.
Context: ...space](#input_namespace) | ID element. Usually an abbreviation of your organization na...

(RB_LY_COMMA)

@GabisCampana
Copy link

@goruha

@goruha goruha self-assigned this Feb 18, 2025
@mergify
Copy link

mergify bot commented Mar 19, 2025

Heads up! This pull request looks stale. It will be closed soon, if there are no new commits. ⏳

@mergify mergify bot added stale This PR has gone stale and removed stale This PR has gone stale labels Mar 19, 2025
@gberenice
Copy link
Contributor

/terratest

@mergify
Copy link

mergify bot commented Mar 26, 2025

Heads up! This pull request looks stale. It will be closed soon, if there are no new commits. ⏳

@mergify mergify bot added stale This PR has gone stale and removed stale This PR has gone stale labels Mar 26, 2025
@RoseSecurity
Copy link
Contributor Author

/terratest

@mergify mergify bot added the needs-test Needs testing label Apr 1, 2025
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.

Actionable comments posted: 0

🧹 Nitpick comments (7)
README.md (7)

104-104: Formatting Consistency & Punctuation:
The description for the additional_tag_map input now uses Markdown <br> instead of <br/>, which improves consistency. However, static analysis suggests that a period may be missing at the end of the first sentence. Please review if adding terminal punctuation would improve clarity.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~104-~104: A period might be missing here.
Context: ...s_list_of_maps. Not added to tagsorid`.
This is for some rare cases wher...

(AI_EN_LECTOR_MISSING_PUNCTUATION_PERIOD)


106-106: Punctuation Suggestion for Clarity:
In the attributes input description, consider adding a comma after the parenthetical examples (e.g., after “cluster”) to improve readability.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~106-~106: A comma might be missing here.
Context: ...(e.g. workers or cluster) to add to id,
in the order they appear in the ...

(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)


107-107: Article Inclusion Recommendation:
The description for the chart input would be clearer by inserting the indefinite article “a” before “local path” (i.e. “a local path”).

🧰 Tools
🪛 LanguageTool

[uncategorized] ~107-~107: You might be missing the article “a” here.
Context: ... to be installed. The chart name can be local path, a URL to a chart, or the name of ...

(AI_EN_LECTOR_MISSING_DETERMINER_A)


121-121: Grammar Improvement Needed:
In the id_length_limit description, the phrase “for keep the existing setting” should be revised to “to keep the existing setting” for proper grammatical structure.

🧰 Tools
🪛 LanguageTool

[grammar] ~121-~121: The verb ‘keep’ seems to be in the wrong form here.
Context: ... for unlimited length.
Set to null for keep the existing setting, which defaults to...

(FOR_VB)


138-138: Phrasing & Punctuation Enhancement:
The description for the name input would benefit from a comma after “Usually” and a slight rephrasing. Consider revising to: “ID element. Usually, the component or solution name (e.g., ‘app’ or ‘jenkins’). This is the only ID element that is not also included as a tag – the “name” tag is set to the full id string.”

🧰 Tools
🪛 LanguageTool

[typographical] ~138-~138: Consider adding a comma after ‘Usually’ for more clarity.
Context: ... name | ID element. Usually the component or solution name, e.g. 'a...

(RB_LY_COMMA)


[uncategorized] ~138-~138: Possible missing preposition found.
Context: ...ID element not also included as a tag.
The "name" tag is set to the full id s...

(AI_EN_LECTOR_MISSING_PREPOSITION)


139-139: Clarity Improvement:
In the namespace input description, adding a comma after “Usually” would help clarify the text.

🧰 Tools
🪛 LanguageTool

[typographical] ~139-~139: Consider adding a comma after ‘Usually’ for more clarity.
Context: ...space](#input_namespace) | ID element. Usually an abbreviation of your organization na...

(RB_LY_COMMA)


100-152: New Variable Documentation Reminder:
The PR objectives mention the introduction of a new variable for the metrics server component (i.e. metrics_server_component). However, it isn’t documented in this README. Please update the Inputs section to include details on this new variable so that users understand its purpose and usage.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~104-~104: A period might be missing here.
Context: ...s_list_of_maps. Not added to tagsorid`.
This is for some rare cases wher...

(AI_EN_LECTOR_MISSING_PUNCTUATION_PERIOD)


[uncategorized] ~106-~106: A comma might be missing here.
Context: ...(e.g. workers or cluster) to add to id,
in the order they appear in the ...

(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)


[uncategorized] ~107-~107: You might be missing the article “a” here.
Context: ... to be installed. The chart name can be local path, a URL to a chart, or the name of ...

(AI_EN_LECTOR_MISSING_DETERMINER_A)


[grammar] ~118-~118: Did you mean “too false to”?
Context: ..."> enabled | Set to false to prevent the module from creating any re...

(TOO_ADJECTIVE_TO)


[grammar] ~120-~120: This verb might not be in the correct form.
Context: ...se so the full diff of what is changing can been seen in the plan | bool | false | n...

(MD_BE)


[grammar] ~121-~121: The verb ‘keep’ seems to be in the wrong form here.
Context: ... for unlimited length.
Set to null for keep the existing setting, which defaults to...

(FOR_VB)


[typographical] ~138-~138: Consider adding a comma after ‘Usually’ for more clarity.
Context: ... name | ID element. Usually the component or solution name, e.g. 'a...

(RB_LY_COMMA)


[uncategorized] ~138-~138: Possible missing preposition found.
Context: ...ID element not also included as a tag.
The "name" tag is set to the full id s...

(AI_EN_LECTOR_MISSING_PREPOSITION)


[typographical] ~139-~139: Consider adding a comma after ‘Usually’ for more clarity.
Context: ...space](#input_namespace) | ID element. Usually an abbreviation of your organization na...

(RB_LY_COMMA)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 325db4b and 64cd79e.

📒 Files selected for processing (1)
  • README.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
README.md

[uncategorized] ~104-~104: A period might be missing here.
Context: ...s_list_of_maps. Not added to tagsorid`.
This is for some rare cases wher...

(AI_EN_LECTOR_MISSING_PUNCTUATION_PERIOD)


[uncategorized] ~106-~106: A comma might be missing here.
Context: ...(e.g. workers or cluster) to add to id,
in the order they appear in the ...

(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)


[uncategorized] ~107-~107: You might be missing the article “a” here.
Context: ... to be installed. The chart name can be local path, a URL to a chart, or the name of ...

(AI_EN_LECTOR_MISSING_DETERMINER_A)


[grammar] ~118-~118: Did you mean “too false to”?
Context: ..."> enabled | Set to false to prevent the module from creating any re...

(TOO_ADJECTIVE_TO)


[grammar] ~120-~120: This verb might not be in the correct form.
Context: ...se so the full diff of what is changing can been seen in the plan | bool | false | n...

(MD_BE)


[grammar] ~121-~121: The verb ‘keep’ seems to be in the wrong form here.
Context: ... for unlimited length.
Set to null for keep the existing setting, which defaults to...

(FOR_VB)


[typographical] ~138-~138: Consider adding a comma after ‘Usually’ for more clarity.
Context: ... name | ID element. Usually the component or solution name, e.g. 'a...

(RB_LY_COMMA)


[uncategorized] ~138-~138: Possible missing preposition found.
Context: ...ID element not also included as a tag.
The "name" tag is set to the full id s...

(AI_EN_LECTOR_MISSING_PREPOSITION)


[typographical] ~139-~139: Consider adding a comma after ‘Usually’ for more clarity.
Context: ...space](#input_namespace) | ID element. Usually an abbreviation of your organization na...

(RB_LY_COMMA)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Mergify Merge Protections
  • GitHub Check: Mergify Merge Protections
  • GitHub Check: Summary
🔇 Additional comments (1)
README.md (1)

109-109: Verify Chart Repository URL:
According to the PR objective of upgrading from Bitnami to official metrics server charts, please confirm whether the default value for chart_repository should be updated from "https://charts.bitnami.com/bitnami" to "https://kubernetes-sigs.github.io/metrics-server/". If so, update the README accordingly.

@RoseSecurity
Copy link
Contributor Author

/terratest

1 similar comment
@goruha
Copy link
Contributor

goruha commented Apr 1, 2025

/terratest

@goruha goruha merged commit ec7954e into main Apr 2, 2025
19 checks passed
@goruha goruha deleted the convert-bitnami-charts branch April 2, 2025 08:31
@mergify mergify bot removed the needs-cloudposse Needs Cloud Posse assistance label Apr 2, 2025
@github-actions
Copy link

github-actions bot commented Apr 2, 2025

These changes were released in v2.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request major Breaking changes (or first stable release) needs-test Needs testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants