Egress Gateway | Egress Gateway |
Доступно в следующих редакциях: SE+, EE, CSE Lite (1.67), CSE Pro (1.67). | This feature is available in the following editions: SE+, EE. |
Принцип работы | Operation principle |
Для настройки egress-шлюза необходимы два кастомных ресурса: | Configuring an egress gateway requires two custom resources: |
|
|
Признаки пригодного узла:
| Attributes of an eligible node:
|
Обслуживание узла | Node maintenance |
Для проведения работ на узле, который в данный момент является активным egress-шлюзом, выполните следующие шаги:
| To perform maintenance on a node that is currently the active egress gateway, follow these steps:
|
bash
kubectl label node | bash
kubectl label node |
|
|
bash
kubectl cordon | bash
kubectl cordon |
После этого Cilium автоматически выберет новый активный узел из оставшихся кандидатов. Трафик продолжит направляться через новый шлюз без прерывания. | After this, Cilium will automatically select a new active node from the remaining candidates. Traffic will continue routing through the new gateway without interruption. |
|
|
bash
kubectl uncordon | bash
kubectl uncordon |
|
|
Сравнение с CiliumEgressGatewayPolicy | Comparison with 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 в режиме PrimaryIPFromEgressGatewayNodeInterface (базовый режим) | EgressGateway in PrimaryIPFromEgressGatewayNodeInterface mode (basic mode) |
yaml apiVersion: network.deckhouse.io/v1alpha1 kind: EgressGateway metadata: name: myegressgw spec: nodeSelector: dedicated/egress: “” sourceIP: mode: PrimaryIPFromEgressGatewayNodeInterface primaryIPFromEgressGatewayNodeInterface: На всех узлах, попадающих под nodeSelector, «публичный» интерфейс должен называться одинаково. При выходе из строя активного узла, трафик будет перенаправлен через резервный и IP-адрес отправителя у сетевых пакетов поменяется. interfaceName: eth1 | 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 |
EgressGateway в режиме VirtualIPAddress (режим с Virtual IP) | EgressGateway in VirtualIPAddress mode (Virtual IP mode) |
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:
| 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:
|
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:
|