Kubernetes对象大小限制 [英] Kubernetes object size limitations
问题描述
我正在处理CRD,并创建自定义资源.我需要在定制"资源中保留很多有关我的应用程序的信息.根据官方文档,etcd的请求大小最大为1.5MB.我遇到类似
I am dealing with CRDs and creating Custom resources. I need to keep lots of information about my application in the Custom resource. As per the official doc, etcd works with request up to 1.5MB. I am hitting errors something like
错误":请求实体太大:限制为3145728"
"error": "Request entity too large: limit is 3145728"
我相信错误中的指定限制为3MB.有什么想法吗?有什么办法解决这个问题吗?
I believe the specified limit in the error is 3MB. Any thoughts around this? Any way out for this problem?
推荐答案
- 对于大于3MB的对象,
"error": "Request entity too large: limit is 3145728"
可能是kubernetes处理程序的默认响应,如您所见- The
"error": "Request entity too large: limit is 3145728"
is probably the default response from kubernetes handler for objects larger than 3MB, as you can see here at L305 of the source code:
expectedMsgFor1MB := `etcdserver: request is too large` expectedMsgFor2MB := `rpc error: code = ResourceExhausted desc = trying to send message larger than max` expectedMsgFor3MB := `Request entity too large: limit is 3145728` expectedMsgForLargeAnnotation := `metadata.annotations: Too long: must have at most 262144 bytes`
-
ETCD 确实有1.5MB的处理限制一个文件,您将在
The ETCD has indeed a 1.5MB limit for processing a file and you will find on ETCD Documentation a suggestion to try the
--max-request-bytes
flag but it would have no effect on a GKE cluster because you don't have such permission on master node.但是,即使您这样做,也不是理想选择,因为通常此错误表示您消耗对象而不是引用它们会降低性能.
But even if you did, it would not be ideal because usually this error means that you are consuming the objects instead of referencing them which would degrade your performance.
我强烈建议您改为考虑以下选项:
I highly recommend that you consider instead these options:
- 确定您的对象是否包含未使用的引用;
- 破坏您的资源;
- 改为考虑进行卷挂载;
- Determine whether your object includes references that aren't used;
- Break up your resource;
- Consider a volume mount instead;
有人要求提供一个新的API资源:文件(orBinaryData)适用于您的情况.它很新鲜,但是请多加注意.
There's a request for a new API Resource: File (orBinaryData) that could apply to your case. It's very fresh but it's good to keep an eye on.
如果您仍然需要帮助,请告诉我.
If you still need help let me know.
这篇关于Kubernetes对象大小限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
- The