<p>Looking at <a href="https://stackoverflow.com/questions/53012798/kubernetes-configmap-size-limitation">Kubernetes ConfigMap size limitation</a> and <a href="https://github.com/kubernetes/kubernetes/issues/19781" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/issues/19781</a>, the size limit for ConfigMap resources in Kubernetes seems to be 1 MB due to etcd restrictions. However, why do comments in the YAML for one's ConfigMap resources count towards the size and the 1 MB limit?</p>

<p>By comments, I mean the following in a sample ConfigMap yaml file:</p>

<pre><code>---
kind: ConfigMap
apiVersion: v1
metadata:
  name: my-configmap
  namespace: default
data:
  # Comment lines here that do not impact the ConfigMap in terms of actual value
  # or the resource but seem to count towards the 1 MB size limit
  key: val
</code></pre>

RochesterinNYC
<p>1MB limit is not a limit for your data, but the limit for whole ConfigMap object that is stored in etcd.</p>
