Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resources showing OutOfSync for volumeClaimTemplates #16707

Open
tman5 opened this issue Dec 26, 2023 · 13 comments
Open

Resources showing OutOfSync for volumeClaimTemplates #16707

tman5 opened this issue Dec 26, 2023 · 13 comments
Labels
bug Something isn't working component:sync version:2.13 Latest confirmed affected version is 2.13

Comments

@tman5
Copy link

tman5 commented Dec 26, 2023

Describe the bug

Resource always show OutOfSync due to volumeClaimTemplates. Seems to happen with statefulsets

To Reproduce

Appears to happen with numerous 3rd party helm charts including https://github.com/Altinity/clickhouse-operator

Expected behavior

The resource should be updated without issue

Screenshots

image

Version

v2.7.3+e7891b8.dirty

@tman5 tman5 added the bug Something isn't working label Dec 26, 2023
@todaywasawesome
Copy link
Contributor

Flagged for discussion in contributor's experience meeting.

@andrii-korotkov-verkada
Copy link
Contributor

ArgoCD versions 2.10 and below have reached EOL. Can you upgrade and let us know if the issue is still present, please?

@andrii-korotkov-verkada andrii-korotkov-verkada added the version:EOL Latest confirmed affected version has reached EOL label Nov 11, 2024
@wfrced
Copy link

wfrced commented Nov 18, 2024

Ran into this on v2.12.1 - currently updating to v2.13.0, will let you know if it fixes the issue.

@andrii-korotkov-verkada andrii-korotkov-verkada added version:2.12 Latest confirmed affected version is 2.12 and removed version:EOL Latest confirmed affected version has reached EOL labels Nov 18, 2024
@wfrced
Copy link

wfrced commented Nov 18, 2024

v2.13.0 is also affected.

@andrii-korotkov-verkada andrii-korotkov-verkada added version:2.13 Latest confirmed affected version is 2.13 and removed version:2.12 Latest confirmed affected version is 2.12 labels Nov 18, 2024
@andrii-korotkov-verkada
Copy link
Contributor

Can you try playing with known types configuration and see if it can solve this? https://argo-cd.readthedocs.io/en/stable/user-guide/diffing/#known-kubernetes-types-in-crds-resource-limits-volume-mounts-etc

@wfrced
Copy link

wfrced commented Nov 18, 2024

Apologies @andrii-korotkov-verkada, can't quite understand what I need to do :)
The problems manifests itself in StatefulSets, not CRDs. Or should I follow the same procedure and replace sts's spec/template/spec/volumeClaimTemplates with core/v1/PersistentVolumeClaimTemplate
?

@andrii-korotkov-verkada
Copy link
Contributor

You may need to specify the known type for PersistenVolumeClaim, so it's normalized properly.

@christiaan-bronkhorst
Copy link

christiaan-bronkhorst commented Nov 21, 2024

I have tried the following:

  resource.customizations.knownTypeFields:
      apps/StatefulSet:
        - field: spec.volumeClaimTemplates
          type: core/v1/PersistentVolumeClaim

and

  resource.customizations.knownTypeFields:apps_StatefulSet: |
        - field: spec.volumeClaimTemplates
          type: core/v1/PersistentVolumeClaim

Maybe I'm missing something, because this did not solve the problem

@andrii-korotkov-verkada
Copy link
Contributor

andrii-korotkov-verkada commented Nov 21, 2024

It has to be this I think (note not using : as in your 2nd try)

resource.customizations.knownTypeFields.argoproj.apps_StatefulSet: |
  - field: spec.volumeClaimTemplates
    type: core/v1/PersistentVolumeClaimList

@christiaan-bronkhorst
Copy link

christiaan-bronkhorst commented Nov 21, 2024

Thanks for that, although That was just a typo (copy-paste mistake) in this thread.

I have now tried multiple combinations of the different known types and non of them solved that issue... in the end I just ended up using the serversidediff compare option on each application with a statefulset

annotations:
  argocd.argoproj.io/compare-options: ServerSideDiff=true

@andrii-korotkov-verkada
Copy link
Contributor

You can enable server-side diff globally too by adding controller.diff.server.side: "true" to your argocd-cmd-params-cm

@christiaan-bronkhorst
Copy link

Thanks that is a better approach

@wfrced
Copy link

wfrced commented Nov 21, 2024

Thanks for the suggestion @andrii-korotkov-verkada, but it doesn't seem like it works - I've been trying to make it work in different configurations too for the past two days to no avail. This is easily reproducible on a local kind cluster with a prometheus statefulset deployment.
@christiaan-bronkhorst turns out this is actually a known problem #11143. So there is no fix really, server-side diffing is supposed to solve it according to #11143 (comment). Unfortunately, server-side diffing is its own can of worms.
If you wish to resolve this issue without resorting to SSD, you can use ignoreDifferences for the affected fields, like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component:sync version:2.13 Latest confirmed affected version is 2.13
Projects
None yet
Development

No branches or pull requests

6 participants