-
Notifications
You must be signed in to change notification settings - Fork 989
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
Error listing K8s resources using data_kubernetes_resources #2215
Comments
Hi @rafed, I am not able to reproduce this issue. Is there any other facts we need to know to reproduce the issue? Have you tried data source Thank you. |
Hey @arybolovlev. Thanks for looking into this! I think I understand what's causing this on my end. When I tried listing PVCs on all other namespaces in my cluster, I am getting them without any issue. However, the issue occurs in my mongodb namespace. And it's probably because of one non ready PVC. The following is a screenshot of my mongodb PVCs. If I use `│Error: Failed to save resource state with data.kubernetes_resources.pvc, AttributeName("metadata").AttributeName("managedFields"): AttributeName("metadata").AttributeName("managedFields")] incompatible tuple types` Any thoughts on this? :/ |
Hi @rafed, Thank you for this clarification. Now I am able to reproduce this issue and get the same error message. A quick investigation brought me to the idea that it might be related to the My example: $ kubectl -n this get pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
task-pv-claim Bound task-pv-volume 10Gi RWO manual 28m
task-pv-claim2 Pending manual 28m
$ kubectl -n this get pvc -o yaml
apiVersion: v1
items:
- apiVersion: v1
kind: PersistentVolumeClaim
...
status:
accessModes:
- ReadWriteOnce
capacity:
storage: 10Gi
phase: Bound
- apiVersion: v1
kind: PersistentVolumeClaim
...
status:
phase: Pending As you can see, PVC with status We definitely need more time to investigate and address this issue. |
I get the same error when searching for Services in Kubernetes with
EDIT: I'm using version 2.23.0 of the Kubernetes Provider. This issue says 1.22.0. I'm not sure if that's a mistype or if I should create another ticket. |
@bradhandy any luck with this? I'm running into it as well. I'm trying to get a podname.
|
What I ended up doing was creating a list of the services I expected to be in the namespace, then using I experimented with using an external data source to call a script. The script would run |
Same error with v2.24.0 data "kubernetes_resources" "namespaces" {
api_version = "v1"
kind = "Namespace"
field_selector = "metadata.name!=kube-system"
}
output "namespaces" {
value = data.kubernetes_resources.namespaces.objects
}
|
so, even the example in the docs doesn't work? |
Same error with v2.25.2
Error: |
Still issues on 2.27.0 |
Same
|
Terraform Version, Provider Version and Kubernetes Version
Affected Resource(s)
Issue appears to affect multiple resources, it may be an issue with Terraform's core.
Terraform Configuration Files
Debug Output
https://gist.github.com/rafed/742a2f107c92f81f2b0a0ba37eeffc3a
Steps to Reproduce
terraform plan
Expected Behavior
Should list the pvcs in the mongodb namespace
Actual Behavior
Throws error
Important Factoids
Running in EKS
References
#2214
Community Note
The text was updated successfully, but these errors were encountered: