gavinbunney / terraform-provider-kubectl

Terraform provider to handle raw kubernetes manifest yaml files
https://registry.terraform.io/providers/gavinbunney/kubectl
Mozilla Public License 2.0
612 stars 105 forks source link

`context deadline exceeded` during terraform apply #211

Open cocotton opened 1 year ago

cocotton commented 1 year ago

I just had an issue where when I run terraform apply, if I have some other resources that take a while to have their states refreshed, the kubectl_manifest ones will error out with the following message:

| Error: failed to create kubernetes rest client for read of resource: Get "https://REDACTED/api?timeout=32s": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
│
│   with kubectl_manifest.redacted["ServiceAccount"],
│   on redacted.tf line 2, in resource "kubectl_manifest" "redacted":
│    2: resource "kubectl_manifest" "redacted" {
│

I managed to go around this issue by having the kubectl_manifest resources depend (with depends_on) on some non-related resource that has its state refreshed late in the terraform plan phase.

Would it be possible instead to specify a timeout longer than 32 seconds (as can be seen in the error message above)?

ServerNinja commented 1 year ago

We are experiencing similar issues. It would be very helpful to be able to adjust the 32 second timeout.