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: bump operator version to v0.1.3-alpha.3 #192

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

zyy17
Copy link
Collaborator

@zyy17 zyy17 commented Nov 7, 2024

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced logging filters for datanode, flownode, frontend, and meta components in the GreptimeDBCluster and GreptimeDBStandalone configurations.
    • Added conditional support for pod metrics in the deployment configuration.
  • Version Updates

    • Updated application version to 0.1.3-alpha.3 and chart version to 0.2.10.
  • Configuration Changes

    • New podMetrics section added to the apiServer configuration, defaulting to disabled.

Copy link
Contributor

coderabbitai bot commented Nov 7, 2024

Walkthrough

The pull request introduces several updates to the greptimedb-operator Helm chart. Key changes include version increments in the Chart.yaml and README.md files, the addition of a new podMetrics configuration under the apiServer section, and updates to the image tag. Modifications to the ClusterRole and Custom Resource Definitions (CRDs) enhance logging capabilities by adding a filters property. Additionally, the deployment configuration is updated to conditionally include a command-line argument for pod metrics.

Changes

File Path Change Summary
charts/greptimedb-operator/Chart.yaml - Updated appVersion from 0.1.3-alpha.1 to 0.1.3-alpha.3
- Updated version from 0.2.9 to 0.2.10
charts/greptimedb-operator/README.md - Updated Version from 0.2.9 to 0.2.10
- Updated AppVersion from 0.1.3-alpha.1 to 0.1.3-alpha.3
- Added apiServer.podMetrics and apiServer.podMetrics.enabled
- Updated image.tag from "v0.1.3-alpha.1" to "v0.1.3-alpha.3"
charts/greptimedb-operator/templates/clusterrole.yaml - Added new rule for metrics.k8s.io API group to access pods with get and list verbs based on conditions.
charts/greptimedb-operator/templates/crds/crd-greptimedbcluster.yaml - Added filters property under logging for datanode, flownode, frontend, and meta sections.
charts/greptimedb-operator/templates/crds/crd-greptimedbstandalone.yaml - Added filters property under logging in spec schema for GreptimeDBStandalone.
charts/greptimedb-operator/templates/deployment.yaml - Conditionally added --enable-pod-metrics argument to manager container args based on podMetrics.enabled.
charts/greptimedb-operator/values.yaml - Updated tag from v0.1.3-alpha.1 to v0.1.3-alpha.3
- Added podMetrics section with enabled: false.

Possibly related PRs

Suggested reviewers

  • daviderli614

Poem

🐇 In the meadow, changes bloom,
New versions rise, dispelling gloom.
Pod metrics dance, with filters to play,
Greptimedb's charm grows day by day!
Hops of joy as we deploy,
A chart so bright, it brings us joy! 🌼


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 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.

@zyy17 zyy17 force-pushed the chore/upgrade-operator branch from 0e8d84f to 80151af Compare November 7, 2024 07:50
@zyy17 zyy17 changed the title refactor: bump operator version to v0.1.3-alpha.2 refactor: bump operator version to v0.1.3-alpha.3 Nov 7, 2024
@zyy17 zyy17 marked this pull request as ready for review November 7, 2024 07:50
@zyy17 zyy17 requested a review from daviderli614 November 7, 2024 07:51
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: 2

🧹 Outside diff range and nitpick comments (4)
charts/greptimedb-operator/templates/deployment.yaml (1)

64-64: Minor: Add space before closing braces.

There's a minor formatting inconsistency in the end tag. Consider adding a space before the closing braces for consistency.

-          {{- end}}
+          {{- end }}
charts/greptimedb-operator/templates/clusterrole.yaml (1)

164-172: Consider adding a comment explaining the metrics.k8s.io permissions.

Adding a brief comment above this section would help other developers understand when and why these permissions are needed.

+  # Required for collecting pod metrics via the metrics.k8s.io API when pod metrics collection is enabled
   {{- if and .Values.apiServer.enabled .Values.apiServer.podMetrics.enabled }}
   - apiGroups:
       - metrics.k8s.io
charts/greptimedb-operator/templates/crds/crd-greptimedbstandalone.yaml (1)

2926-2929: LGTM! The logging filters property is well-structured.

The addition of the filters array property to the logging configuration follows Kubernetes CRD best practices and provides a clean way to configure logging filters.

Consider documenting the following in the chart's README or values file:

  • Available filter options
  • Filter format/syntax
  • Examples of common filter configurations
charts/greptimedb-operator/templates/crds/crd-greptimedbcluster.yaml (1)

2913-2916: LGTM! The filters schema is consistently implemented across all components.

The new filters property has been added with consistent schema definition across all logging configurations (datanode, flownode, frontend, meta, and standalone monitoring components).

Consider adding:

  1. OpenAPI schema description field to document the purpose and expected values of filters
  2. Pattern validation if there are specific format requirements for the filter strings

Example enhancement:

 filters:
   items:
     type: string
+    description: "Logging filters to control which log entries are processed"
+    pattern: "^[a-zA-Z0-9_.-]+$"  # Add if there's a specific format requirement
   type: array
+  description: "List of logging filters"

Also applies to: 5827-5830, 8724-8727, 11654-11657, 17489-17492

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between ad0e1aa and 80151af.

📒 Files selected for processing (7)
  • charts/greptimedb-operator/Chart.yaml (1 hunks)
  • charts/greptimedb-operator/README.md (3 hunks)
  • charts/greptimedb-operator/templates/clusterrole.yaml (1 hunks)
  • charts/greptimedb-operator/templates/crds/crd-greptimedbcluster.yaml (6 hunks)
  • charts/greptimedb-operator/templates/crds/crd-greptimedbstandalone.yaml (1 hunks)
  • charts/greptimedb-operator/templates/deployment.yaml (1 hunks)
  • charts/greptimedb-operator/values.yaml (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • charts/greptimedb-operator/Chart.yaml
🔇 Additional comments (7)
charts/greptimedb-operator/values.yaml (2)

11-11: LGTM: Version bump is consistent.

The image tag update aligns with the PR objectives and is consistently applied across the chart files.


73-77: LGTM: Well-structured feature addition with secure defaults.

The new podMetrics configuration is properly documented and follows security best practices by being disabled by default.

Let's verify the related configuration changes mentioned in the summary:

✅ Verification successful

✅ Feature integration verified across chart components

The verification confirms proper integration of the podMetrics feature:

  • Command-line flag --enable-pod-metrics is correctly added in deployment.yaml
  • Documentation is properly updated in README.md with matching configuration structure and defaults
  • However, we should verify the ClusterRole permissions as they weren't found in the initial search

✅ Complete feature integration verified with proper RBAC configuration

The podMetrics feature is correctly integrated across all components:

  • Command-line flag --enable-pod-metrics is present in deployment.yaml
  • RBAC permissions are properly configured with conditional rules for metrics.k8s.io API group
  • Documentation in README.md accurately reflects the configuration options
  • Security is well-implemented:
    • Feature is disabled by default
    • Required RBAC permissions are only added when both apiServer.enabled and apiServer.podMetrics.enabled are true
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the integration of podMetrics feature across chart files

# Test 1: Check if deployment.yaml correctly uses this flag
echo "Checking deployment.yaml for pod metrics argument..."
rg --type yaml "enable-pod-metrics" charts/greptimedb-operator/templates/

# Test 2: Verify RBAC rules in ClusterRole
echo "Checking ClusterRole for pod metrics permissions..."
rg --type yaml "pods/metrics" charts/greptimedb-operator/templates/

# Test 3: Confirm documentation in README
echo "Checking README documentation..."
rg "podMetrics" charts/greptimedb-operator/README.md

Length of output: 948


Script:

#!/bin/bash
# Let's check the complete RBAC rules to verify metrics-server permissions
echo "Checking complete RBAC configuration..."
rg -A 5 "rules:" charts/greptimedb-operator/templates/clusterrole.yaml

Length of output: 270


Script:

#!/bin/bash
# Let's get the complete ClusterRole content to verify all permissions
echo "Checking full ClusterRole content..."
cat charts/greptimedb-operator/templates/clusterrole.yaml

# Also check if there's a separate ClusterRole for metrics
echo -e "\nChecking for other RBAC files..."
fd clusterrole charts/greptimedb-operator/templates/

Length of output: 3171

charts/greptimedb-operator/templates/deployment.yaml (1)

61-64: LGTM! Verify values documentation.

The conditional pod metrics flag implementation looks good. The feature is properly gated behind both the API server and pod metrics configuration.

Let's verify the documentation of this new flag:

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

5-5: LGTM: Version updates are consistent.

The version updates align with the PR objective of bumping the operator version to v0.1.3-alpha.3.


118-118: LGTM: Image tag update is consistent.

The image tag update to v0.1.3-alpha.3 aligns with the appVersion and PR objective.

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

Line range hint 1-7: LGTM! The conditional CRD installation is properly implemented.

The CRD installation is correctly controlled by:

  • .Values.crds.install for optional installation
  • .Values.crds.keep annotation to protect CRD from deletion

Line range hint 23-82: LGTM! The CRD versioning and status configuration follows best practices.

The implementation includes:

  • Proper versioning with v1alpha1
  • Enabled status subresource
  • Well-defined printer columns for kubectl output

@zyy17 zyy17 merged commit c5cf6f7 into GreptimeTeam:main Nov 7, 2024
4 checks passed
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