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

Deploying crossplane helm chart with GitOps shows out of sync #4509

Closed
csantanapr opened this issue Aug 21, 2023 · 3 comments · Fixed by #4538
Closed

Deploying crossplane helm chart with GitOps shows out of sync #4509

csantanapr opened this issue Aug 21, 2023 · 3 comments · Fixed by #4538
Labels
bug Something isn't working

Comments

@csantanapr
Copy link
Contributor

What happened?

When deploying crossplane helm chart with argocd it always shows out of sync for 2 Deployment (crossplane, crossplane-rbac-manager)

image

The out of sync is on env.valueFrom.resourceFieldRef.divisor
In the helm chart the divisor is not set, and kubernetes mutates the Deployment to "0" which is the same as 1 or "1"

I proposed we set the divisor in the helm char to 1

- env:
  - name: GOMAXPROCS
    valueFrom:
      resourceFieldRef:
        containerName: nginx
        divisor: "0"
        resource: limits.cpu
- name: GOMEMLIMIT
  valueFrom:
    resourceFieldRef:
      containerName: nginx
      divisor: "0"
      resource: limits.memory

How can we reproduce it?

To reproduce deploy ArgoCD Application using crossplane chart

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: addon-ex-crossplane-crossplane
  namespace: argocd
spec:
  destination:
    name: ex-crossplane
    namespace: crossplane-system
  project: default
  sources:
  - chart: crossplane
    helm:
      releaseName: crossplane
    repoURL: https://charts.crossplane.io/stable
    targetRevision: 1.13.2
  syncPolicy:
    automated: {}
    syncOptions:
    - CreateNamespace=true
    - ServerSideApply=true

What environment did it happen in?

Crossplane version: 1.13.2

References

@csantanapr csantanapr added the bug Something isn't working label Aug 21, 2023
@phisco
Copy link
Contributor

phisco commented Aug 21, 2023

Sounds more like an issue with ArgoCD rather than with Crossplane, we are just relying on the default value. However if explicitly setting it is enough to fix the issue, we can definitely do that. Feel free to open a PR, @csantana 🙏

@felixlut
Copy link

In my org we added the following lines to our ArgoCD application to have it be ignored, as per their docs:

  ignoreDifferences:
  - group: apps
    kind: Deployment
    jqPathExpressions: 
      - .spec.template.spec.containers[].env[].valueFrom.resourceFieldRef.divisor
      - .spec.template.spec.initContainers[].env[].valueFrom.resourceFieldRef.divisor

@jmalloc
Copy link

jmalloc commented Dec 19, 2023

Has this issue regressed for anyone else under v1.14? I can see in the GitHub templates that the divisor is set to 1, but I am seeing the same diff in Argo CD as the original post.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants