Kubernetes ConfigMap 大小限制 [英] Kubernetes ConfigMap size limitation

查看:146
本文介绍了Kubernetes ConfigMap 大小限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尽管 resourceQuotas 可能会限制命名空间中配置映射的数量,但是否有任何此类选项来限制单个配置映射的大小?我不喜欢某些用户开始上传大文本文件作为配置映射.

Though resourceQuotas may limit the number of configmaps in a namespace, is there any such option to limit the size of the individual configmap? I will not like some user to start uploading large text files as configmaps.

ConfigMap etcd 支持的最大大小是多少?如果在 etcd 方面有一个合理的限制,那么应该没问题.

What is the max size of ConfigMap etcd support? If there is a reasonable limit on the etcd side, should be fine then.

推荐答案

没有硬限制 在撰写本文时在 ConfigMap 或 Secret 对象上.

There are no hard-limits on either the ConfigMap or Secret objects as of this writing.

但是,Kubernetes 存储的 etcd 端有 1MB 的限制它的对象.

There's, however, a 1MB limit from the etcd side which is where Kubernetes stores its objects.

从API方面,如果你真的看到了API code 和 ConfigMap 类型,你会看到它的 data 字段是 Golang 的字符串映射,因此这看起来是内存绑定并在运行时管理的,除非它在其他地方用 make() 定义.从技术上讲,hashmap 上键数的最大大小是映射长度,它是一个 int,最大值在这里解释:地图中元素的最大数量.这也将是数据值作为 len(string) 的最大值的理论限制.

From the API side, if you actually see the API code and the ConfigMap type, you'll see that its data field is Golang map of strings so this appears memory bound and managed at runtime unless somewhere else it gets defined with make(). Technically the max size for the number of keys on hashmap is the map length which is an int and the max value is explained here: Maximum number of elements in map. That would also be the theoretical limit for the value of data as the maximum value for len(string).

如果您真的想从 kube-apiserver 接收 protobufs(或 JSON)的 API 方面获得更多见解,您可以查看 google protobuf 最大尺寸.这将为您提供有关通过线路发送 data 字段的限制的一些措施.在处理任何大消息时,kube-apiserver 本身可能还有其他限制.

If you actually want to get more insights from the API side where the kube-apiserver receives protobufs (or JSON for that matter) you can take a look at the google protobuf maximum size. That will give you some measure as to the limitation of sending the data field through the wire. There may be other limitation from the kube-apiserver itself when it comes to processing any large message.

这篇关于Kubernetes ConfigMap 大小限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆