mirror of
https://github.com/kelseyhightower/kubernetes-the-hard-way.git
synced 2025-12-18 02:38:58 +03:00
chg: Hostnames In Documentation Continued
Updated more references to old hostnames in the documentation to reflect the new naming convention.
This commit is contained in:
@@ -1,20 +1,23 @@
|
||||
# Provisioning Pod Network Routes
|
||||
|
||||
Pods scheduled to a node receive an IP address from the node's Pod CIDR range. At this point pods can not communicate with other pods running on different nodes due to missing network [routes](https://cloud.google.com/compute/docs/vpc/routes).
|
||||
Pods scheduled to a node receive an IP address from the node's Pod CIDR range.
|
||||
At this point pods can not communicate with other pods running on different
|
||||
nodes due to missing network [routes].
|
||||
|
||||
In this lab you will create a route for each worker node that maps the node's Pod CIDR range to the node's internal IP address.
|
||||
In this lab you will create a route for each worker node that maps the node's
|
||||
Pod CIDR range to the node's internal IP address.
|
||||
|
||||
> There are [other ways](https://kubernetes.io/docs/concepts/cluster-administration/networking/#how-to-achieve-this) to implement the Kubernetes networking model.
|
||||
> There are [other ways] to implement the Kubernetes networking model.
|
||||
|
||||
## The Routing Table
|
||||
|
||||
In this section you will gather the information required to create routes in the `kubernetes-the-hard-way` VPC network.
|
||||
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:
|
||||
|
||||
```bash
|
||||
{
|
||||
SERVER_IP=$(grep server machines.txt | cut -d " " -f 1)
|
||||
NODE_0_IP=$(grep node01 machines.txt | cut -d " " -f 1)
|
||||
NODE_0_SUBNET=$(grep node01 machines.txt | cut -d " " -f 4)
|
||||
NODE_1_IP=$(grep node02 machines.txt | cut -d " " -f 1)
|
||||
@@ -23,7 +26,7 @@ Print the internal IP address and Pod CIDR range for each worker instance:
|
||||
```
|
||||
|
||||
```bash
|
||||
ssh root@server <<EOF
|
||||
ssh root@controlplane <<EOF
|
||||
ip route add ${NODE_0_SUBNET} via ${NODE_0_IP}
|
||||
ip route add ${NODE_1_SUBNET} via ${NODE_1_IP}
|
||||
EOF
|
||||
@@ -44,7 +47,7 @@ EOF
|
||||
## Verification
|
||||
|
||||
```bash
|
||||
ssh root@server ip route
|
||||
ssh root@controlplane ip route
|
||||
```
|
||||
|
||||
```text
|
||||
@@ -74,5 +77,9 @@ default via XXX.XXX.XXX.XXX dev ens160
|
||||
XXX.XXX.XXX.0/24 dev ens160 proto kernel scope link src XXX.XXX.XXX.XXX
|
||||
```
|
||||
|
||||
|
||||
Next: [Smoke Test](12-smoke-test.md)
|
||||
|
||||
---
|
||||
|
||||
[routes]: https://cloud.google.com/compute/docs/vpc/routes
|
||||
[other ways]: https://kubernetes.io/docs/concepts/cluster-administration/networking/#how-to-achieve-this
|
||||
Reference in New Issue
Block a user