-
Notifications
You must be signed in to change notification settings - Fork 986
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
Allow using kubernetes_manifest when the kubernetes cluster is not yet available #1625
Comments
Nevermind, this is really just another problem caused by Terraform's inability to handle a provider depending on attributes of resources defined by another provider. Latest update on the issue is here hashicorp/terraform#2430 (comment). Currently, it is required to put it in a separate state from the cluster. |
FWIW, I think there is a hypothetical design here where I don't know enough about this provider or Kubernetes to speak to how feasible that would be, but if it is technically possible then I think it's interesting to think about whether that behavior would be useful. It would in principle allow creating a cluster and pushing manifests to it all in one step, but if any of the manifests are invalid then the Since the current design requires two Again I don't really know enough to make this tradeoff, but I just wanted to note the possibility; I suspect the maintainers of this provider already considered such an approach and encountered downsides I'm not considering. |
@apparentlymart, as we've discussed on a few occasions in the past, the main reason why the Per your suggestion, should the provider fall back to accepting the Object value of the manifest as it was supplied by the user and return that as the plan output, the followup apply might actually add new Object attributes (defaults returned by the API for unset values) thus effectively changing the type of an object attribute between plan and apply (Objects with different sets of attributes are considered different types). Terraform does not tolerate this and satisfying this requirement is what drove most of the complexity in the manifest provider and led us to build the OpenAPI to tftypes mechanism. Falling back like you suggested would result in an even more brittle user experience, littered with "Provider produced an incosistent state" errors. We've already tried it early in the development of the manifest provider. |
I would expect it to work if the provider responded to |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Description
We need to use
kubernetes_manifest
in order to define CRDs and other things not yet supported by the Terraform Kubernetes provider. Without that functionality, it is essentially useless for us to try and use Terraform to manage Kubernetes resources.Currently, because
kubernetes_manifest
uses server side apply, the Kubernetes cluster has to be online at planning time. We would like to be able to define the Kubernetes cluster and CRDs needed to bootstrap the cluster in the same Terraform state. That way, when we need to experiment with something, we can launch all related resources in one go.Community Note
The text was updated successfully, but these errors were encountered: