Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: add labels and annotations for pvc #219

Conversation

zyy17
Copy link
Collaborator

@zyy17 zyy17 commented Jan 13, 2025

Summary by CodeRabbit

  • New Features

    • Added support for custom labels and annotations for datanode storage, object storage, and cache configurations
    • Introduced flownode configuration options
  • Improvements

    • Increased resource limits for vector monitoring from 50m/64Mi to 500m/256Mi
    • Updated initializer image tag to v0.1.4-alpha.3
  • Version Updates

    • GreptimeDB Cluster Helm Chart: Bumped from 0.2.43 to 0.2.44
    • GreptimeDB Operator Helm Chart: Updated from 0.2.14 to 0.2.15
    • Application version updated to 0.1.4-alpha.3

@zyy17 zyy17 requested a review from daviderli614 January 13, 2025 04:09
Copy link
Contributor

coderabbitai bot commented Jan 13, 2025

Walkthrough

This pull request introduces updates to the GreptimeDB Helm charts for both the cluster and operator components. The changes primarily involve version increments, image tag updates, and the addition of new configuration options for storage metadata. The modifications span multiple files across the greptimedb-cluster and greptimedb-operator charts, focusing on version bumps from 0.1.4-alpha.2 to 0.1.4-alpha.3 and expanding configuration flexibility for storage resources.

Changes

File Change Summary
charts/greptimedb-cluster/Chart.yaml Version bumped from 0.2.43 to 0.2.44
charts/greptimedb-cluster/README.md Updated initializer image tag, added storage configuration options, increased monitoring resource limits
charts/greptimedb-cluster/templates/cluster.yaml Added labels and annotations for datanode storage, introduced new flownode configuration section
charts/greptimedb-cluster/values.yaml Updated initializer image tag, added storage labels and annotations, increased vector resource requests/limits
charts/greptimedb-operator/Chart.yaml Updated appVersion and chart version
charts/greptimedb-operator/README.md Updated version badges and image tag
charts/greptimedb-operator/templates/crds/* Added annotations and labels properties to storage configurations in CRDs
charts/greptimedb-operator/values.yaml Updated operator image tag

Possibly related PRs

Suggested reviewers

  • evenyag
  • killme2008

Poem

🐰 Hop, hop, version's on the rise,
Metadata dancing before our eyes,
Clusters and operators, sleek and bright,
Alpha tags sparkling with delight!
A rabbit's update, precise and neat 🚀


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 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. (Beta)
  • @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
Contributor

@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 (1)
charts/greptimedb-operator/templates/crds/crd-greptimedbcluster.yaml (1)

3118-3125: LGTM! Well-structured storage metadata additions.

The implementation consistently adds annotations and labels fields across all storage-related sections, following Kubernetes best practices for resource metadata.

Consider adding schema examples in the CRD comments to demonstrate the usage of these new fields.

Also applies to: 18474-18481, 18375-18382, 18714-18721, 18829-18836

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 03ebef0 and aea5b54.

📒 Files selected for processing (9)
  • charts/greptimedb-cluster/Chart.yaml (1 hunks)
  • charts/greptimedb-cluster/README.md (5 hunks)
  • charts/greptimedb-cluster/templates/cluster.yaml (1 hunks)
  • charts/greptimedb-cluster/values.yaml (4 hunks)
  • charts/greptimedb-operator/Chart.yaml (1 hunks)
  • charts/greptimedb-operator/README.md (2 hunks)
  • charts/greptimedb-operator/templates/crds/crd-greptimedbcluster.yaml (6 hunks)
  • charts/greptimedb-operator/templates/crds/crd-greptimedbstandalone.yaml (3 hunks)
  • charts/greptimedb-operator/values.yaml (1 hunks)
✅ Files skipped from review due to trivial changes (4)
  • charts/greptimedb-operator/values.yaml
  • charts/greptimedb-operator/Chart.yaml
  • charts/greptimedb-cluster/Chart.yaml
  • charts/greptimedb-operator/README.md
🧰 Additional context used
🪛 LanguageTool
charts/greptimedb-cluster/README.md

[uncategorized] ~288-~288: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...is key prefix | | monitoring | object | {"enabled":false,"logsCollection":{"pipeline":{"data":""}},"standalone":{},"vector":{"registry":"docker.io","repository":"timberio/vector","resources":{"limits":{"cpu":"500m","memory":"256Mi"},"requests":{"cpu":"500m","memory":"256Mi"}},"tag":"nightly-alpine"}} | The monitoring bootstrap configur...

(HYPHENATED_LY_ADVERB_ADJECTIVE)


[uncategorized] ~293-~293: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...g data | | monitoring.vector | object | {"registry":"docker.io","repository":"timberio/vector","resources":{"limits":{"cpu":"500m","memory":"256Mi"},"requests":{"cpu":"500m","memory":"256Mi"}},"tag":"nightly-alpine"} | Configure vector for logs and metr...

(HYPHENATED_LY_ADVERB_ADJECTIVE)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: chart-test
🔇 Additional comments (7)
charts/greptimedb-cluster/templates/cluster.yaml (1)

368-373: LGTM! Clean implementation of PVC metadata configuration.

The implementation properly handles labels and annotations for PVC configuration, with correct indentation and conditional blocks.

charts/greptimedb-cluster/README.md (2)

133-135: LGTM! Clear documentation of new storage metadata fields.

Documentation properly describes the new PVC labels and annotations capabilities.


288-296: Verify the resource allocation increase for vector.

The monitoring vector resources have been significantly increased:

  • CPU: 50m → 500m (10x increase)
  • Memory: 64Mi → 256Mi (4x increase)

Please confirm if these increases are intentional and necessary.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~288-~288: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...is key prefix | | monitoring | object | {"enabled":false,"logsCollection":{"pipeline":{"data":""}},"standalone":{},"vector":{"registry":"docker.io","repository":"timberio/vector","resources":{"limits":{"cpu":"500m","memory":"256Mi"},"requests":{"cpu":"500m","memory":"256Mi"}},"tag":"nightly-alpine"}} | The monitoring bootstrap configur...

(HYPHENATED_LY_ADVERB_ADJECTIVE)


[uncategorized] ~293-~293: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...g data | | monitoring.vector | object | {"registry":"docker.io","repository":"timberio/vector","resources":{"limits":{"cpu":"500m","memory":"256Mi"},"requests":{"cpu":"500m","memory":"256Mi"}},"tag":"nightly-alpine"} | Configure vector for logs and metr...

(HYPHENATED_LY_ADVERB_ADJECTIVE)

charts/greptimedb-cluster/values.yaml (2)

542-545: LGTM! Proper default values for new storage metadata.

The new storage metadata fields are properly initialized as empty objects, allowing users to optionally configure them.


906-910: Consistent resource updates for vector monitoring.

The vector resource changes match the documentation in README.md.

charts/greptimedb-operator/templates/crds/crd-greptimedbstandalone.yaml (1)

3041-3048: LGTM! Comprehensive schema updates for storage metadata.

The CRD schema has been properly updated to include labels and annotations for all storage configurations:

  • Datanode storage
  • Cache storage
  • RaftEngine storage

The schema definitions are consistent and include proper validation.

Also applies to: 3140-3147, 3288-3295

charts/greptimedb-operator/templates/crds/crd-greptimedbcluster.yaml (1)

3118-3125: Verify schema validation for storage metadata.

The schema looks correct, but let's verify the validation works as expected.

✅ Verification successful

Storage metadata schema validation is correctly implemented

The schema validation for storage metadata (annotations and labels) is properly implemented and matches the actual usage in the cluster template and values. The implementation correctly handles optional key-value string pairs with proper defaults.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if any existing CRs are using these fields and validate their structure

# Search for any usage of annotations or labels in storage configurations
ast-grep --pattern 'fs: 
  $$$
  annotations: $_
  $$$' 

ast-grep --pattern 'fs:
  $$$
  labels: $_
  $$$'

Length of output: 109


Script:

#!/bin/bash
# Search for storage-related configurations in YAML files
rg -l "kind:\s+GreptimeDBCluster" --type yaml

# Check CRD schema structure
rg -A 10 "properties:\s+storage:" --type yaml

# Look for any example configurations or tests
fd -e yaml -e yml | xargs rg "storage:|fs:"

Length of output: 4016


Script:

#!/bin/bash
# Get complete storage configuration from example CR
rg -A 15 "^\s+storage:" charts/greptimedb-cluster/templates/cluster.yaml

# Check values file storage configuration
rg -A 15 "^\s+storage:" charts/greptimedb-cluster/values.yaml

# Look specifically for any annotations or labels usage in storage context
rg -B 5 -A 5 "annotations:|labels:" charts/greptimedb-cluster/templates/cluster.yaml

Length of output: 5838

@MichaelScofield MichaelScofield merged commit 9781241 into GreptimeTeam:main Jan 13, 2025
3 checks passed
@zyy17 zyy17 deleted the refactor/add-pvc-labels-and-annotations branch January 13, 2025 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants