Some mistakes, IPv6 stack message

pull/582/head
Nemo 2020-06-20 16:32:00 +02:00
parent 1af4017cde
commit 7df8fc648e
3 changed files with 31 additions and 21 deletions

View File

@ -6,6 +6,10 @@ Kubernetes The Hard Way is optimized for learning, which means taking the long r
> The results of this tutorial should not be viewed as production ready, and may receive limited support from the community, but don't let that stop you from learning! > The results of this tutorial should not be viewed as production ready, and may receive limited support from the community, but don't let that stop you from learning!
## Overview of the Network Architecture
![architecture network](docs/images/architecture-network.PNG)
## Copyright ## Copyright
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a>. <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a>.
@ -26,7 +30,7 @@ Kubernetes The Hard Way guides you through bootstrapping a highly available Kube
## Labs ## Labs
This tutorial assumes you have access to a Proxmox hypervisor with at least 26GB free RAM and 100GB free HDD/SSD. While a Proxmox server is used for basic infrastructure requirements the lessons learned in this tutorial can be applied to other platforms (ESXi, KVM, VirtualBox, ...). This tutorial assumes you have access to a Proxmox hypervisor with at least 25GB free RAM and 140GB free HDD/SSD. While a Proxmox server is used for basic infrastructure requirements the lessons learned in this tutorial can be applied to other platforms (ESXi, KVM, VirtualBox, ...).
* [Prerequisites](docs/01-prerequisites.md) * [Prerequisites](docs/01-prerequisites.md)
* [Installing the Client Tools](docs/02-client-tools.md) * [Installing the Client Tools](docs/02-client-tools.md)

View File

@ -4,19 +4,19 @@
This tutorial is intended to be performed with a [Proxmox](https://proxmox.com/en/) hypervisor, but you can also use it with ESXi, KVM, Virtualbox or other hypervisor. This tutorial is intended to be performed with a [Proxmox](https://proxmox.com/en/) hypervisor, but you can also use it with ESXi, KVM, Virtualbox or other hypervisor.
> The compute resources required for this tutorial is 26GB of RAM and 100GB HDD (or SSD). > The compute resources required for this tutorial is 25GB of RAM and 140GB HDD (or SSD).
List of the VM used in this tutorial : List of the VM used in this tutorial :
|Name|Role|vCPU|RAM|Storage (thin)|IP|OS| |Name|Role|vCPU|RAM|Storage (thin)|IP|OS|
|--|--|--|--|--|--|--| |--|--|--|--|--|--|--|
|controller-0|controller|2|4GB|40GB|192.168.8.10/24|Ubuntu| |controller-0|controller|2|4GB|20GB|192.168.8.10/24|Ubuntu|
|controller-1|controller|2|4GB|40GB|192.168.8.11/24|Ubuntu| |controller-1|controller|2|4GB|20GB|192.168.8.11/24|Ubuntu|
|controller-2|controller|2|4GB|40GB|192.168.8.12/24|Ubuntu| |controller-2|controller|2|4GB|20GB|192.168.8.12/24|Ubuntu|
|worker-0|worker|2|4GB|40GB|192.168.8.20/24|Ubuntu| |worker-0|worker|2|4GB|20GB|192.168.8.20/24|Ubuntu|
|worker-1|worker|2|4GB|40GB|192.168.8.21/24|Ubuntu| |worker-1|worker|2|4GB|20GB|192.168.8.21/24|Ubuntu|
|worker-2|worker|2|4GB|40GB|192.168.8.22/24|Ubuntu| |worker-2|worker|2|4GB|20GB|192.168.8.22/24|Ubuntu|
|gateway-01|Reverse Proxy, client tools, gateway|2|4GB|40GB|192.168.8.22/24|Debian| |gateway-01|Reverse Proxy, client tools, gateway|1|1GB|20GB|192.168.8.1/24<br>+ PUBLIC IP|Debian|
On the Proxmox hypervisor, I just added the `k8s-` prefix in the VM names. On the Proxmox hypervisor, I just added the `k8s-` prefix in the VM names.
@ -49,22 +49,23 @@ This diagram represents the network design:
![architecture network](images/architecture-network.PNG) ![architecture network](images/architecture-network.PNG)
> If you want, you can define the configuration for the IPv6 stack. > If you want, you can define the IPv6 stack configuration.
### Gateway VM installation ### Gateway VM installation
> The basic VM installation process is not the purpose of this tutorial. > The basic VM installation process is not the purpose of this tutorial.
>
> Because it's just a tutorial, the IPv6 stack is not configured, but you can configure it if you want. > Because it's just a tutorial, the IPv6 stack is not configured, but you can configure it if you want.
This VM is used as a NAT gateway for the private Kubernetes network, as a reverse proxy and as a client tools. This VM is used as a NAT gateway for the private Kubernetes network, as a reverse proxy and as a client tools.
This means all the client steps like certificates generation will be done on this VM (in the next part of this tutorial). This means all the client steps like certificates generation will be done on this VM (in the next parts of this tutorial).
You have to: You have to:
* Install the latest [amd64 Debian netinst image](https://www.debian.org/CD/netinst/) on this VM. * Install the latest [amd64 Debian netinst image](https://www.debian.org/CD/netinst/) on this VM.
* Configure the network interfaces (see the network architecture). Example of `/etc/network/interfaces` file if ens18 is your public interface and ens19 is your private interface (you need to replace `PUBLIC_IP_ADDRESS`, `MASK` and `PUBLIC_IP_GATEWAY` with you values): * Configure the network interfaces (see the network architecture). Example of `/etc/network/interfaces` file if your public interface is ens18 and your private interface is ens19 (you need to replace `PUBLIC_IP_ADDRESS`, `MASK` and `PUBLIC_IP_GATEWAY` with your values):
```bash ```bash
source /etc/network/interfaces.d/* source /etc/network/interfaces.d/*
@ -89,7 +90,9 @@ iface ens19 inet static
dns-nameservers 9.9.9.9 dns-nameservers 9.9.9.9
``` ```
> If you want, you can define the configuration for the IPv6 stack. > If you want, you can define the IPv6 stack configuration.
>
> If you want, you can use another DNS resolver.
* Define the VM hostname: * Define the VM hostname:
@ -125,7 +128,7 @@ echo 'net.ipv4.ip_forward=1' >> /etc/sysctl.conf
echo '1' > /proc/sys/net/ipv4/ip_forward echo '1' > /proc/sys/net/ipv4/ip_forward
``` ```
> If you want, you can define the configuration for the IPv6 stack. > If you want, you can define the IPv6 stack configuration.
* Configure the iptables firewall (allow some ports and configure NAT). Example of `/etc/iptables/rules.v4` file if ens18 is your public interface and ens19 is your private interface: * Configure the iptables firewall (allow some ports and configure NAT). Example of `/etc/iptables/rules.v4` file if ens18 is your public interface and ens19 is your private interface:
@ -152,15 +155,15 @@ COMMIT
# Completed on Fri Jun 5 16:45:02 2020 # Completed on Fri Jun 5 16:45:02 2020
``` ```
> If you want, you can define the configuration for the IPv6 stack. > If you want, you can define the IPv6 stack configuration.
* If you want to restore iptables rules: * If you want to restore/active iptables rules:
```bash ```bash
iptables-restore < /etc/iptables/rules.v4 iptables-restore < /etc/iptables/rules.v4
``` ```
* Configure /etc/hosts file. Example for controller-0 (need to replace `PUBLIC_GW_IP`): * Configure the /etc/hosts file (you need to replace `PUBLIC_GW_IP`):
```bash ```bash
127.0.0.1 localhost 127.0.0.1 localhost
@ -189,11 +192,12 @@ sudo reboot
### Kubernetes nodes VM installation ### Kubernetes nodes VM installation
> The basic VM installation process is not the purpose of this tutorial. > The basic VM installation process is not the purpose of this tutorial.
>
> Because it's just a tutorial, the IPv6 stack is not configured, but you can configure it if you want. > Because it's just a tutorial, the IPv6 stack is not configured, but you can configure it if you want.
These VM are used as Kubernetes node (controllers or workers). These VM are used as Kubernetes node (controllers or workers).
The basic VM configuration process is the same of the 6 VM (you can also configure one, clone it and change IP address and hostname for each clone). The basic VM configuration process is the same for the 6 VM (you can also configure one, clone it and change IP address and hostname for each clone).
You have to: You have to:
@ -215,7 +219,9 @@ network:
version: 2 version: 2
``` ```
> If you want, you can define the configuration for the IPv6 stack. > If you want, you can define the IPv6 stack configuration.
>
> If you want, you can use another DNS resolver.
* Define the VM hostname (example for controller-0): * Define the VM hostname (example for controller-0):
@ -244,7 +250,7 @@ sudo systemctl enable ssh
sudo systemctl start ssh sudo systemctl start ssh
``` ```
* Configure /etc/hosts file. Example for controller-0 (need to replace `PUBLIC_GW_IP` and adapt this sample config on each VM): * Configure /etc/hosts file. Example for controller-0 (need to replace `PUBLIC_GW_IP` and adapt this sample config for each VM):
```bash ```bash
127.0.0.1 localhost 127.0.0.1 localhost
@ -268,7 +274,7 @@ PUBLIC_GW_IP gateway-01.external
192.168.8.22 worker-2 192.168.8.22 worker-2
``` ```
* To confirm the network configuration, reboot the VM and check the active IP addresses: * To confirm the network configuration, reboot the VM and check the active IP address:
```bash ```bash
sudo reboot sudo reboot

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 44 KiB