Skip to content

refactor(agent): Make sensor DaemonSet updateStrategy configurable - #9

Open
infra-shinobi wants to merge 2 commits into
groundcover-com:mainfrom
infra-shinobi:feat/sensor-updatestrategy-config
Open

refactor(agent): Make sensor DaemonSet updateStrategy configurable#9
infra-shinobi wants to merge 2 commits into
groundcover-com:mainfrom
infra-shinobi:feat/sensor-updatestrategy-config

Conversation

@infra-shinobi

@infra-shinobi infra-shinobi commented May 26, 2026

Copy link
Copy Markdown

Adds support for configuring the sensor DaemonSet updateStrategy via values.yaml

Summary by CodeRabbit

  • New Features

    • Agent DaemonSet update strategy is now configurable through Helm values, allowing customization of rollout behavior.
  • Changes

    • Default agent update strategy set to RollingUpdate with maxUnavailable configured to 100% (can be adjusted via Helm values).

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown

Walkthrough

The Helm chart makes the agent DaemonSet updateStrategy configurable via .Values.agent.updateStrategy, conditionally rendering rollingUpdate.maxUnavailable when type is RollingUpdate.

Changes

Agent rollout strategy

Layer / File(s) Summary
DaemonSet updateStrategy parameterization
charts/groundcover/templates/agent/daemonset.yaml, charts/groundcover/values.yaml
Agent DaemonSet rollout strategy changed from a hardcoded RollingUpdate with maxUnavailable: 100% to configurable .Values.agent.updateStrategy.type, with conditional rollingUpdate.maxUnavailable when type == "RollingUpdate".

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 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 describes the main change: making the sensor DaemonSet updateStrategy configurable via values instead of hardcoded.
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

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 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/groundcover/templates/agent/daemonset.yaml`:
- Around line 25-29: The template directly dereferences
.Values.agent.updateStrategy.type and
.Values.agent.updateStrategy.rollingUpdate.maxUnavailable which can render <no
value> when users reuse-values; protect these lookups by assigning a safe local
(e.g. $updateStrategy := .Values.agent.updateStrategy | default dict) and use
default on the type lookup (e.g. $updateStrategy.type | default "") before
comparing to "RollingUpdate", and only render the rollingUpdate block when
$updateStrategy and $updateStrategy.rollingUpdate are present; update references
to use the guarded local ($updateStrategy) and default for maxUnavailable to
avoid empty values breaking spec.updateStrategy.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f4083e44-b9c8-49dc-b725-a3c9d6a0da94

📥 Commits

Reviewing files that changed from the base of the PR and between e6010cd and fd1409a.

📒 Files selected for processing (2)
  • charts/groundcover/templates/agent/daemonset.yaml
  • charts/groundcover/values.yaml

Comment on lines +25 to +29
type: {{ .Values.agent.updateStrategy.type }}
{{- if eq .Values.agent.updateStrategy.type "RollingUpdate" }}
rollingUpdate:
maxUnavailable: 100%
maxUnavailable: {{ .Values.agent.updateStrategy.rollingUpdate.maxUnavailable }}
{{- end }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Guard agent.updateStrategy lookups for helm upgrade --reuse-values compatibility

In charts/groundcover/templates/agent/daemonset.yaml (lines 25-29), the template directly dereferences .Values.agent.updateStrategy.type and .Values.agent.updateStrategy.rollingUpdate.maxUnavailable. If a previous release’s reused user values don’t include agent.updateStrategy, the render can produce <no value>/empty and break spec.updateStrategy before new defaults apply.

Suggested fix
+{{- $updateStrategy := .Values.agent.updateStrategy | default (dict) -}}
+{{- $updateStrategyType := dig "type" "RollingUpdate" $updateStrategy -}}
 spec:
   updateStrategy:
-    type: {{ .Values.agent.updateStrategy.type }}
-    {{- if eq .Values.agent.updateStrategy.type "RollingUpdate" }}
+    type: {{ $updateStrategyType }}
+    {{- if eq $updateStrategyType "RollingUpdate" }}
     rollingUpdate:
-      maxUnavailable: {{ .Values.agent.updateStrategy.rollingUpdate.maxUnavailable }}
+      maxUnavailable: {{ dig "rollingUpdate" "maxUnavailable" "100%" $updateStrategy }}
     {{- end }}
🤖 Prompt for 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.

In `@charts/groundcover/templates/agent/daemonset.yaml` around lines 25 - 29, The
template directly dereferences .Values.agent.updateStrategy.type and
.Values.agent.updateStrategy.rollingUpdate.maxUnavailable which can render <no
value> when users reuse-values; protect these lookups by assigning a safe local
(e.g. $updateStrategy := .Values.agent.updateStrategy | default dict) and use
default on the type lookup (e.g. $updateStrategy.type | default "") before
comparing to "RollingUpdate", and only render the rollingUpdate block when
$updateStrategy and $updateStrategy.rollingUpdate are present; update references
to use the guarded local ($updateStrategy) and default for maxUnavailable to
avoid empty values breaking spec.updateStrategy.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
charts/groundcover/values.yaml (1)

415-418: ⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Risky default: 100% maxUnavailable causes complete monitoring blackout during updates.

Setting maxUnavailable: 100% allows all agent pods to go down simultaneously during rollouts. This creates:

  • Complete telemetry gap (metrics, logs, traces)
  • Potential data loss during update window
  • No gradual rollout validation

Why this matters: Observability agents should maintain coverage during updates to avoid blind spots in production monitoring.

Recommendation: Use conservative defaults like maxUnavailable: 1 or 10% for controlled rollout. Reserve aggressive values for opt-in scenarios where users understand the tradeoff.

🛡️ Safer default configuration
  updateStrategy:
    type: RollingUpdate
    rollingUpdate:
-     maxUnavailable: 100%
+     maxUnavailable: 1

Alternative if percentage is required:

  updateStrategy:
    type: RollingUpdate
    rollingUpdate:
-     maxUnavailable: 100%
+     maxUnavailable: 10%
🤖 Prompt for 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.

In `@charts/groundcover/values.yaml` around lines 415 - 418, The values.yaml
currently sets updateStrategy.rollingUpdate.maxUnavailable to "100%", which
allows all agent pods to be killed at once; change the default to a conservative
value (e.g. set updateStrategy.type = RollingUpdate and
updateStrategy.rollingUpdate.maxUnavailable to "1" or "10%") to ensure partial
availability during rollouts, and document the tradeoff near the maxUnavailable
field so operators can opt into aggressive values if desired.
🤖 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.

Outside diff comments:
In `@charts/groundcover/values.yaml`:
- Around line 415-418: The values.yaml currently sets
updateStrategy.rollingUpdate.maxUnavailable to "100%", which allows all agent
pods to be killed at once; change the default to a conservative value (e.g. set
updateStrategy.type = RollingUpdate and
updateStrategy.rollingUpdate.maxUnavailable to "1" or "10%") to ensure partial
availability during rollouts, and document the tradeoff near the maxUnavailable
field so operators can opt into aggressive values if desired.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3720b3c8-65d3-402c-bd77-440e9f6a8f02

📥 Commits

Reviewing files that changed from the base of the PR and between fd1409a and 35177b6.

📒 Files selected for processing (1)
  • charts/groundcover/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.

2 participants