hashicorp / terraform-provider-kubernetes

Terraform Kubernetes provider
https://www.terraform.io/docs/providers/kubernetes/
Mozilla Public License 2.0
1.59k stars 973 forks source link

transport is closing when trying to import a kubernetes_manifest resource. #1456

Closed bilby91 closed 3 years ago

bilby91 commented 3 years ago

Hello,

I'm trying to use the kubernetes_manifest resource for overriding certain properties of an existing deployment that is managed by AWS EKS add-on system.

When trying to import the resource, I'm getting the following error:

terragrunt import kubernetes_manifest.coredns_deployment "apiVersion=apps/v1,kind=Deployment,namespace=kube-system,name=coredns"

Error: rpc error: code = Unavailable desc = transport is closing

Terraform Version, Provider Version and Kubernetes Version

Terraform version: v0.14.9
Kubernetes provider version: eks
Kubernetes version: 1.18

Affected Resource(s)

Terraform Configuration Files


resource "kubernetes_manifest" "coredns_deployment" {
  manifest = {
    apiVersion = "v1"
    kind       = "Deployment"
    metadata = {
      name      = "coredns"
      namespace = "kube-system"
    }
    spec = {
      "replicas" = 3
    }
  }

  field_manager {
    fields = {
      name = "test"
    }
  }
}```

### Steps to Reproduce
1. `terragrunt import kubernetes_manifest.coredns_deployment "apiVersion=apps/v1,kind=Deployment,namespace=kube-system,name=coredns"`

### Expected Behavior
What should have happened?

The resource would be successfully imported to the state file.

### Actual Behavior
The import is failing with `Error: rpc error: code = Unavailable desc = transport is closing`
alexsomesan commented 3 years ago

@bilby91 Can you give this a try again with provider release v2.5.1? It contains a fix for importing kubernetes_manifests.

Also, could you please try doing this with Terraform CLI directly? Terragrunt is a thirdparty tool and we have no influence over its functionalities or limitations.

bilby91 commented 3 years ago

I was able to successfully import the kubernete_manifest with v2.5.1. Thanks for fixing the issue so fast.

github-actions[bot] commented 2 years ago

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. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.