-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
TaskRun with extremely large params fails to run #7513
Comments
@rouke-broersma Are you calling these params in |
Afaik you don't need to use the params, simply setting the params on the taskrun will cause the built in init containers to crash when dealing with the param. Any param with more than 25000 characters would cause this. I can provide an example later. |
I was able to reproduce it with a much larger param value. I don't think this is a bug in Tekton. You are running into the max limit you can pass via a CLI argument list which varies depending on the operating system. If the param value is huge or if you have too many params that cumulatively get this large, you will run into the same error. That's because they end up becoming part of a huge bash My suggestion if you have such extreme use case is to see if you can send that information via a file and mount the file via a volume. Your Step can probably access that file and extract the information. It's also important to note that if the params are too large then the CRD will be very large also and K8s imposes a Max limit of 1.5 MBs on the size of the CRD as well. I encourage other @tektoncd/core-collaborators to chime in here as well. |
@chitrangpatel I don't disagree except the place-scripts container is provided by tekton, tekton implements the method to pass the run params to containers and tekton allows this large param in the crd. So either the crd or an admission controller should place limits on the param size or tekton should modify the way params are passed so the large params are supported in tekton's own containers. Obviously it can only be limited to what tekton has control over. We can work around this with a config map or something but as it stands tekton allows this in one place and doesn't support it in another. |
@rouke-broersma Is it happening when using the Initially, the This is indeed probably the case (looking at the code). I think the "current" workaround is indeed to use a configmap or an image with most of the script content in. The
I think it should be documented as a "known limitation" with some alternatives / workarounds to apply in different context though. |
On validation, we may be able to do something as well but it's not really clear what "limit" we would set. As written here, it's not super clear what is the limit per os, and it can depend, for example on linux, on kernel options, … I tried the So we would have to decide on an arbitrary limit (or the lowest one we could find) to make it work in most cases. |
And this limit would have to be on the size of all the scripts combined. Even with small param sizes, it can be easily triggered with many such params (or many steps with large scripts) that cumulatively reach this limit. At that point, I wonder if that's any better than the container failing (it's still a runtime error). |
@vdemeester I wonder the On the other hand, how would the controller write the file which the init-container can access 🤔 because the container could be spawned on a completely different node. So this might not be cleanly possible. ConfigMap? Downward API? Or keep the behaviour the same and add one |
Yes, we have to "pass" the "content" of the script into a file somehow. Right now, we pass it as part of the
Anything "external" to the
This has other implications, see here ; essentially more containers means "smaller" possible results and it already bite us in the past. |
We are using TaskRuns with the |
Agreed. However, we now also offer |
Ah I see. That's "kind-of" a problem as well. Params are really meant for "relatively" small size "parameters". The content of a file is usually not consider as such. We could "try" to limit with an arbitrary length (for params) but it would be a breaking change (so.. we would have to do in a v2). And even, what would be that limit, how would we choose it ? For now, the only thing we can do is to document this as a "kind-of" known limitation, and discuss best practices. |
Expected Behavior
Either TaskRun is denied/invalid if param size is above certain limits or TaskRun starts successfully.
Actual Behavior
TaskRun fails with error
exec /bin/sh: argument list too long
Steps to Reproduce the Problem
Additional Info
Kubernetes version:
Output of
kubectl version
:Tekton Pipeline version:
Output of
tkn version
orkubectl get pods -n tekton-pipelines -l app=tekton-pipelines-controller -o=jsonpath='{.items[0].metadata.labels.version}'
The text was updated successfully, but these errors were encountered: