-
Notifications
You must be signed in to change notification settings - Fork 34
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
v1 to v2 migration: Confirmation around CRD patching #411
Comments
Hi @nabadger, Helm does not upgrade CRDs when the upgrade operation is performed. That is why if you have v1 installed and then install v2 via Helm, it will only add If you install v2 before applying patch A, you will see in v2 logs that it cannot watch
And the pod will eventually restart:
Patch A updates existing From: ---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: workspaces.app.terraform.io
spec:
versions:
- name: v1alpha1
served: true
storage: true To: ---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: workspaces.app.terraform.io
spec:
versions:
- name: v1alpha1
served: false
storage: false
...
- name: v1alpha2
served: true
storage: true
... There are two crucial fields under each version,
As you can see, At this point, the v1 operator cannot serve CRs. The only difference between patches A and B is that patch A does not have At this point, we don't need In short, I think if you replace CRD instead of applying patch B you will get the same result, but I never tried this. :-) I will try it in my lab and let you know the result, but in any way, I would strongly recommend testing in out first in a lab environment. Thanks! |
Thanks - in my test stack I was able to go from patch-a to the helm version of the crd (will do some more checks). I did hit an issue but I suspect this would also be the case if going from patch-b. When attempting to apply the latest helm version of the CRD I got
The status of the Workspace CRD was:
Note that all resources in my cluster were updated to use I've read about this issue on other operators (i.e. elastic/cloud-on-k8s#2196 (comment) ) In order to get around this I removed |
In my case, I resolved the issue with next steps:
From:
To:
And workspace crd was finally updated |
Operator Version, Kind and Kubernetes Version
YAML Manifest File
n/an
Output Log
Kubectl Outputs
Question
Regarding https://developer.hashicorp.com/terraform/cloud-docs/integrations/kubernetes/ops-v2-migration
it suggests that once we've migrated our v1 workspace resources, we should apply a patch the CRD
Would it be possible to clarify the following:
Thanks
References
Community Note
The text was updated successfully, but these errors were encountered: