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

Since v1.7.0-rc1 volumeClaimTemplates are out of sync #4126

Closed
niiku opened this issue Aug 19, 2020 · 7 comments · Fixed by argoproj/gitops-engine#127
Closed

Since v1.7.0-rc1 volumeClaimTemplates are out of sync #4126

niiku opened this issue Aug 19, 2020 · 7 comments · Fixed by argoproj/gitops-engine#127
Assignees
Labels
bug Something isn't working component:core Syncing, diffing, cluster state cache
Milestone

Comments

@niiku
Copy link
Contributor

niiku commented Aug 19, 2020

Describe the bug

Since v1.7.0-rc1 volumeClaimTemplates in StatefulSets are out-of-sync.

To Reproduce

Deploy a StatefulSet using volumeClaimTemplates:

  volumeClaimTemplates:
    - metadata:
        name: data
      spec:
        accessModes:
          - ReadWriteOnce
        resources:
          requests:
            storage: 8Gi

The k8s adds

    - apiVersion: v1
      kind: PersistentVolumeClaim

which is detected as diff.

Expected behavior
Argo CD ignores apiVersion and kind in volumeClaimTemplates

Screenshots

image

Version
ArgoCD Version: v1.7.0-rc1
Kubernetes Version: v1.18.3
OKD Version: 4.5.0-0.okd-2020-07-14-153706-ga

v1.7.0-rc1+4728412

Logs

time="2020-08-19T21:48:28Z" level=info msg="Refreshing app status (hard refresh requested), level (2)" application=harbor
time="2020-08-19T21:48:28Z" level=info msg="Ignore status for CustomResourceDefinitions"
time="2020-08-19T21:48:28Z" level=info msg="Comparing app state (cluster: https://kubernetes.default.svc, namespace: harbor)" application=harbor

(no other relevant log)

Edit:

It seems like other fields are affected with new diffing issues as well, like when creationTimestamp: null is in Git (seen at a ServiceAccount - ignored in v1.6.2), or when app.conf: \|+ (diff says app.conf: |) is used in a e.g. a ConfigMap

@niiku
Copy link
Contributor Author

niiku commented Aug 25, 2020

@alexmt There are other diff issues with v1.7.0 which were not present in v1.6.2:
image
image

@alexmt
Copy link
Collaborator

alexmt commented Aug 25, 2020

Thank you, @niiku !

Can you please provide more details about resources that have issues? The first one looks like ConfigMap, right?
What are the group/kind of the second resource?

@niiku
Copy link
Contributor Author

niiku commented Aug 25, 2020

Sorry for the bad screenshots, @alexmt:
here's the yaml:

apiVersion: v1
kind: ServiceAccount
metadata:
  name: iptables-config
  creationTimestamp: null
apiVersion: v1
kind: ConfigMap
metadata:
  name: harbor-core
  labels:
    app.kubernetes.io/name: harbor
    helm.sh/chart: harbor-6.0.8

    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/component: core
data:
  app.conf: |+
    appname = Harbor
    runmode = dev
    enablegzip = true

    [dev]
    httpport = 8080

And if you want to have a look yourself:
https://argocd.baloise.dev/applications/iptables-config?node=%2FServiceAccount%2Fiptables-config%2Fiptables-config%2F0
https://argocd.baloise.dev/applications/harbor?node=%2FConfigMap%2Fharbor%2Fharbor-core%2F0

@alexmt
Copy link
Collaborator

alexmt commented Aug 25, 2020

Thanks for sharing YAMLs and link. That is super useful!

I've found an explanation for the first diff. The current behavior is technically correct: creationTimestamp field is set to null in Git so it is correctly reported as different.

However, this is a breaking change - before 1.7 Argo CD used to exclude creationTimestamp field from diffing. We dropped in because it is no longer needed with new diffing implementation. I think for backward compatibility, we should keep ignoring creationTimestamp. Will work on it.

Could not reproduce ConfigMap issue. Trying on K8S v1.18.3

@alexmt
Copy link
Collaborator

alexmt commented Aug 25, 2020

Reproduced the ConfigMap issue. Looks like it is related to kubectl version upgrade or to this PR argoproj/gitops-engine#62. Argo v1.6.0 does drop - from |- but Argo v1.7.0 drops.

image

So the workaround is to sync ConfigMap using Argo CD v1.7.0 once. The new behavior is compatible with kubectl, so probably we need to document is as a behavior change in v1.7 upgrade notes.

@alexmt
Copy link
Collaborator

alexmt commented Aug 25, 2020

Ticket and fix for creationTimestamp issue:
#4157
argoproj/gitops-engine#128

@niiku
Copy link
Contributor Author

niiku commented Aug 25, 2020

Thanks for reacting that quickly! I can confirm that the ConfigMap issue disappears after a sync is triggered.
creationTimestamp: null is given when resources are created using kubectl create so it's probably common to have these in Git as well.

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:core Syncing, diffing, cluster state cache
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants