-
Problem Overview When a CRD with default values is applied in a Kubernetes cluster, the control plane removes fields containing default values before storing the CRD in etcd. This behavior is in line with Kubernetes' internal mechanics but creates a mismatch between the original CRD YAML and the stored CRD. As a result, ArgoCD, which relies on synchronization between declared and stored resources, flags this as a drift and cannot reconcile the resources properly. To resolve this, I have manually removed the fields with default values (in my case spec.names.shortNames, spec.names.categories, and spec.versions.additionalPrinterColumns) from CRDs generated with kube-derive. While this approach addresses the ArgoCD synchronization issue, it raises questions about how not to generated this default fields with kube-derive. Proposal and Questions Flexibility in kube-derive: We would greatly appreciate the team's insights on this matter and any recommendations or potential roadmaps for addressing this scenario. Looking forward to your feedback and guidance! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
Here is a link to the issue: stackabletech/hdfs-operator#626, the associated PR show the yaml CRDS which have been patched in order to run ArgoCD sync successfully. |
Beta Was this translation helpful? Give feedback.
-
Any idea please? |
Beta Was this translation helpful? Give feedback.
-
This sounds like an argo cd or kubernetes issue tbh. The defaults you are listing ( The propsal in the upstream issue is to remove them from templating, which is strange to me because then how do you actually get shortnames/printercoloumns etc? You can obviously elide the EDIT: slight clarifying edits |
Beta Was this translation helpful? Give feedback.
-
There is a proposed improvement on the argocd side: argoproj/argo-cd#12686 which would be easy to plug in via |
Beta Was this translation helpful? Give feedback.
-
Looking at your proposed PR upstream https://github.com/stackabletech/hdfs-operator/pull/639/files it seems you want to remove empty values rather than omit the fields in general. If we insert explicit empty vectors into optional vectors even if we do not set (e.g.) |
Beta Was this translation helpful? Give feedback.
Looking at your proposed PR upstream https://github.com/stackabletech/hdfs-operator/pull/639/files it seems you want to remove empty values rather than omit the fields in general. If we insert explicit empty vectors into optional vectors even if we do not set (e.g.)
#[kube(category...)]
then that is actually a bug on our side.