Skip to content
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

Terraform forces full VMCluster CR replace because of VM* CRD schemas #671

Open
artmakh opened this issue Jun 19, 2023 · 3 comments
Open
Labels
enhancement New feature or request

Comments

@artmakh
Copy link

artmakh commented Jun 19, 2023

Hello!

We are using VMOperator + VM CR recourses, and manage them via terraform.

We modify Cluster CR inside terraform configuration and apply them via terraform's kubernetes provider.
In some cases this results in full replace of CR inside kubernetes cluster, which results in downtimes.

For example, if you modify anything inside vmstorage volumeClaimTemplate it will force replace of full CR, instead of modifying it.
This happens because of x-kubernetes-preserve-unknown-fields: true flag, which exists in a lot of parts of victoriametrics CRDs.

This flag basically forces terraform to replace resource, because there is no provided schema for terraform inside this part of CRD. Here is better explanation from one of Terraform's developers .

Is it possible to add schema information for at least some, presumably often modified, parts of Victoriametrics CRDs?

@f41gh7 f41gh7 added the enhancement New feature or request label Jun 19, 2023
@f41gh7
Copy link
Collaborator

f41gh7 commented Jun 19, 2023

Hello, thanks for reporting. It's really unexpected to me, that terraform handles such fields with replace.

x-kubernetes-preserve-unknown-fields was added, because CRD definition grows extremely large.
And it's not possible to use all CRDs as bundle. There is 1 MB limit for kubernetes configmaps.

Probably, there is some work arounds for terraform kubernetes provider case?

@f41gh7
Copy link
Collaborator

f41gh7 commented Jun 19, 2023

@hatemosphere
Copy link

Probably, there is some work arounds for terraform kubernetes provider case?

nah, there are no workarounds, as far as we know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants