kelseyhightower / kubernetes-the-hard-way

Bootstrap Kubernetes the hard way. No scripts.
Apache License 2.0
39.73k stars 13.64k forks source link

Unknown subnet 10.200.0.0/16 causing ERROR while creating firewall rules #760

Open apoorv-chaudhary opened 4 months ago

apoorv-chaudhary commented 4 months ago

Hi, Beginner here following the guide Provisioning Compute Resources

Following the steps of creating the VPC, gcloud compute networks create kubernetes-the-hard-way --subnet-mode custom

and then creating a subnet, gcloud compute networks subnets create kubernetes \ --network kubernetes-the-hard-way \ --range 10.240.0.0/24

the step to create internal firewall rules (below) fails because there is another subnet in the source ranges: gcloud compute firewall-rules create kubernetes-the-hard-way-allow-internal \ --allow tcp,udp,icmp \ --network kubernetes-the-hard-way \ --source-ranges 10.240.0.0/24,10.200.0.0/16

The command above fails with the following message: ERROR: (gcloud.compute.firewall-rules.create) unrecognized arguments: 10.200.0.0/16] To search the help text of gcloud commands, run: gcloud help -- SEARCH_TERMS

Didn't see any other mention of the 10.200.0.0/16 subnet before this point. Not sure if I missed something.

tzujui commented 1 week ago

Hi @apoorv-chaudhary I have the same question when I walkthrough the lab. The cluster CIDR range is mentioned in an older commit of the 3rd lab. https://github.com/kelseyhightower/kubernetes-the-hard-way/commit/a9cb5f7ba50b3ed496a18a09c273941f80c6375a#diff-da1cd405cb4576bc83a993eccecff98de30acec2ba1f560c6bcb9adfb504e035L121 In the latest code, it's mentioned in the controller manager's unit file https://github.com/kelseyhightower/kubernetes-the-hard-way/commit/a9cb5f7ba50b3ed496a18a09c273941f80c6375a#diff-b3f8a18dcc3baf86b82f34f69caf1aa08e18fb6c670d798a743bc5ac05d81d58R8 In your case, I think it might be a formatting error with the \ Hope this helps!