<p>Is there a limit on the size of Kubernetes spec and status size in Kubernetes?</p>
<p>I have a use case in which the operator spec is a regular expression and regex gets expanded to a lot of actual items whose status I have to store.</p>
<p>Example:</p>
<pre class="lang-yaml prettyprint-override"><code>type RedshiftSinkSpec struct {
    TopicRegexes string `json:&quot;topicRegexes&quot;`
}

type Topic string

type RedshiftSinkStatus struct {
    // +optional
    CurrentMaskStatus map[Topic]MaskStatus `json:&quot;currentMaskStatus,omitempty&quot;`

    // +optional
    DesiredMaskStatus map[Topic]MaskStatus `json:&quot;desiredMaskStatus,omitempty&quot;`
}
</code></pre>
<p>Since the number of topics is being computed from the regular expression. I have no idea how big the data structure can grow for someone else. So would want to cap it at some level. Hence need help with the max limit Kubernetes allows.</p>
<p>Also, it is necessary to have it like this to save on the number of Redshift connections. Cannot really break the problem into one more crd with one topic.</p>
<p>Please suggest.</p>

Alok Kumar Singh
<p>Quoting the answer from the comment.</p>
<blockquote>
<p>Kubernetes stores cluster data in etcd. By default, etcd limits the
maximum data entry size to 1.5 megabytes. – Chin Huang</p>
</blockquote>
<p>ETCD Documentation: <a href="https://github.com/etcd-io/etcd/blob/master/Documentation/dev-guide/limit.md" rel="nofollow noreferrer">Request size limit</a>:</p>
<blockquote>
<p>etcd is designed to handle small key value pairs typical for metadata.
Larger requests will work, but may increase the latency of other
requests. By default, the maximum size of any request is 1.5 MiB. This
limit is configurable through --max-request-bytes flag for etcd
server.</p>
</blockquote>
<p>Kubernetes has not put any limits on Status and Spec size individually but the limit is on the overall object size since limits are from the etcd storage. It can be configured using <code>--max-request-bytes</code>. It is better to use Config Maps to store status when the data is huge and save pointers or overall summary in the status.</p>
