Skip to content

The use of x-kubernetes-preserve-unknown-fields stops Terrafrom from updating manifests in-place causing cluster wipes #2676

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
EraYaN opened this issue Jun 27, 2024 · 2 comments

Comments

@EraYaN
Copy link

EraYaN commented Jun 27, 2024

Please, answer some short questions which should help us to understand your problem / question better?

  • Which image of the operator are you using? registry.opensource.zalan.do/acid/postgres-operator:v1.11.0
  • Where do you run it - cloud or metal? Kubernetes or OpenShift? Azure AKS
  • Are you running Postgres Operator in production? yes
  • Type of issue? Enhancement request

So this is based on hashicorp/terraform-provider-kubernetes#1841 (comment)

Anyway any change to the manifests in Terraform will replace the postgresql crd causing the data to be wiped and the server to be empty.

This seems to be used in a couple of places like (6 total in that file):

x-kubernetes-preserve-unknown-fields: true

and
x-kubernetes-preserve-unknown-fields: true

Both of these should have known specs and it would be very useful if they could be fully specced, which would resolve any problems with programs like terraform or pulumi that require fully specified schema's to do their job and use in-place updates.

An alternative would be to make the operator tolerant to replacement of CRD resources of course, but that feels a bit less clean.

@FxKu
Copy link
Member

FxKu commented Aug 6, 2024

Hi,
please, to provide a PR. I will not spend time on this except reviewing. One problem with full specs is that we need to track changes in K8s, because the CRDs are not generated automatically like when using tools such as kubebuilder.

@EraYaN
Copy link
Author

EraYaN commented Aug 7, 2024

We are migrating away from this operator, so this can be closed.

@EraYaN EraYaN closed this as completed Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants