当前位置: 首页 > 文档资料 > Kubernetes 指南 >

4.3 Kubernetes-The-Hard-Way - 删除集群

优质
小牛编辑
129浏览
2023-12-01

本部分将删除该教程所创建的全部计算资源。

计算节点

删除所有的控制节点和 worker 节点:

  1. gcloud -q compute instances delete
  2. controller-0 controller-1 controller-2
  3. worker-0 worker-1 worker-2

网路

删除外部负载均衡器以及网络资源:

  1. gcloud -q compute forwarding-rules delete kubernetes-forwarding-rule
  2. --region $(gcloud config get-value compute/region)
  3. gcloud -q compute target-pools delete kubernetes-target-pool

删除 kubernetes-the-hard-way 静态 IP 地址:

  1. gcloud -q compute addresses delete kubernetes-the-hard-way

删除 kubernetes-the-hard-way 防火墙规则:

  1. gcloud -q compute firewall-rules delete
  2. kubernetes-the-hard-way-allow-nginx-service
  3. kubernetes-the-hard-way-allow-internal
  4. kubernetes-the-hard-way-allow-external

删除 Pod 网络路由:

  1. gcloud -q compute routes delete
  2. kubernetes-route-10-200-0-0-24
  3. kubernetes-route-10-200-1-0-24
  4. kubernetes-route-10-200-2-0-24

删除 kubernetes 子网:

  1. gcloud -q compute networks subnets delete kubernetes

删除 kubernetes-the-hard-way 网络 VPC:

  1. gcloud -q compute networks delete kubernetes-the-hard-way