-
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
kubernetes_manifest fails terraform plan due to not yet created namespace #1692
Comments
This is more of a design limitation than a bug. When a resource is non-structured (the The workaround/solution is to plan & apply twice, either in the first stage with the |
@jbg Thanks a lot for the reply! I guess we will have to rework our modules on this point as we hit a limitation of the kubernetes provider. |
Those warnings are about a different issue, but one which manifests in a similar way (needing connectivity to the cluster at plan time). In your case, if Azure had included a schema in that CRD, you shouldn't have hit this specific problem. Something weird though is that schema was actually added to the aad-pod-identity CRDs in April 2021. So unless you're using a really old version of the CRDs, it should have already worked without needing to do a dry-run apply at plan time. |
Thanks again, I will have a look on the CRDs, maybe this resolves our issue |
as addition on how I fixed it on the cluster:
The core issue was that we missed to update the CRD of the AAD Pod Identity after upgrading to version 1.8.0. This was introduced on our cluster by upgrading the Helm Chart from version 4.0.0 to 4.1.0. |
Note that you can use the |
Do you have some doumentation about how to do this? Sounds very good |
https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/manifest You can use a tool like https://github.com/jrhouston/tfk8s to convert YAML manifests (even files containing multiple objects) to HCL. |
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. |
Affected Resource(s)
Terraform Configuration Files
Debug Output
Panic Output
Steps to Reproduce
terraform plan
-->Expected Behavior
Terraform plan should display the resources to be created later.
Terraform creates a new Kubernetes namespace.
Terraform calls the k8s and creates an AzureIdentity object.
We just recently upgraded from k8s 1.21 to 1.22, not sure if this is important.
Actual Behavior
Terraform stops its process.
References
The text was updated successfully, but these errors were encountered: