| title | Request Entity Too Large | |||||
|---|---|---|---|---|---|---|
| error_message | request is too large: etcd request value exceeds the maximum limit of 1.5MB | |||||
| category | api-server | |||||
| severity | Medium | |||||
| recovery_time | 10–40 min | |||||
| k8s_versions | 1.20+ | |||||
| tags |
|
|||||
| related |
|
Severity: Medium · Typical recovery time: 10–40 min · Affected versions: 1.20+
Error from server (RequestEntityTooLarge): request is too large:
etcd request value exceeds the maximum limit of 1.5MB
etcd enforces a maximum value size (default ~1.5 MiB per object) and the
apiserver enforces request body limits. When an object — typically a ConfigMap,
Secret, large CRD, or a resource with a bloated managed-fields/annotations —
exceeds that, writes are rejected with RequestEntityTooLarge. It is usually a
data-modeling problem: storing files, certs, or generated blobs in etcd instead
of object storage.
Applies to 1.20+. etcd's per-value limit (--max-request-bytes, default ~1.5 MiB
effective) and the apiserver's --max-request-bytes are stable across these
versions. The classic offender, large kubectl apply last-applied annotations,
is reduced by Server-Side Apply (GA 1.22).
- A ConfigMap/Secret holding large files, certs, or binaries
- A CRD object that has grown huge (embedded data, big status)
- Bloated
kubectl.kubernetes.io/last-applied-configurationannotation - Excessive
managedFieldsgrowth from many controllers - Helm release secrets storing large rendered manifests
flowchart TD
A[RequestEntityTooLarge] --> B{Which object?}
B --> C{ConfigMap/Secret with big data?}
C -- Yes --> D[Move data out of etcd]
C -- No --> E{Bloated annotations/managedFields?}
E -- Yes --> F[Use Server-Side Apply / trim]
E -- No --> G[Split CRD or store blob externally]
Identify the specific object and what is consuming its size (data keys, annotations, or managedFields) before changing anything.
kubectl get configmap <name> -n <ns> -o json | wc -c
kubectl get <resource> <name> -n <ns> -o json | jq '.metadata.annotations | to_entries | map({k:.key, bytes:(.value|length)}) | sort_by(.bytes)'
kubectl get <resource> <name> -n <ns> -o json | jq '.metadata.managedFields | length'
kubectl get events -A --sort-by=.lastTimestamp | grep -i 'too large'
kubectl api-resources --verbs=list -o name | head$ kubectl create configmap big --from-file=./model.bin
The ConfigMap "big" is invalid: []: Too long: must have at most 1048576 bytes
$ kubectl get cm big -o json | wc -c
2231041 # ~2.1 MB, over the etcd value limit
- Move large payloads out of etcd: use a PVC, object storage (S3/GCS), or an init-container that fetches the data at runtime.
- Split one oversized ConfigMap/Secret into several smaller ones.
- Use Server-Side Apply (
kubectl apply --server-side) to avoid the last-applied annotation bloat. - Trim
managedFields/annotations and reduce CRDstatussize.
- Confirm the object and the source of bloat with the commands above.
- Recreate the data in a smaller/externalized form and update referencing workloads to the new source.
- Disruptive: raising etcd/apiserver
--max-request-bytesis possible but discouraged — it increases memory pressure and latency cluster-wide and requires restarting the apiserver static pod (blast radius: one control-plane node, staggered in HA). Prefer fixing the data model.
The previously failing create/update succeeds and the object size is comfortably under the limit.
Keep large/binary data out of etcd, adopt Server-Side Apply, lint object sizes in CI, set ResourceQuota where appropriate, and alert on etcd DB growth so bloat is caught early.