3 ms·
Can't ConfigMap be binary data? I never understood why one is base64 and the other not.
by remram 5y ago
Can't ConfigMap be binary data? I never understood why one is base64 and the other not.
- dharmab 5y agoBecause these objects were defined earlier in Kubernetes' history the fields have inconsistent names and defaults. In Secret there is a canonical data field which stores bytes and a stringData field which will convert text to bytes for you. ConfigMap has separate data (text) and binaryData (bytes) fields which are both canonical. If the interface were redesigned today, Secrets would probably look like a renamed clone of ConfigMap.
- remram 5y agoI didn't know about ConfigMap's binaryData or Secret's stringData, thanks!