Updating to 1.12.0 Fails To Reconcile in Flux

Hi,

We use flux to apply our K8s configs to our cluster. We’re unable to upgrade from 1.11 to 1.12, however, since it fails with the following error:

CustomResourceDefinition/perconaservermongodbs.psmdb.percona.com dry-run failed, reason: Invalid, error: CustomResourceDefinition.apiextensions.k8s.io "perconaservermongodbs.psmdb.percona.com" is invalid: spec.preserveUnknownFields: Invalid value: true: must be false in order to use defaults in the schema

Has anyone else hit this? 1.11 works just fine so it must be something in the new crd.yaml definitions that we applied, but unfortunately the error doesn’t tell us which fields are missing.

1 Like

Hey Mike,

which k8s version and flavor are you using?

For example starting with k8s 1.22 there are some changes in APIs. Like CustomResourceDefinition is no longer v1beta1, but just v1.

And in some k8s flavors I see the note:

spec.preserveUnknownFields: true is disallowed when creating v1 CustomResourceDe.finition objects; it must be specified within schema definitions as x-kubernetespreserve-unknown-fields: true.

Could you please try to set all occurrences of x-kubernetes-preserve-unknown-fields: to false in crd.yaml?

Also we migrated to OpenAPI schema starting with 1.12, so it might be related. Please let me know how it goes.

1 Like