Skip to content

Add mandatory kafka env values to parseable helm template #1291

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

Merged
merged 4 commits into from
Apr 11, 2025

Conversation

hippalus
Copy link
Contributor

@hippalus hippalus commented Apr 8, 2025

#1290.

Description


This PR has:

  • been tested to ensure log ingestion and log query works.
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added documentation for new or modified features or behaviors.

Summary by CodeRabbit

  • New Features
    • Enhanced Kafka connector integration with new, configurable environment settings for the deployment.
    • Introduced a new configuration section for customizing Kafka connection settings, consumer topics, and partition concurrency.
    • Added dynamic environment variables for the Kafka connector based on configuration settings.

Copy link

coderabbitai bot commented Apr 8, 2025

Walkthrough

The changes introduce conditional Kafka connector configurations to two Helm template files by adding new environment variables within container specifications. Additionally, a new section is added to the Helm values file that defines Kafka connector parameters. These modifications ensure that when the Kafka connector is enabled, the corresponding environment variables are injected into the deployments. The existing container settings remain unchanged while extending functionality for Kafka integration.

Changes

File(s) Change Summary
helm/templates/ingestor-statefulset.yaml,
helm/templates/standalone-deployment.yaml
Added environment variables based on parseable.kafkaConnector.env when parseable.kafkaConnector.enabled is true. Adjusted formatting of the args line in the standalone deployment.
helm/values.yaml Introduced a new kafkaConnector section with parameters: enabled (false), env containing P_KAFKA_BOOTSTRAP_SERVERS ("my-kafka.kafka.svc.cluster.local:9092"), P_KAFKA_PARTITION_LISTENER_CONCURRENCY (2), and P_KAFKA_CONSUMER_TOPICS ("test-log-stream-0,test-log-stream-1").

Sequence Diagram(s)

sequenceDiagram
    actor User as User
    participant V as helm/values.yaml
    participant T as Helm Template
    participant K as Kubernetes Deployment

    User->>V: Set Kafka connector configuration
    V->>T: Provide Kafka connector values
    alt Kafka connector enabled
        T->>K: Deploy with Kafka environment variables
    else Kafka connector disabled
        T->>K: Deploy without Kafka environment variables
    end
Loading

Poem

I hop through code with joyful flair,
Configuring Kafka with utmost care.
New env vars spring in, oh so bright,
Guiding deployments by day and night.
With carrots of change, I celebrate our flight! 🐇✨


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

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 (3)
helm/values.yaml (1)

251-255: Kafka Connector Configuration Block Added
The new kafkaConnector block adds essential Kafka configuration parameters. Please verify that its indentation and placement are consistent with the rest of the Parseable configuration. In particular, confirm that it is nested under the appropriate parent key (if intended) and that the types—such as using a comma‐separated string for consumerTopics—align with how these values will be consumed later in the Helm templates.

helm/templates/standalone-deployment.yaml (1)

115-122: Kafka Environment Variables in Deployment Template
A new block conditionally injects environment variables for Kafka when .Values.parseable.kafkaConnector.enabled is true. The variables P_KAFKA_BOOTSTRAP_SERVERS, P_KAFKA_CONSUMER_TOPICS, and P_KAFKA_PARTITION_LISTENER_CONCURRENCY are correctly templated using the values from the chart configuration. Please verify that the value types match your expectations (for example, if you need a list for topics, you might consider YAML’s native list syntax instead of a comma‐separated string).

helm/templates/ingestor-statefulset.yaml (1)

142-149: Kafka Environment Variables in Ingestor StatefulSet
The addition of the Kafka-related environment variables under a conditional block is consistent with the approach used in the standalone deployment template. Just ensure that the values provided in helm/values.yaml are accurate and that the conditional check on .Values.parseable.kafkaConnector.enabled behaves as expected. This consistency across deployment types will help maintain uniformity in Kafka integration.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between f79a495 and 8a18d5e.

📒 Files selected for processing (3)
  • helm/templates/ingestor-statefulset.yaml (1 hunks)
  • helm/templates/standalone-deployment.yaml (2 hunks)
  • helm/values.yaml (1 hunks)
🔇 Additional comments (1)
helm/templates/standalone-deployment.yaml (1)

38-40: Deployment Command Arguments Formatting
A minor change was made to the formatting of the args array (i.e. the added space after the bracket). This change does not affect functionality, but ensure that formatting remains consistent with other similar templates if you are standardizing your style.

coderabbitai[bot]
coderabbitai bot previously approved these changes Apr 8, 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 (1)
helm/templates/ingestor-statefulset.yaml (1)

142-147: Inject Kafka Connector Environment Variables Conditionally

The newly added block conditionally injects Kafka-related environment variables when .Values.parseable.kafkaConnector.enabled is true. The use of tpl $value $ | quote is consistent with similar patterns for existing environment variables, helping to resolve template expressions properly. Please double-check the YAML indentation within the env: section to ensure that the injected items align correctly with other environment variables.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8a18d5e and 7f99d7f.

📒 Files selected for processing (3)
  • helm/templates/ingestor-statefulset.yaml (1 hunks)
  • helm/templates/standalone-deployment.yaml (3 hunks)
  • helm/values.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • helm/templates/standalone-deployment.yaml
🔇 Additional comments (1)
helm/values.yaml (1)

250-267: Introduce Kafka Connector Configuration Section

A new kafkaConnector section has been added with the following properties:

  • enabled is set to false by default, ensuring that the Kafka connector is opt-in.
  • The env map includes key Kafka configuration parameters such as:
    • P_KAFKA_BOOTSTRAP_SERVERS
    • P_KAFKA_PARTITION_LISTENER_CONCURRENCY
    • P_KAFKA_CONSUMER_TOPICS

The inline comments provide useful context for these parameters. Consider supplementing with additional documentation if these values might require further explanation for end users in the future.

coderabbitai[bot]
coderabbitai bot previously approved these changes Apr 10, 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 (1)
helm/values.yaml (1)

12-26: High Availability Ingestor Configuration Update

The updates to the ingestor block under highAvailability (including the addition of affinity: { }, podAnnotations: { }, nodeSelector: { }, and tolerations: [ ]) help standardize pod configuration. Please review the commented-out lines (lines 19–20) to decide whether they should be retained as documentation or removed to avoid confusion in future maintenance.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7f99d7f and 3c7ae4f.

📒 Files selected for processing (1)
  • helm/values.yaml (11 hunks)
🔇 Additional comments (3)
helm/values.yaml (3)

156-159: ServiceAccount Configuration Update

The addition of an empty annotations field and the new nodeSelector under the serviceAccount section are useful for ensuring consistent metadata configuration. If these fields are intended as placeholders for future customization, consider adding a clarifying comment.


244-249: Metrics Section Formatting

The introduction of empty objects for attachMetadata and bodySizeLimit in the metrics configuration provides clear placeholders for potential future parameters. Please verify that these empty defaults do not inadvertently override any expected defaults in downstream processing.


249-281: New Kafka Connector Configuration Section

A new kafkaConnector section has been added, which includes the mandatory Kafka environment configuration:

  • enabled: set to false by default.
  • env: defines key Kafka parameters such as
    • P_KAFKA_BOOTSTRAP_SERVERS: "my-kafka.kafka.svc.cluster.local:9092"
    • P_KAFKA_PARTITION_LISTENER_CONCURRENCY: "2"
    • P_KAFKA_CONSUMER_TOPICS: "test-log-stream-0,test-log-stream-1"

The inline comments are clear and offer context for both required and optional settings. Please ensure that downstream Helm templates (for example, in the ingestor-statefulset and standalone-deployment) correctly reference these values when the connector is enabled.

@nitisht
Copy link
Member

nitisht commented Apr 11, 2025

Thank you @hippalus looks great, merging now

@nitisht nitisht merged commit cec4ab8 into parseablehq:main Apr 11, 2025
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.

3 participants