Open cwstrommer opened 3 weeks ago
Note: I just ran into the same issue with a deployment. Same conditions: changed from server-side diff/apply to client-side, container name changes. The only difference is that this time both containers were up to spec, and the only reason we caught it is that the pods were unschedulable because each container was requesting more than half a node's available resources.
Checklist:
argocd version
.Describe the bug
Using client-side apply/diff on a StatefulSet whose single container changes name from one revision to the next, ArgoCD seems to patch the StatefulSet to contain two containers: the one with the old spec, and the one with the new spec. This causes CrashLoops on the StatefulSet's pods, as the pod specs are either broken or conflicting.
Notably, I can only reproduce this when the application was previously using both ServerSideApply and ServerSideDiff during an earlier revision.
To Reproduce
Tested with the VictoriaMetrics Agent chart https://github.com/VictoriaMetrics/helm-charts/tree/master/charts/victoria-metrics-agent.
Application spec:
Chart.yaml
values.yaml
Deploy the ArgoCD application, then upgrade the dependency in
Chart.yaml
to version0.12.2
. This will put the application into an unknown sync state, with:Note: the above error appears only when both ServerSideApply and ServerSideDiff are enabled. If the application is created with ServerSideApply=false and ServerSideDiff=true, then there is no
ComparisonError
.Disable both ServerSideDiff and ServerSideApply, and when the new version of the StatefulSet is created after a new sync, the new pods have two containers instead of one:
Inspecting the StatefulSet shows two containers specified in the pod template, one with name
vmagent
(new name, expected), and one with namevictoria-metrics-agent
(old name, should no longer exist).It is also possible to reproduce this by first disabling ServerSideApply and ServerSideDiff, and then changing the dependency version.
Expected behavior
ArgoCD removes parts of the spec that don't exist.
Version