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

问题描述

尽管resourceQuotas可能会限制名称空间中configmap的数量,但是是否有任何这样的选项来限制单个configmap的大小?我不希望某些用户开始将大型文本文件作为configmaps上传.

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.

但是,从 etcd 一侧开始有1MB的限制,这是Kubernetes存储的地方它的对象.

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

从API方面,如果您实际上看到了API code 和ConfigMap类型,您将看到其数据字段是字符串的Golang映射,因此,除非在其他地方使用make()进行了定义,否则这似乎是内存绑定和在运行时进行管理.从技术上讲,哈希图上键的最大数量是映射长度,它是一个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方面获取更多见解,可以查看.这将为您提供一些有关通过电线发送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大小限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 15:38
查看更多