fix(storage): allow configuring storage Service exposure#816
fix(storage): allow configuring storage Service exposure#816officialasishkumar wants to merge 1 commit intokubescape:mainfrom
Conversation
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.
📝 WalkthroughWalkthroughThe 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
charts/kubescape-operator/values.yaml (1)
494-496: Add schema validation for the newstorage.servicekeys.Schema validation is missing:
values.schema.jsondoes not exist in the chart. Add explicit definitions forstorage.service.type(with enum values likeClusterIP,LoadBalancer) andstorage.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
⛔ Files ignored due to path filters (1)
charts/kubescape-operator/tests/__snapshot__/snapshot_test.yaml.snapis excluded by!**/*.snap
📒 Files selected for processing (3)
charts/kubescape-operator/templates/storage/service.yamlcharts/kubescape-operator/tests/snapshot_test.yamlcharts/kubescape-operator/values.yaml
Overview
This updates the storage Service in the
kubescape-operatorchart 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
ClusterIPin 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
helm unittest -u charts/kubescape-operator.storage service configurationtest passes.storage.service.type=LoadBalancerand a storage Service annotation override to verify the generated Service manifest.Related issues/PRs:
Checklist before requesting a review
Summary by CodeRabbit
Release Notes
New Features
Tests