<p>If I want to add a field in a CRD(without change any exist field), Should I do it by create a new version?</p>
<p>If I should create a new version, then what's the disadvantages of directly modifying the original version?</p>

dayeguilaiye
<p>As explained in the <strong><a href="https://faun.dev/c/stories/dineshparvathaneni/kubernetes-crd-versioning-for-operator-developers/" rel="nofollow noreferrer">blog</a></strong> written by <strong>Dinesh Parvathaneni</strong>, you can validate the points as mentioned below:</p>
<p>CRDs are similar to K8s built-in types and the expectation for operator developers is to follow the same guidelines when it comes to their versioning.</p>
<ul>
<li>
<blockquote>
<p>Adding a <strong>required new field</strong> or removing a field is a <strong>backward incompatible change</strong> to the API. This makes all the old versions
immediately unusable. So don’t make backward incompatible CRD API
changes.</p>
</blockquote>
</li>
<li>
<blockquote>
<p>If you want to still continue using the old versions they need to be updated with the <strong>new field</strong> as an <strong>optional parameter</strong> as K8s
doesn’t add a required field, instead adds an optional field with a<br />
default value.</p>
</blockquote>
<blockquote>
<p><strong>Example</strong>: when a new field is added, the new version of the operator would still behave as the old version when the new field is
not provided in user input. This is more like a <strong>feature flag</strong> for
the new features in the operator.</p>
</blockquote>
</li>
<li>
<blockquote>
<p>CRD can define multiple versions of the custom resource. A version can be marked as served or not served and only one version can be
used as a storage version in <strong>etcd</strong>.</p>
</blockquote>
</li>
<li>
<blockquote>
<p>If there is <strong>schema difference</strong> across versions, conversion <strong>webhooks</strong> are needed to convert between versions when necessary.</p>
</blockquote>
</li>
</ul>
<p>Hope the above information is useful to you.</p>
