使用gcloud容器集群创建的GKE集群创建后如何清理? [英] How to clean up after a GKE cluster created with gcloud container clusters create?
问题描述
我正在以编程方式创建Kubernetes集群,以在GitLab CI/CD中进行端到端测试.我正在使用gcloud container clusters create
.我做了半年,创建并删除了几百个群集.成本上升和下降.现在,我从Google那里收到了一笔异常高的账单,并检查了费用明细.我注意到存储PD容量"的成本> 95%.我发现gcloud container clusters delete
从未删除Kubernetes集群中为持久卷声明创建的Google Compute Disk.
I'm creating Kubernetes clusters programmatically for end-to-end tests in GitLab CI/CD. I'm using gcloud container clusters create
. I'm doing this for half a year and created and deleted a few hundred clusters. The cost went up and down. Now, I got an unusually high bill from Google and I checked the cost breakdown. I noticed that the cost is >95% for "Storage PD Capacity". I found out that gcloud container clusters delete
never deleted the Google Compute Disks created for Persistent Volume Claims in the Kubernetes cluster.
如何以编程方式删除这些内容?删除Kubernetes集群和磁盘后,还有什么可以继续运行?
How can I delete those programmatically? What else could be left running after deleting the Kubernetes cluster and the disks?
推荐答案
建议:
-
要回答您的紧迫问题:您可以使用要确定可能还分配了哪些其他资源,请查看此处:
To determine what other resources might have been allocated, look here: Listing all Resources in your Hierarchy.
Finally, this link might also help: GKE: Understanding cluster resource usage
这篇关于使用gcloud容器集群创建的GKE集群创建后如何清理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!