Change the root system (classical instead of GCP)
parent
0272261ad7
commit
61328abb63
|
@ -8,53 +8,31 @@ In this lab you will create a route for each worker node that maps the node's Po
|
|||
|
||||
## The Routing Table
|
||||
|
||||
In this section you will gather the information required to create routes in the `kubernetes-the-hard-way` VPC network.
|
||||
|
||||
Print the internal IP address and Pod CIDR range for each worker instance:
|
||||
**On each worker node**, add the following routes:
|
||||
|
||||
```bash
|
||||
for instance in worker-0 worker-1 worker-2; do
|
||||
gcloud compute instances describe ${instance} \
|
||||
--format 'value[separator=" "](networkInterfaces[0].networkIP,metadata.items[0].value)'
|
||||
done
|
||||
ip route add 10.200.0.0/24 via 192.168.8.20
|
||||
ip route add 10.200.1.0/24 via 192.168.8.21
|
||||
ip route add 10.200.2.0/24 via 192.168.8.22
|
||||
```
|
||||
|
||||
> output
|
||||
|
||||
```bash
|
||||
10.240.0.20 10.200.0.0/24
|
||||
10.240.0.21 10.200.1.0/24
|
||||
10.240.0.22 10.200.2.0/24
|
||||
```
|
||||
|
||||
## Routes
|
||||
|
||||
Create network routes for each worker instance:
|
||||
|
||||
```bash
|
||||
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
|
||||
```
|
||||
> Don't take care of the `RTNETLINK answers: File exists` message, it appears just when you try to add an existing route, not a real problem.
|
||||
|
||||
List the routes in the `kubernetes-the-hard-way` VPC network:
|
||||
|
||||
```bash
|
||||
gcloud compute routes list --filter "network: kubernetes-the-hard-way"
|
||||
ip route
|
||||
```
|
||||
|
||||
> output
|
||||
> Output:
|
||||
|
||||
```bash
|
||||
NAME NETWORK DEST_RANGE NEXT_HOP PRIORITY
|
||||
default-route-081879136902de56 kubernetes-the-hard-way 10.240.0.0/24 kubernetes-the-hard-way 1000
|
||||
default-route-55199a5aa126d7aa kubernetes-the-hard-way 0.0.0.0/0 default-internet-gateway 1000
|
||||
kubernetes-route-10-200-0-0-24 kubernetes-the-hard-way 10.200.0.0/24 10.240.0.20 1000
|
||||
kubernetes-route-10-200-1-0-24 kubernetes-the-hard-way 10.200.1.0/24 10.240.0.21 1000
|
||||
kubernetes-route-10-200-2-0-24 kubernetes-the-hard-way 10.200.2.0/24 10.240.0.22 1000
|
||||
default via 192.168.8.1 dev ens18 proto static
|
||||
10.200.0.0/24 dev cnio0 proto kernel scope link src 10.200.0.1 linkdown
|
||||
10.200.0.0/24 via 192.168.8.20 dev ens18
|
||||
10.200.1.0/24 via 192.168.8.21 dev ens18
|
||||
10.200.2.0/24 via 192.168.8.22 dev ens18
|
||||
192.168.8.0/24 dev ens18 proto kernel scope link src 192.168.8.21
|
||||
```
|
||||
|
||||
Next: [Deploying the DNS Cluster Add-on](12-dns-addon.md)
|
||||
|
|
Loading…
Reference in New Issue