简体   繁体   English

在 aws 仪表板中删除了 k8s 集群,现在 terraform 出错了

[英]Deleted k8s cluster in aws dashboard and now terraform is erroring out

I created a k8s eks cluster and all of it's resources within terraform but ran into some issues and deleted the cluster through the aws UI.我在 terraform 中创建了一个 k8s eks 集群及其所有资源,但遇到了一些问题并通过 aws UI 删除了集群。 Now when I try to run terraform I'm getting this error Error: Get "http://localhost/api/v1/persistentvolumes/efs-jupyter-shared-v2": dial tcp 127.0.0.1:80: connect: connection refused for each of the resources.现在,当我尝试运行 terraform 时出现此错误Error: Get "http://localhost/api/v1/persistentvolumes/efs-jupyter-shared-v2": dial tcp 127.0.0.1:80: connect: connection refused对于每个资源。 I tried commenting out all of the resources within terraform and running, and still got the same error.我尝试注释掉 terraform 中的所有资源并运行,但仍然出现相同的错误。 Any ideas how to proceed?任何想法如何进行?

You need to clean the terraform state:您需要清洁 terraform state:

First step is listing all the resources in the state:第一步是列出 state 中的所有资源:

terraform state list

Then you can delete the resources you deleted in AWS dashboard:然后您可以删除您在 AWS 控制面板中删除的资源:

terraform state rm <resource_name>

Finally you can run your terraform code to recreate the resources.最后,您可以运行 terraform 代码来重新创建资源。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 审计 AWS 上的 k8s 集群事件 - Audit k8s cluster events on AWS 是否可以制作混合 K8S 集群 AWS / Raspberry PI - Is it possible to make a hybrid K8S cluster AWS / Raspberry PI 测试集群自动缩放和过度配置是否按预期工作 k8s AWS - Testing if Cluster Autoscaling and overprovisioners works as expected k8s AWS 在中国设置代理到gcp或aws k8s集群 - setup proxy to gcp or aws k8s cluster in china 哪种监控工具更适合在AWS for k8s集群上使用? - Which monitoring tool is better to use on AWS for k8s cluster? 我们有一个在 AWS 上运行的基于 kops 的 k8s 集群,使用 EFS 作为持久卷进行部署; 现在我们将使用 PVC 部署迁移到 EKS - We have a kops based k8s cluster running on AWS with deployments using EFS as Persistent Volume; Now we would to migrate to EKS with PVC Deployments 是否可以在本地 K8s 集群上拥有 AWS EBS 持久卷? - Is it possible to have AWS EBS persistent volumes on an on-prem K8s cluster? 如何为kops在AWS上安装的k8集群自动定标器? - How to do cluster autoscaler for k8s which installed by kops on AWS? 通过使用kops创建的AWS群集上的入口使k8s服务可用 - Make k8s services available via ingress on an AWS cluster created with kops 为什么不能在AWS EC2的k8s集群上正确部署容器? - Why can't deploy containers on k8s cluster on AWS EC2 correctly?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM