-
Notifications
You must be signed in to change notification settings - Fork 979
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
Unable to create Custom Resource (CR) Failed to determine GroupVersionResource for manifest #1917
Comments
If the This is due to the provider needing to read the CRD schema from the API server during the planning phase, while the CRD itself would only be created by the helm chart during the apply phase (later than required). |
Same issue.
|
@alexsomesan this makes sense during an attempt to create CRDs (via Helm chart) and resources based on CRD - in one go. However, in our situation we're seeing this same issue after CRDs have already been applied, e.g. on a subsequent apply. Following the logic you've outlined, provider should be able to fetch the CRD definitions during the planning phase, right? Either I am failing to interpret the logic how provider works, or something else is standing in a way to apply the resources 🤔 |
In fact it's a bit more nuanced in our case:
Any idea what kind of further diagnostics could help out here? 🤔 I'd be happy to provider it |
Ignore what I said in #1917 (comment), in the end it was our fault. The mistake was the the CRDs were applied to one cluster, but the CRD resources were attempted to be created in another 🤦 |
This issue is critical! With this issue Kubernetes terraform module is useless in many cases. Why there no workaround yet? Is there any workaround available? |
For me, this article helped: https://www.hashicorp.com/blog/beta-support-for-crds-in-the-terraform-provider-for-kubernetes |
I share these sentiments. I wonder if an argument can be added for specifying a URL to fetch the spec from instead? Maybe even a parameter accepting a string in case the spec can be sourced from a file or a variable. As others have noted, there's limited value in |
Your best bet to work around this issue is to store the CRD as a |
As other have said it would be awesome to deploy CRDs and resources using that CRD in the same run. Since the CRDs are not in the cluster when Just like ArgoCD we could have a |
FWIW a workaround would be to install the CRDs using the kubernetes provider, then fall back to Here's an excerpt from our own terraform configuration, which installs cert-manager, its CRDs, and creates an
|
Terraform Version, Provider Version and Kubernetes Version
Affected Resource(s)
Terraform Configuration Files
Steps to Reproduce
traefik.tf
:or
Expected Behavior
What should have happened?
Terrafom should create Traefik helm release and appropriate CRDs and next
kubernetes_manifest.middleware_argocd_argocd
kubernetes manifest because we have the defined the followingdepends_on
in the Traefik terraform manifest file :Actual Behavior
What actually happened?
When planning or applying the terraform configuration file, the following error appears :
We can see the terraform kubernetes provider try first to read the relevant
middlewares.traefik.containo.us
CRD before create the CR despite thedepends_on
terraform field.The error appears normal because at this execution time
middlewares.traefik.containo.us
CRD doesn't exist and this is why I add theto orchestrate the order of creation of resources.
The correct behavior should be, first create the helm traefik release (and appropriate CRD) and then read and create the CR.
Important Factoids
References
There are several issues already opened :
Community Note
The text was updated successfully, but these errors were encountered: