Skip to content

fix(storage): allow configuring storage Service exposure#816

Open
officialasishkumar wants to merge 1 commit intokubescape:mainfrom
officialasishkumar:fix/storage-service-config
Open

fix(storage): allow configuring storage Service exposure#816
officialasishkumar wants to merge 1 commit intokubescape:mainfrom
officialasishkumar:fix/storage-service-config

Conversation

@officialasishkumar
Copy link
Copy Markdown

@officialasishkumar officialasishkumar commented Apr 9, 2026

Overview

This updates the storage Service in the kubescape-operator chart so clusters that need the aggregated storage API reachable outside the cluster network can override the Service type and attach storage-specific Service annotations.

Additional Information

The storage Service was the remaining hardcoded ClusterIP in the path reported in #806. The chart already exposed similar service configuration for other components, so this change keeps storage aligned without introducing a second target-port source of truth.

How to Test

  1. Run helm unittest -u charts/kubescape-operator.
  2. Confirm the new storage service configuration test passes.
  3. Optionally render the chart with storage.service.type=LoadBalancer and a storage Service annotation override to verify the generated Service manifest.

Related issues/PRs:

Checklist before requesting a review

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • If it is a core feature, I have added thorough tests.
  • New and existing unit tests pass locally with my changes

Summary by CodeRabbit

Release Notes

  • New Features

    • Storage service configuration now supports customizable service type and annotations, enabling flexible deployment options across different environments.
  • Tests

    • Added snapshot test case for validating storage service configuration behavior.

Add storage service configuration to the kubescape-operator chart so clusters with an external API server can expose the aggregated storage API through a non-ClusterIP service.\n\nThe change adds storage-specific service annotations and an explicit service type, keeps the storage target port tied to the existing serverPort setting, and extends the Helm chart tests to cover the LoadBalancer override path while updating the rendered snapshot output.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 9, 2026

📝 Walkthrough

Walkthrough

The pull request adds configurable service type and annotations options to the kubescape-operator's storage component via Helm values, including explicit service type specification and a new snapshot test validating the storage service configuration.

Changes

Cohort / File(s) Summary
Storage Service Configuration
charts/kubescape-operator/templates/storage/service.yaml, charts/kubescape-operator/values.yaml
Added support for configurable Service type (defaults to ClusterIP) and optional annotations in the storage Service template. New values block storage.service introduced with type and annotations fields.
Service Configuration Tests
charts/kubescape-operator/tests/snapshot_test.yaml
Added new snapshot test case validating storage service configuration, including assertions for spec.type and custom annotations (e.g., io.cilium/lb-ipam-ips). Fixed trailing newline in existing priority class test.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A storage service, now dressed up with care,
With annotations and types to spare,
LoadBalancer or Cluster, you choose the way,
The snapshot tests verify it today! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Linked Issues check ❓ Inconclusive The PR partially addresses issue #806 by enabling Service type and annotation configuration, but does not fully resolve the reported CRD installation and node-agent readiness issues. Clarify whether this PR fully resolves issue #806 or if additional work is needed to address CRD installation and storage API accessibility.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: allowing configuration of storage Service exposure through customizable type and annotations.
Out of Scope Changes check ✅ Passed All changes are directly related to the PR objective of configuring storage Service exposure with type and annotations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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
Copy Markdown

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

🧹 Nitpick comments (1)
charts/kubescape-operator/values.yaml (1)

494-496: Add schema validation for the new storage.service keys.

Schema validation is missing: values.schema.json does not exist in the chart. Add explicit definitions for storage.service.type (with enum values like ClusterIP, LoadBalancer) and storage.service.annotations (as a string map) to enable early validation of invalid input.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@charts/kubescape-operator/values.yaml` around lines 494 - 496, Add a JSON
schema file (values.schema.json) for the chart that defines the new
storage.service keys so Helm can validate inputs: add a top-level property
"storage" with a "service" object that includes "type" (string with an enum of
allowed values such as "ClusterIP", "LoadBalancer", "NodePort", "ExternalName")
and "annotations" (an object/string-map where additionalProperties are strings);
ensure the schema sets the correct types and validation rules for
storage.service.type and storage.service.annotations and include them under
properties to enable validation of values.yaml.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@charts/kubescape-operator/values.yaml`:
- Around line 494-496: Add a JSON schema file (values.schema.json) for the chart
that defines the new storage.service keys so Helm can validate inputs: add a
top-level property "storage" with a "service" object that includes "type"
(string with an enum of allowed values such as "ClusterIP", "LoadBalancer",
"NodePort", "ExternalName") and "annotations" (an object/string-map where
additionalProperties are strings); ensure the schema sets the correct types and
validation rules for storage.service.type and storage.service.annotations and
include them under properties to enable validation of values.yaml.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3a1915ff-d172-4d9b-9442-54e900107ce7

📥 Commits

Reviewing files that changed from the base of the PR and between 6cf5910 and 37bbbb2.

⛔ Files ignored due to path filters (1)
  • charts/kubescape-operator/tests/__snapshot__/snapshot_test.yaml.snap is excluded by !**/*.snap
📒 Files selected for processing (3)
  • charts/kubescape-operator/templates/storage/service.yaml
  • charts/kubescape-operator/tests/snapshot_test.yaml
  • charts/kubescape-operator/values.yaml

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.

Kubescape-operator helm install fails, no crd's installed and not working storage.

1 participant