argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
17.86k stars 5.45k forks source link

Big manifest files cannot be synched as expected by the ARGOCD_GRPC_MAX_SIZE_MB environment variable #16529

Open athanassis opened 11 months ago

athanassis commented 11 months ago

Checklist:

Describe the bug

I have set the environmental variable ARGOCD_GRPC_MAX_SIZE_MB (described here) to 300M but I cannot synch larger files than 100M:

$ argocd app create alpine99xml --repo https://bhgitlab.ext.net.nokia.com/stang1/argocd-example-apps.git --path alpine --dest-server https://kubernetes.default.svc/ --dest-namespace default --upsert
FATA[0020] rpc error: code = InvalidArgument desc = application spec for alpine99xml is invalid: InvalidSpecError: Unable to generate manifests in alpine: rpc error: code = ResourceExhausted desc = grpc: trying to send message larger than max (109132530 vs. 104857600)

The ARGOCD_GRPC_MAX_SIZE_MB is used in in the argo cd server, but has not been used in the reposerver component, where the 100M is still hardcoded

To Reproduce

  1. Create a large test manifest file (>100MB) and push to Git.
  2. Use argocd cli to sync the file to the cluster as shown in the example in section "Describe the bug" above.

Expected behavior

Files larger than 100MB can be synched to the target cluster, according to ARGOCD_GRPC_MAX_SIZE_MB setting.

Version

$ argocd version
argocd: v2.9.2+c5ea5c4.dirty
  BuildDate: 2023-11-20T18:19:09Z
  GitCommit: c5ea5c4df52943a6fff6c0be181fde5358970304
  GitTreeState: dirty
  GoVersion: go1.21.4
  Compiler: gc
  Platform: linux/amd64
argocd-server: v2.9.2+c5ea5c4.dirty
  BuildDate: 2023-11-20T18:19:09Z
  GitCommit: c5ea5c4df52943a6fff6c0be181fde5358970304
  GitTreeState: dirty
  GoVersion: go1.21.4
  Compiler: gc
  Platform: linux/amd64
  Kustomize Version: could not get kustomize version: exec: "kustomize": executable file not found in $PATH
  Helm Version: v3.10.1+g9f88ccb
  Kubectl Version: v0.24.2
  Jsonnet Version: v0.20.0
juwon8891 commented 3 months ago

@athanassis I think this issue has been resolved at the moment.

// MaxGRPCMessageSize contains max grpc message size
var MaxGRPCMessageSize = env.ParseNumFromEnv(common.EnvGRPCMaxSizeMB, 100, 0, math.MaxInt32) * 1024 * 1024