fix(JDWLABS-463): replace truenas-csi controller Deployment so Recreate strategy can sync - #391
Merged
Merged
Conversation
The chart renders only `strategy.type: Recreate`, but the live Deployment was created before the chart declared any strategy, so the API server's defaulted rollingUpdate block has no field manager. Server-side apply leaves unowned fields alone, the merged object carries both, and every sync is rejected with "rollingUpdate: Forbidden ... when strategy type is Recreate". Syncing the Deployment with Replace=true submits the whole spec, so the stale default is dropped. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B6FWEmAs2beQvKnX4LwWN2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
platform-truenas-csiis stuckOutOfSync:The chart template is already correct —
helm templatewith the tenant values renders onlystrategy: {type: Recreate}. The root cause is on the cluster side: the Deployment was first created before the chart declared a strategy, so the API server defaultedstrategy.rollingUpdatewith no field manager (managedFieldsforargocd-controllerhas nof:strategyentry). The Application syncs withServerSideApply=true, and SSA only removes fields the applier previously owned, so the unownedrollingUpdateblock survives the merge alongside the newtype: Recreateand the API server rejects the result.Fix
Annotate the controller Deployment with
argocd.argoproj.io/sync-options: Replace=trueinhelm-charts/truenas-csi/templates/controller.yaml. A replace submits the whole spec, so no stale server default survives.Recreateis kept as-is: the controller runs a single replica with leader election off, and Recreate is what prevents an old and a new pod from provisioning concurrently during a rollout.Evidence
Before (read-only):
Reproduced and verified with server-side dry runs against the rendered Deployment (nothing persisted):
Chart validation:
helm lintpasses;helm template+kubeconformon the rendered output: 10 resources, 10 valid.After merge, confirm with
kubectl -n argocd get app platform-truenas-csi -o jsonpath='{.status.sync.status}'→Synced, and that the live Deployment strategy is{"type":"Recreate"}.🤖 Generated with Claude Code
https://claude.ai/code/session_01B6FWEmAs2beQvKnX4LwWN2