Open devdattakulkarni opened 4 years ago
I don't think so. As I understood it each worker instance hosts it's own 10.200.X.0/24 subnet for containers. Later on in the guide we set up route tables having each worker as the router for it's subnet:
for i in 0 1 2; do
gcloud compute routes create kubernetes-route-10-200-${i}-0-24 \
--network kubernetes-the-hard-way \
--next-hop-address 10.240.0.2${i} \
--destination-range 10.200.${i}.0/24
done
I'm still learning though, so if anyone knows better please correct me :)
May be you are correct. I still find the explanation in the Kubernetes Worker section bit confusing.
Specifically, two things:
I had to dig a bit, but I found a reference to the --cluster-cidr flag in a systemd file. It's used when starting the kubernetes-controller-manager service: https://github.com/kelseyhightower/kubernetes-the-hard-way/blob/master/docs/08-bootstrapping-kubernetes-controllers.md#configure-the-kubernetes-controller-manager
/16 is max 65536 subnets, but then you'd be using /31 subnets (?) which would be a bit odd. I guess what they mean here is 254 /24 subnets.
So the explanation does make sense, but could maybe be improved.
In the Kubernetes workers section https://github.com/kelseyhightower/kubernetes-the-hard-way/blob/master/docs/03-compute-resources.md#kubernetes-workers
there is following line: "The Kubernetes cluster CIDR range is defined by the Controller Manager's --cluster-cidr flag. In this tutorial the cluster CIDR range will be set to 10.200.0.0/16, which supports 254 subnets."
Should the CIDR range be: 10.200.0.0/24 ?