Argo CD not detecting or applying changes in structured spec.config.processors field for OpenTelemetry Collector CR #26891
Replies: 5 comments 3 replies
|
Great question — this is a known pain point with CRDs that have loosely-typed or deeply nested fields like Root CauseThe most likely cause is that the OpenTelemetry Operator’s admission webhook is normalizing The clue is your observation:
This means Argo CD’s diff engine is comparing the rendered manifest against a normalized/mutated live state and finding them equal, even though the actual cluster object is stale. How to ConfirmRun: argocd app diff <app-name> --local <path-to-manifests>Also check if the OTel Operator has a mutating webhook: kubectl get mutatingwebhookconfigurations | grep opentelemetryRecommended FixUse # argocd-cm ConfigMap
resource.customizations: |
opentelemetry.io/OpenTelemetryCollector:
ignoreDifferences: |
jsonPointers:
- /spec/config/processorsOr, if you want Argo CD to correctly detect real changes, configure resource.compareoptions: |
ignoreManagedFieldsManagers:
- opentelemetry-operatorThis tells Argo CD to ignore fields last-written by the operator’s webhook, so only your Git-sourced changes are considered. Answers to Your Questions
Hope this helps unblock you! |
|
Check It is important to see which fields are owned by Operator and which one by argocd, in case where server-side apply is enabled. check that by below commands or |
|
Thank you @cp319391 for the responding to the discussion, I have verified if managedFields is owned by operator but we got |
|
Hi, I took a quick look at the CRD in the chart, and I believe you're running into this issue. CRDs sometimes come in two flavors: a lightweight version that accepts anything but doesn't play well with Argo CD's server-side diff feature, and a full version where all fields are properly defined. In the OpenTelemetry case, it looks like they're using a mix of both. As you can see, the Unless you can get hold of a full CRD definition, I'm afraid the only workaround is to disable the server-side diff feature. |
|
@llavaud : Thank you for the update. Based on the details shared in your issue, it does make sense that fields configured with x-kubernetes-preserve-unknown-fields: true are being ignored by Argo CD when nested changes are introduced. I was able to confirm the same behavior through a discussion I created in the OpenTelemetry community as well: - open-telemetry/opentelemetry-collector#15230, but one observation I made when dealing with opentelemetry CRD is that - When changes are made at the spec.config level, Argo CD is able to detect the differences and successfully sync the resource. While reviewing the CRD, I also observed that the spec.config field is configured with x-kubernetes-preserve-unknown-fields: true, it is conflicting with the statement that fields having x-kubernetes-preserve-unknown-fields: true will be ignored. |
Uh oh!
There was an error while loading. Please reload this page.
I’m observing that Argo CD is not detecting or applying changes made to nested fields inside the spec.config section of an OpenTelemetry Collector custom resource, even though the configuration is defined as structured YAML (not a multiline string).
kubectl get opentelemetrycollector servicemonitor -o yamlWhat I expected
Argo CD should detect a difference in the nested field (spec.config.processors.memory_limiter.limit_percentage) and mark the application as OutOfSync, triggering a sync to apply the updated configuration.What actually happens
Argo CD does not detect any difference and does not attempt to apply the updated configuration, even though the rendered manifests clearly contain the new value.Additional details
No ignoreDifferences or resource.customizations are configured.Workarounds observed
All reactions