Looking at Kubernetes ConfigMap size limitation and https://github.com/kubernetes/kubernetes/issues/19781, 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?
By comments, I mean the following in a sample ConfigMap yaml file:
---
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
1MB limit is not a limit for your data, but the limit for whole ConfigMap object that is stored in etcd.