Change the root system (classical instead of GCP)

pull/582/head
Nemo 2020-06-20 15:44:45 +02:00
parent 0272261ad7
commit 61328abb63
1 changed files with 13 additions and 35 deletions

View File

@ -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 ## The Routing Table
In this section you will gather the information required to create routes in the `kubernetes-the-hard-way` VPC network. **On each worker node**, add the following routes:
Print the internal IP address and Pod CIDR range for each worker instance:
```bash ```bash
for instance in worker-0 worker-1 worker-2; do ip route add 10.200.0.0/24 via 192.168.8.20
gcloud compute instances describe ${instance} \ ip route add 10.200.1.0/24 via 192.168.8.21
--format 'value[separator=" "](networkInterfaces[0].networkIP,metadata.items[0].value)' ip route add 10.200.2.0/24 via 192.168.8.22
done
``` ```
> output > 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.
```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
```
List the routes in the `kubernetes-the-hard-way` VPC network: List the routes in the `kubernetes-the-hard-way` VPC network:
```bash ```bash
gcloud compute routes list --filter "network: kubernetes-the-hard-way" ip route
``` ```
> output > Output:
```bash ```bash
NAME NETWORK DEST_RANGE NEXT_HOP PRIORITY default via 192.168.8.1 dev ens18 proto static
default-route-081879136902de56 kubernetes-the-hard-way 10.240.0.0/24 kubernetes-the-hard-way 1000 10.200.0.0/24 dev cnio0 proto kernel scope link src 10.200.0.1 linkdown
default-route-55199a5aa126d7aa kubernetes-the-hard-way 0.0.0.0/0 default-internet-gateway 1000 10.200.0.0/24 via 192.168.8.20 dev ens18
kubernetes-route-10-200-0-0-24 kubernetes-the-hard-way 10.200.0.0/24 10.240.0.20 1000 10.200.1.0/24 via 192.168.8.21 dev ens18
kubernetes-route-10-200-1-0-24 kubernetes-the-hard-way 10.200.1.0/24 10.240.0.21 1000 10.200.2.0/24 via 192.168.8.22 dev ens18
kubernetes-route-10-200-2-0-24 kubernetes-the-hard-way 10.200.2.0/24 10.240.0.22 1000 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) Next: [Deploying the DNS Cluster Add-on](12-dns-addon.md)