Skip to content

Source-backed platform rule

Kubernetes ConfigMap data size limit

Kubernetes limits the data stored in a ConfigMap to 1 MiB; the source does not state a specific enforcement action.

RuleRoster is independent and is not affiliated with or endorsed by Kubernetes.

Direct answer

What is the rule?

The data stored in a Kubernetes ConfigMap cannot exceed 1 MiB; the specific enforcement action is not stated.

Scope
Kubernetes object limits, workload identity, and quota enforcement
Rule verified
August 14, 2026
Source checked
October 18, 2026

Published evidence

Rule details

ConfigMap stored data size

The data stored in a Kubernetes ConfigMap cannot exceed 1 MiB. The reviewed documentation does not state a specific enforcement action, so RuleRoster does not infer one.

Applicability

Service: Kubernetes. Rule group: object size. Resource: data stored in one ConfigMap. Policy version and effective dates: not stated.

Worked check

Check your ConfigMap before deployment

Measure the rendered ConfigMap, not the YAML file length. This local Node.js check adds UTF-8 bytes in data to decoded bytes in binaryData. Keys and JSON formatting are not part of this particular data-size check.

  1. Export one rendered v1 ConfigMap as JSON to a local file named configmap.json. Do not use a List or Secret. Keep confidential values on your machine.
  2. Run the command below from that file’s directory. It reads standard input and prints byte totals only; nothing is uploaded to RuleRoster.
  3. If the total exceeds 1,048,576 bytes, reduce the stored data or move large files to a suitable mounted volume or file service. Check application loading behavior before splitting configuration.
node -e 'const fs = require("node:fs");
const cm = JSON.parse(fs.readFileSync(0, "utf8"));
if (cm.apiVersion !== "v1" || cm.kind !== "ConfigMap") {
  throw new Error("Expected a v1 ConfigMap JSON object, not a Secret or List");
}
function entries(value) {
  if (value === undefined || value === null) return [];
  if (typeof value !== "object" || Array.isArray(value)) {
    throw new Error("Expected a map of strings");
  }
  return Object.entries(value).map(([key, text]) => {
    if (typeof text !== "string") throw new Error("Values must be strings");
    return [key, text];
  });
}
let bytes = 0;
for (const [key, text] of entries(cm.data)) {
  if (Object.hasOwn(cm.binaryData ?? {}, key)) throw new Error("Duplicate data key");
  bytes += Buffer.byteLength(text, "utf8");
}
for (const [, text] of entries(cm.binaryData)) {
  const decoded = Buffer.from(text, "base64");
  if (decoded.toString("base64") !== text) throw new Error("Expected canonical base64");
  bytes += decoded.length;
}
console.log(JSON.stringify({
  bytes, limitBytes: 1048576, withinDataLimit: bytes <= 1048576
}));' < configmap.json

Worked boundary example

A value containing é uses 2 UTF-8 bytes; binaryData containing AQID decodes to 3 bytes. Together they use 5 bytes, regardless of their key names. Exactly 1,048,576 data bytes passes this size check; one byte more does not.

This is not an API admission guarantee: invalid keys, metadata, quotas, policies, and immutable updates can still reject an object. The byte-counting behavior was checked against Kubernetes v1.34; confirm your cluster version before relying on it.

Worked guidance reviewed September 20, 2026. This does not renew the published rule’s verification or source-check dates.

Evidence trail

Official sources

Attribution and license

Kubernetes website and documentation by The Kubernetes Authors. Source: https://github.com/kubernetes/website/tree/0dcdb1dda898de2bd4431a898f86c170e109063f. Licensed under Creative Commons Attribution 4.0 International: https://github.com/kubernetes/website/blob/0dcdb1dda898de2bd4431a898f86c170e109063f/LICENSE. Modified by RuleRoster: RuleRoster extracted and restructured facts into typed rule fields and concise answers. Verified 2026-08-14. No root NOTICE file was present at the reviewed revision. The Creative Commons license does not license trademark or patent rights. No endorsement by Kubernetes is implied.

Interpretation and accountability

Before you act

  1. Confirm that the scope matches your case.
  2. Keep recommendations, enforced limits, exceptions, and unstated details distinct.
  3. Open the official source before relying on the rule for a consequential decision.

Record dates

Published
August 15, 2026
Rule verified
August 14, 2026
Source checked
October 18, 2026
Review due
October 25, 2026

Challenge this record

If the source or summary appears wrong, submit precise evidence for human review.

Submit a correction