Closed prakash-26790 closed 2 years ago
To be precise that is a change in the Kubernetes-Provider that was introduced with v2.0.
Not sure which version of the provider k2tf
is targeting - just saying
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