Skip to content

Conversation

@sharmajidotdev
Copy link

@sharmajidotdev sharmajidotdev commented Dec 26, 2025

This PR introduces a Helm chart for deploying Capture on Kubernetes. It provides templated resources (Deployment, Service, Secret, ConfigMap), default values, and installation instructions to make installs and upgrades repeatable.
Solves Issue #72
Changes:

  • Add Helm chart scaffolding at charts/helm/capture
  • Include templates for Deployment, Service, Secret, and ConfigMap
  • Provide defaults in values.yaml and usage docs in INSTALLATION.md

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 26, 2025

Walkthrough

This pull request introduces a complete Helm chart for the Capture hardware monitoring agent, including chart metadata, Kubernetes resource templates (Deployment, Service, ConfigMap, Secret), installation documentation, default configuration values, and Helm template helpers for standardized naming and labeling conventions.

Changes

Cohort / File(s) Summary
Chart Metadata & Configuration
charts/helm/capture/Chart.yaml, charts/helm/capture/.helmignore
Establishes Helm chart identity (v2, version 0.1.0, appVersion develop) and defines package exclusion patterns for build artifacts and version control files
Installation & Documentation
charts/helm/capture/INSTALLATION.md
Provides step-by-step Kubernetes deployment guide covering prerequisites, repository cloning, values customization (notably secret.apiSecret), and deployment verification procedures
Template Helpers
charts/helm/capture/templates/_helpers.tpl
Centralizes four named template definitions: capture.name (truncated chart name), capture.fullname (with optional override), capture.labels (standard Kubernetes labels), and capture.selectorLabels (label selectors)
Kubernetes Resource Templates
charts/helm/capture/templates/configmap.yaml, charts/helm/capture/templates/deployment.yaml, charts/helm/capture/templates/secret.yaml, charts/helm/capture/templates/service.yaml
Defines four core Kubernetes resources: ConfigMap exposing PORT and GIN_MODE configuration; Deployment with liveness/readiness probes, optional hostPath volume for /etc/os-release, and resource/affinity controls; Secret storing API_SECRET; Service exposing ClusterIP on port 59232
Default Values
charts/helm/capture/values.yaml
Supplies default deployment parameters: 1 replica, ghcr.io/bluewave-labs/capture image (latest tag), ClusterIP service type, port 59232, release-mode Gin, placeholder API secret, enabled hostPath mounting, and empty resource/affinity specifications

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 Helm charts bundled, templates aligned,
From secrets to services, all finely designed,
Capture hardware with ConfigMaps clear,
Deployments labeled, monitoring near!

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive No pull request description was provided by the author; the field is empty. Consider adding a brief description explaining the purpose of the Helm chart, deployment instructions, or any configuration details reviewers should be aware of.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and clearly summarizes the main change: adding a Helm Chart for deploying the Capture application.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
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: 3

🧹 Nitpick comments (5)
charts/helm/capture/Chart.yaml (1)

6-6: Consider using a semantic version for appVersion.

Using a branch name like "develop" for appVersion makes it difficult to track which version of the application is deployed. Consider using semantic versioning (e.g., "0.1.0") or commit SHA for better version tracking and rollback capabilities.

charts/helm/capture/values.yaml (1)

10-10: Inconsistent port type definition.

The service port is defined as a number (line 10: 59232) while the config port is defined as a string (line 13: "59232"). For consistency and clarity, both should use the same type. Since environment variables are typically strings, consider making service.port an integer and keeping config.port as a string, or reference the same value.

🔎 Suggested approach

Option 1 - Keep current types but add a comment:

service:
  type: ClusterIP
  port: 59232  # Integer for Service port

config:
  port: "59232"  # String for environment variable

Option 2 - Reference the same value:

service:
  type: ClusterIP
  port: 59232

config:
  port: "{{ .Values.service.port }}"  # Reference service port

Also applies to: 13-13

charts/helm/capture/INSTALLATION.md (1)

22-22: Enhance documentation for the required API secret.

The documentation mentions setting secret.apiSecret but doesn't emphasize that it's a required value or provide guidance on generating a secure secret.

🔎 Suggested enhancement
 ### 2. Customize values.yaml
 
-Edit `values.yaml` and set the required `secret.apiSecret`. Adjust image, service, and other settings as needed.
+Edit `values.yaml` and configure the following:
+
+**Required:**
+- `secret.apiSecret`: Generate a strong random secret (minimum 32 characters recommended)
+  ```shell
+  # Generate a secure random secret
+  openssl rand -base64 32
+  ```
+
+**Optional:**
+- Adjust `image.repository` and `image.tag` for specific versions
+- Configure `service.type` and `service.port` as needed
+- Set `resources`, `nodeSelector`, `tolerations`, or `affinity` for scheduling
charts/helm/capture/templates/deployment.yaml (1)

35-46: Consider adding explicit timeout and failure thresholds to health probes.

The health probes configuration is functional but could be more robust with explicit timeoutSeconds and failureThreshold values. This is especially important if the application might have variable response times under load.

🔎 Suggested enhancement
           livenessProbe:
             httpGet:
               path: /health
               port: http
             initialDelaySeconds: 5
             periodSeconds: 10
+            timeoutSeconds: 3
+            failureThreshold: 3
           readinessProbe:
             httpGet:
               path: /health
               port: http
             initialDelaySeconds: 5
             periodSeconds: 10
+            timeoutSeconds: 3
+            failureThreshold: 3

This provides clearer behavior:

  • timeoutSeconds: 3 allows up to 3 seconds for the health check to respond
  • failureThreshold: 3 requires 3 consecutive failures before marking unhealthy
charts/helm/capture/templates/_helpers.tpl (1)

14-20: Labels follow Kubernetes conventions correctly.

The standard label set is well-implemented. Consider sanitizing Chart.Version on line 19 to handle semantic version build metadata (e.g., 1.0.0+build), as the + character is invalid in Kubernetes label values.

🔎 Optional: Sanitize Chart.Version for label compatibility
-helm.sh/chart: {{ printf "%s-%s" .Chart.Name .Chart.Version | quote }}
+helm.sh/chart: {{ printf "%s-%s" .Chart.Name (.Chart.Version | replace "+" "_") | quote }}
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bb8b06b and ce6cb83.

📒 Files selected for processing (9)
  • charts/helm/capture/.helmignore
  • charts/helm/capture/Chart.yaml
  • charts/helm/capture/INSTALLATION.md
  • charts/helm/capture/templates/_helpers.tpl
  • charts/helm/capture/templates/configmap.yaml
  • charts/helm/capture/templates/deployment.yaml
  • charts/helm/capture/templates/secret.yaml
  • charts/helm/capture/templates/service.yaml
  • charts/helm/capture/values.yaml
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-02-01T14:10:43.142Z
Learnt from: mertssmnoglu
Repo: bluewave-labs/capture PR: 45
File: cmd/capture/main.go:34-38
Timestamp: 2025-02-01T14:10:43.142Z
Learning: In the Capture project, environment variable validation for PORT and API_SECRET is handled in internal/config/config.go's NewConfig function. PORT gets a default value if not set, and API_SECRET is required with a fatal error if missing.

Applied to files:

  • charts/helm/capture/templates/configmap.yaml
🪛 YAMLlint (1.37.1)
charts/helm/capture/templates/configmap.yaml

[error] 4-4: syntax error: expected , but found ''

(syntax)

charts/helm/capture/templates/service.yaml

[error] 7-7: syntax error: could not find expected ':'

(syntax)

charts/helm/capture/templates/deployment.yaml

[error] 7-7: syntax error: could not find expected ':'

(syntax)

charts/helm/capture/templates/secret.yaml

[error] 4-4: syntax error: expected , but found ''

(syntax)

🔇 Additional comments (2)
charts/helm/capture/templates/_helpers.tpl (2)

1-3: LGTM!

The capture.name helper follows the standard Helm pattern correctly, using nameOverride with proper 63-character truncation and hyphen trimming.


22-25: LGTM!

The capture.selectorLabels helper correctly defines a stable, minimal subset of labels suitable for immutable selectors in Services and Deployments.

@sharmajidotdev
Copy link
Author

@mertssmnoglu Could you please review this PR?

@sharmajidotdev
Copy link
Author

@gorkem-bwl

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.

1 participant