You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue Noticed:
I have k8s deployment file which contains resources block with requests block.
converted using k2tf
Once i converted I was getting issue
Error:
Blocks of type "requests" are not expected here. Did you mean to define
argument "requests"? If so, use the equals sign to assign it a value.
Need fix:
k2tf converts resources blocks like below:
k2tf has been updated to use the terraform-kubernetes-provider v2.5.0, so this should be resolved now.
As a test I rendered the test-fixtures/deployment.yaml file in this repo to deployment.tf then ran terraform against it:
❯ tf validate
Success! The configuration is valid.
❯ tf plan | grep -A 8 resources
+ resources {
+ limits = (known after apply)
+ requests = (known after apply)
}
+ security_context {
+ allow_privilege_escalation = true
+ privileged = false
+ read_only_root_filesystem = false
--
+ resources {
+ limits = {
+ "memory" = "8Gi"
}
+ requests = {
+ "cpu" = "300m"
}
}
❯ tf version
Terraform v1.0.5
on linux_amd64
+ provider registry.terraform.io/hashicorp/kubernetes v2.5.0
Your version of Terraform is out of date! The latest version
is 1.0.8. You can update by downloading from https://www.terraform.io/downloads.html
Thanks for k2tf. Saved lots of time.
Issue Noticed:
I have k8s deployment file which contains resources block with requests block.
converted using k2tf
Once i converted I was getting issue
Need fix:
k2tf converts resources blocks like below:
But terraform expects like
Need to assign = to assign values to requests.
Example in Terraform Document
Thanks,
Prakash
The text was updated successfully, but these errors were encountered: