Egress Gateway | Egress Gateway |
This feature is available in the following editions: SE+, EE. | Доступно в следующих редакциях: SE+, EE, CSE Lite (1.67), CSE Pro (1.67). |
Operation principle | Принцип работы |
Configuring an egress gateway requires two custom resources: | Для настройки egress-шлюза необходимы два кастомных ресурса: |
|
|
Attributes of an eligible node:
| Признаки пригодного узла:
|
Node maintenance | Обслуживание узла |
To perform maintenance on a node that is currently the active egress gateway, follow these steps:
| Для проведения работ на узле, который в данный момент является активным egress-шлюзом, выполните следующие шаги:
|
bash
kubectl label node | bash
kubectl label node |
|
|
bash
kubectl cordon | bash
kubectl cordon |
After this, Cilium will automatically select a new active node from the remaining candidates. Traffic will continue routing through the new gateway without interruption. | После этого Cilium автоматически выберет новый активный узел из оставшихся кандидатов. Трафик продолжит направляться через новый шлюз без прерывания. |
|
|
bash
kubectl uncordon | bash
kubectl uncordon |
|
|
Comparison with CiliumEgressGatewayPolicy | Сравнение с CiliumEgressGatewayPolicy |
The CiliumEgressGatewayPolicy implies configuring only one node as an egress gateway. If it fails, there are no failover mechanisms and the network connection will be broken. |
|
Configuration examples | Примеры настроек |
EgressGateway in PrimaryIPFromEgressGatewayNodeInterface mode (basic mode) | EgressGateway в режиме PrimaryIPFromEgressGatewayNodeInterface (базовый режим) |
yaml apiVersion: network.deckhouse.io/v1alpha1 kind: EgressGateway metadata: name: my-egressgw spec: nodeSelector: dedicated/egress: “” sourceIP: mode: PrimaryIPFromEgressGatewayNodeInterface primaryIPFromEgressGatewayNodeInterface: The “public” interface must have the same name on all nodes that matching the nodeSelector. If the active node fails, traffic will be redirected through the backup node and the source IP address of the network packets will change. interfaceName: eth1 | yaml apiVersion: network.deckhouse.io/v1alpha1 kind: EgressGateway metadata: name: myegressgw spec: nodeSelector: dedicated/egress: “” sourceIP: mode: PrimaryIPFromEgressGatewayNodeInterface primaryIPFromEgressGatewayNodeInterface: На всех узлах, попадающих под nodeSelector, «публичный» интерфейс должен называться одинаково. При выходе из строя активного узла, трафик будет перенаправлен через резервный и IP-адрес отправителя у сетевых пакетов поменяется. interfaceName: eth1 |
EgressGateway in VirtualIPAddress mode (Virtual IP mode) | EgressGateway в режиме VirtualIPAddress (режим с Virtual IP) |
yaml apiVersion: network.deckhouse.io/v1alpha1 kind: EgressGateway metadata: name: my-egressgw spec: nodeSelector: dedicated/egress: “” sourceIP: mode: VirtualIPAddress virtualIPAddress: Each node must have all the necessary routes configured to access all external public services, the “public” interface must be prepared for automatic configuration of the “virtual” IP as a secondary IP address. In case of failure of the active node, traffic will be redirected through the backup node and the source IP address of the network packets will not change. ip: 172.18.18.242 List of network interfaces for Virtual IP interfaces:
| yaml apiVersion: network.deckhouse.io/v1alpha1 kind: EgressGateway metadata: name: myeg spec: nodeSelector: dedicated/egress: “” sourceIP: mode: VirtualIPAddress virtualIPAddress: На каждом узле должны быть настроены все необходимые маршруты для доступа на все внешние публичные сервисы, «публичный» интерфейс должен быть подготовлен к автоматической настройке «виртуального» IP в качестве дополнительного (secondary) IP-адреса. При выходе из строя активного узла, трафик будет перенаправлен через резервный и IP-адрес отправителя у сетевых пакетов не поменяется. ip: 172.18.18.242 Список сетевых интерфейсов для «виртуального» IP. interfaces:
|
EgressGatewayPolicy | EgressGatewayPolicy |
yaml apiVersion: network.deckhouse.io/v1alpha1 kind: EgressGatewayPolicy metadata: name: my-egressgw-policy spec: destinationCIDRs:
| yaml apiVersion: network.deckhouse.io/v1alpha1 kind: EgressGatewayPolicy metadata: name: my-egressgw-policy spec: destinationCIDRs:
|