Skip to content

feat: remove service discovery components#835

Open
matthyx wants to merge 2 commits intomainfrom
remove-sidecars
Open

feat: remove service discovery components#835
matthyx wants to merge 2 commits intomainfrom
remove-sidecars

Conversation

@matthyx
Copy link
Copy Markdown
Contributor

@matthyx matthyx commented May 8, 2026

Summary by CodeRabbit

  • New Features

    • Components now accept an API_URL setting instead of relying on the prior service-discovery init/mount workflow.
    • Rollout-level settings added: per-rollout pod annotations/labels, image/resource overrides, and preferred scheduling.
  • Updates

    • Updated component images: kubescape v4.0.8, kubevuln v0.3.138, node-agent v0.3.112, synchronizer v0.0.144.
    • Scheduling preference: rollout nodeSelector → global nodeSelector → custom scheduling.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 8, 2026

Review Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8bc72fc6-0ef1-41c0-835d-eccea6b7b19f

📥 Commits

Reviewing files that changed from the base of the PR and between 23ea1b8 and e57b0f9.

⛔ Files ignored due to path filters (1)
  • charts/kubescape-operator/tests/__snapshot__/snapshot_test.yaml.snap is excluded by !**/*.snap
📒 Files selected for processing (1)
  • charts/kubescape-operator/values.yaml
 ______________________________________________________________________________________________________________________________________________________________________
< Fix the problem, not the blame. It doesn't really matter whether the bug is your fault or someone else's - it is still your problem, and it still needs to be fixed. >
 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
📝 Walkthrough

Walkthrough

This PR migrates the Kubescape Helm chart away from a service discovery initialization pattern to direct API URL configuration. The serviceDiscovery configuration block is removed and replaced with a new rollout configuration. All component deployments remove their conditional initContainers, volume mounts, and volumes related to service discovery, then inject API_URL directly into container environments. Component image tags are bumped and the grype offline database CronJob adopts the new rollout-scoped scheduling and metadata wiring.

Changes

Service Discovery Migration & API Configuration

Layer / File(s) Summary
Configuration Schema
charts/kubescape-operator/values.yaml
Adds new rollout configuration block with quay.io/kubescape/kubectl:1.30.3, node selectors, pod metadata placeholders, and resources; removes serviceDiscovery block; bumps image tags for kubescape, kubevuln, node-agent, and synchronizer.
Grype Offline DB Rollout
charts/kubescape-operator/templates/grype-offline-db/cronjob.yaml
CronJob now uses grypeOfflineDB.rollout.image and grypeOfflineDB.rollout.resources, renders rollout.podAnnotations/rollout.podLabels alongside shared metadata, and prefers grypeOfflineDB.rollout.nodeSelector with fallbacks.
Service Discovery Removal
charts/kubescape-operator/templates/kubescape/deployment.yaml, charts/kubescape-operator/templates/kubevuln/deployment.yaml, charts/kubescape-operator/templates/synchronizer/deployment.yaml, charts/kubescape-operator/templates/node-agent/_node-agent.tpl
Removes conditional serviceDiscovery.enabled initContainers that downloaded services.json, removes mounts of /etc/config/services.json, and removes the services emptyDir volumes across components.
API URL Environment Wiring
charts/kubescape-operator/templates/kubescape/deployment.yaml, charts/kubescape-operator/templates/kubevuln/deployment.yaml, charts/kubescape-operator/templates/synchronizer/deployment.yaml, charts/kubescape-operator/templates/node-agent/_node-agent.tpl
Adds API_URL env var set to https://{{ .Values.server }} to the kubescape, kubevuln, synchronizer, and node-agent containers when .Values.server is present.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • kubescape/helm-charts#830: Modifies the kubescape-operator Helm chart's packaging/values and image tag updates, related to values.yaml and image changes.

Suggested reviewers

  • armobot

Poem

🐰 I hop through values, charts in tow,
ServiceDiscovery leaves the show,
API_URL lights the trail,
Rollout props set without fail,
Templates hop cleaner — off I go!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: removal of service discovery components across multiple Helm templates and values configuration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch remove-sidecars

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@charts/kubescape-operator/templates/grype-offline-db/cronjob.yaml`:
- Around line 26-31: The pod metadata currently renders both
grypeOfflineDB.podAnnotations/podLabels and
grypeOfflineDB.rollout.podAnnotations/podLabels into the same pod template
causing silent overrides; pick one authoritative source (likely rollout.* for
this Job) and remove the duplicate rendering lines so only
grypeOfflineDB.rollout.podAnnotations and grypeOfflineDB.rollout.podLabels are
rendered into the pod metadata block (update the template that includes those
keys and remove the non-rollout toYaml calls).

In `@charts/kubescape-operator/templates/synchronizer/deployment.yaml`:
- Around line 86-87: The templates unconditionally set the API_URL environment
variable using "https://{{ .Values.server }}" which renders as "https://" when
.Values.server is empty; update the templates (synchronizer deployment,
kubevuln/deployment.yaml, kubescape/deployment.yaml, and
node-agent/_node-agent.tpl) to either (a) use the required Helm helper to fail
fast (e.g. require .Values.server with a clear message) when .Values.server is
mandatory, or (b) guard the API_URL env var rendering with a conditional that
only sets API_URL when .Values.server is non-empty (if empty is a valid config),
referencing the API_URL env var and .Values.server symbols and preserving the
previous serviceDiscovery gating behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 90c28b7c-d864-458b-86c5-1bff01773cb8

📥 Commits

Reviewing files that changed from the base of the PR and between 92012e9 and e9c937d.

⛔ Files ignored due to path filters (1)
  • charts/kubescape-operator/tests/__snapshot__/snapshot_test.yaml.snap is excluded by !**/*.snap
📒 Files selected for processing (6)
  • charts/kubescape-operator/templates/grype-offline-db/cronjob.yaml
  • charts/kubescape-operator/templates/kubescape/deployment.yaml
  • charts/kubescape-operator/templates/kubevuln/deployment.yaml
  • charts/kubescape-operator/templates/node-agent/_node-agent.tpl
  • charts/kubescape-operator/templates/synchronizer/deployment.yaml
  • charts/kubescape-operator/values.yaml

Comment thread charts/kubescape-operator/templates/grype-offline-db/cronjob.yaml Outdated
Comment thread charts/kubescape-operator/templates/synchronizer/deployment.yaml
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
@matthyx matthyx force-pushed the remove-sidecars branch from 23ea1b8 to e57b0f9 Compare May 8, 2026 19:10
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 8, 2026

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
{}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant