Repository navigation
Description
The operator-crds Helm release is about 97.6% of the 1 MiB limit Kubernetes puts on a Secret, which is where Helm stores each release. On main the stored release is roughly 1,024,000 bytes out of 1,048,576. A change that adds about 25 KB to the stored release breaks helm install and helm upgrade of the chart with:
Error: UPGRADE FAILED: create: failed to create: Secret "sh.helm.release.v1.toolhive-operator-crds.vN" is invalid: data: Too long: may not be more than 1048576 bytes
We hit this while adding fields to the JWT-bearer policy of the embedded auth server: the new fields and their CEL rules were enough to go over.
Why the release is so big:
- Helm stores both the chart's templates and the rendered manifest, so every CRD is in the release twice. The templates are stored as base64 inside the release JSON, which compresses poorly. On main the templates are about 2.6 MB and the manifest about 2.0 MB before compression.
- The deprecated
v1alpha1version of each CRD carries its own full schema next tov1beta1, so roughly half of each CRD file is the old version. - The embedded auth server config is part of both
MCPExternalAuthConfigandVirtualMCPServer, and some of it appears on two paths (for exampletrustedIssuers[].jwtBearerGrantandinboundGrants.jwtBearer.issuerPolicies[]). With two versions, a field added there shows up eight times across the CRDs.
Possible ways out, roughly from most to least effective:
- Stop serving a full schema for
v1alpha1, or drop the version once nothing stores it. This would roughly halve the two big CRDs. - Split the CRDs over more than one chart or release, so no single release holds all of them.
- Install the CRDs outside Helm (for example by the operator or with
kubectl apply), and keep the chart for everything else. - Shorten descriptions and CEL messages. This buys a few percent at most and does not fix the trend.
Until one of the first three lands, every CRD change has to be checked against the limit. One way to measure is to render the release with helm install --dry-run=client -o json, gzip it and base64-encode it, which comes within a few KB of what Helm stores.
Activity