Unable to delete a subnet I created in GCP
Assuming the VMs have been deleted the only way is to use command line to delete the Internal Reserved IP addresses.
Open Cloud Shell and connect it to the correct project then run the highlighted commands:
user123@cloudshell:~ (cellular-project-258333)$ gcloud compute addresses list
NAME ADDRESS/RANGE TYPE PURPOSE NETWORK REGION SUBNET STATUS
k8s-worker-1 10.175.0.4 INTERNAL GCE_ENDPOINT us-central1 k8s-subnet RESERVED
k8s-worker-2 10.175.0.5 INTERNAL GCE_ENDPOINT us-central1 k8s-subnet RESERVED
k8s-worker-3 10.175.0.6 INTERNAL GCE_ENDPOINT us-central1 k8s-subnet RESERVED
user123@cloudshell:~ (cellular-project-258333)$cloud compute addresses delete k8s-worker-1 k8s-worker-2 k8s-worker-3 --region us-central1
The following addresses will be deleted:
- [k8s-worker-1] in [us-central1]
- [k8s-worker-2] in [us-central1]
- [k8s-worker-3] in [us-central1]
Do you want to continue (Y/n)? Y
Deleted [https://www.googleapis.com/compute/v1/projects/cellular-project-258333/regions/us-central1/addresses/k8s-worker-1].
Deleted [https://www.googleapis.com/compute/v1/projects/cellular-project-258333/regions/us-central1/addresses/k8s-worker-2].
Deleted [https://www.googleapis.com/compute/v1/projects/cellular-project-258333/regions/us-central1/addresses/k8s-worker-3].
Now the network resources such as subnets and VPCs can be deleted.