Skip to main content

Additional external network configuration

This guide explains how to add additional external networks to Kube-DC alongside the default cloud network.

For a new installation, first use Choose an installation network layout. It covers the TUI choices, per-server interfaces, address reservations, and the separate platform ingress decision.

Overview​

The configuration demonstrates how to add a second external network (public) to an existing Kube-DC setup that already has a cloud external network, using multiple VLANs on a single physical interface per node.

Network types explained by example​

Cloud network (egressNetworkType: cloud)​

  • Purpose: Default external network for most workloads
  • Subnet: ext-cloud (100.65.0.0/16) on VLAN 200
  • Use Cases:
    • General internet access for applications
    • Standard egress traffic from project workloads
    • Cost-effective external connectivity
  • IP Pool: Large address space (65,000+ IPs available)

Public network (egressNetworkType: public)​

  • Purpose: Premium external network for specialized workloads

  • Subnet: ext-public (192.0.2.0/28) on VLAN 300

  • Use Cases:

    • Production services requiring dedicated public IPs
    • Load balancers and ingress controllers
    • Services needing specific public IP ranges or routing
  • IP Pool: Limited address space with public IPv4 addresses (16 IPs total)

Architecture​

Cloud and public external network exampleA physical bonded interface named bond0 carries two example external network segments. VLAN 200 provides the ext-cloud ProviderNetwork and subnet 100.65.0.0/16. VLAN 300 provides the ext-public ProviderNetwork and subnet 192.0.2.0/28. Eligible nodes attach the configured segments to OVS; untagged and other physical layouts are also supported when configured explicitly.Physical interfacebond0 · carrierCloud networkVLAN 200100.65.0.0/16 · ext-cloudPublic networkVLAN 300192.0.2.0/28 · ext-public
The sample uses one bonded carrier with two tagged provider segments; VLAN IDs, CIDRs, and the bond name are installation examples rather than universal requirements.

Routed / L3-only datacenters: the external networks above are L2 segments, tagged or untagged. EXT_NET_VLAN_ID=0 is supported when the carrier NIC is the segment). Tenant EIP/FIP reachability is ARP-based and needs that L2 adjacency. The platform ingress VIPs announced by MetalLB can alternatively be advertised over BGP (--ingress-address-layer=metallb-bgp) for fabrics with no shared L2. See the installation guide's "BGP mode" section.

The egress gateway must answer ARP. EXT_NET_GATEWAY (the tenant internet next-hop on the ext network) has to be a live L2 neighbour that replies to ARP on the ext interface. An address that is only inside the ext CIDR but silent on ARP produces a clean install with black-holed tenant egress (pods route out, get no return path). kube-dc bootstrap init now arpings the gateway from the node before CNI and prints a warning if it is unreachable, but the check is advisory (fail-open); verify by hand on any node once the ext interface is up:

arping -c2 -I <ext-iface> "$EXT_NET_GATEWAY" # for example, arping -c2 -I bond0.200 192.0.2.1

A node whose own anchor IP is the gateway (node-egress topology) needs no ARP reply and is skipped by the probe.

Example cluster usage​

  • demo-cloud project: Uses egressNetworkType: cloud → EIP: 100.65.0.102 (development/testing)
  • demo-public project: Uses egressNetworkType: public → EIP: 192.0.2.6 (development with public access)
  • demo-envoy project: Uses egressNetworkType: public → EIPs: 192.0.2.7, 192.0.2.8 (production load balancer)

Choose the right network​

Use Cloud Network when:

  • Need basic internet connectivity
  • Don't require specific public IP ranges

Use Public Network when:

  • Need dedicated public IP addresses
  • Have specific routing or compliance requirements
  • Running load balancers or ingress controllers

OVS/OVN resources generated​

1. OVS bridge configuration​

With the physical NIC already configured as a VLAN trunk, Kube-OVN creates the following host OVS resources from the fleet manifests:

Bridge: br-ext-cloud

  • Physical interface bond0 attached with VLAN trunking
  • Trunk VLANs: [0, 300, 200]
  • Patch ports for both external networks:
    • patch-localnet.ext-cloud-to-br-int ↔ patch-br-int-to-localnet.ext-cloud
    • patch-localnet.ext-public-to-br-int ↔ patch-br-int-to-localnet.ext-public

2. OVN logical switches​

Two logical switches are created automatically:

  • ext-cloud (for VLAN 200)
  • ext-public (for VLAN 300)

3. ProviderNetwork status​

The existing ProviderNetwork ext-cloud is updated to include both VLANs:

status:
vlans: ["vlan200", "vlan300"]
ready: true
readyNodes:
- kube-dc-master-1
- kube-dc-worker-1

Configuration steps​

For a greenfield install, supply these values to kube-dc bootstrap init; the CLI writes the ProviderNetwork patch, public-network Flux layer, and (when the L2 VIP is in the public CIDR) anchor contract. The raw kubectl flow below is a day-2 fallback for an older overlay and must be committed back into the fleet to avoid GitOps drift.

1. Apply VLAN configuration​

kubectl apply -f examples/networking/additional-external-network.yaml

2. Verify configuration​

# Check ProviderNetwork VLANs
kubectl get provider-network ext-cloud -o jsonpath='{.status.vlans}'
# Expected output: ["vlan200","vlan300"]

# Check external subnets
kubectl get subnets ext-cloud ext-public
# Expected: ext-cloud (100.65.0.0/16) and ext-public (192.0.2.0/28)

# Check EIP assignments
kubectl get eips -A
# Shows which projects are using which external networks

# Check OVS bridge configuration
kubectl exec -n kube-system [ovs-pod] -- ovs-vsctl show | grep -A 10 "br-ext-cloud"

# Check OVN logical switches
kubectl exec -n kube-system [ovn-central-pod] -- ovn-nbctl ls-list | grep ext

3. Test with Project​

Create projects to test both network types:

Project using Cloud Network:

apiVersion: kube-dc.com/v1
kind: Project
metadata:
name: test-project-cloud
namespace: test-org
spec:
cidrBlock: 10.200.0.0/24
egressNetworkType: cloud # Uses ext-cloud subnet (100.65.0.0/16)

Project using Public Network:

apiVersion: kube-dc.com/v1
kind: Project
metadata:
name: test-project-public
namespace: test-org
spec:
cidrBlock: 10.201.0.0/24
egressNetworkType: public # Uses ext-public subnet (192.0.2.0/28)

Public-VLAN addressing contract (MetalLB L2 ingress VIP)​

When the platform ingress VIP lives on the routed public VLAN (--preset cloud+public-vlan, --ingress-address-layer=metallb-l2), the public CIDR is partitioned by a fixed contract. Example for a /28 (EXT_PUBLIC_CIDR=192.0.2.0/28):

AddressRole
192.0.2.1Public VLAN gateway (EXT_PUBLIC_GATEWAY)
192.0.2.2MetalLB floating ingress VIP (METALLB_FLOATING_IP)
192.0.2.3-.5Per-node anchor addresses, one for each gateway node (EXT_NET_PUBLIC_ANCHOR_IPS)
192.0.2.6-.14Tenant pool: public EIPs and per-project VPC router ports (LRPs)

The current kube-dc bootstrap init derives the anchors (VIP+1, VIP+2, …) and writes EXT_PUBLIC_EXCLUDE_IPS_1/2 so gateway + VIP + anchors are reserved in kube-ovn IPAM. Three rules are load-bearing:

  1. Anchors must hold addresses. MetalLB's ARP responder needs no address, so an address-less announcement looks alive. ARP resolves and TCP connects, but the reply routes out the node's default (management VLAN), asymmetric through the datacenter's stateful firewall, which drops it. Clients see accept-then-timeout. The fleet's ext-net-bridge-tag DaemonSet binds each node's anchor and a policy route (from <VIP> lookup 129, default through the public gateway) continuously, so the setting survives reboots and kube-ovn bridge recreation. The shared L2Advertisement selects the same ovn.kubernetes.io/external-gw=true nodes. This selector is load-bearing: MetalLB's interfaces field filters interfaces but does not constrain leader election, so an unanchored worker must not be eligible.
  2. Reserve before the first tenant. kube-ovn honors excludeIps for new allocations only. An EIP or a VPC router port that grabbed an address before the exclusion keeps it, and the host and OVN then both answer ARP for one IP on one segment. If an anchor IP ever resolves to two MACs, audit kubectl get ovn-eip -o wide for a pre-exclusion allocation and re-home it (detach/re-attach the VPC's external subnet; fresh allocations honor the exclusion).
  3. Test the VIP with SNI, from off the node. curl https://<VIP>/ gets a TCP handshake and then an Envoy reset (no SNI filter-chain match), which you cannot tell apart from a broken VIP. Use curl --resolve console.<domain>:443:<VIP> https://console.<domain>/. And never test from a cluster node: kube-proxy intercepts LoadBalancer IPs in the OUTPUT path, so node-originated probes never reach the wire.

Gateway MTU (oversized packets from outside)​

Tenant pods and VMs run a smaller MTU than the external networks (kube-ovn derives it from the underlay, for example 1400). Without a gateway MTU, OVN routes a 1500-byte packet from the Internet into the overlay, where it is dropped without an ICMP reply, so senders never learn the smaller path MTU. UDP datagrams above the overlay limit are lost and TCP depends on the endpoints' MSS.

Set manager.ovnGatewayMTU to the tenant pod MTU of the installation:

manager:
ovnGatewayMTU: "1400"

The manager then sets OVN options:gateway_mtu on every Project router's gateway ports. It checks them again every five minutes, so Projects created later also get the option. OVN answers a larger packet entering through the gateway with ICMP "fragmentation needed" carrying that MTU. Use exactly the pod MTU: a lower value makes working flows depend on ICMP. Find it with ip link show eth0 in any tenant pod. Empty (the default) leaves the option unset and removes a value set earlier.

ARP flooding on the external switches​

EIPs, Floating IPs and NAT external IPs belong to the Project routers. The upstream gateway finds them by broadcasting ARP on the external VLAN, and OVN hands each such request to the router that owns the address. kube-ovn v1.15.28 to v1.15.30 and v1.16.7 to v1.16.9 ship an OVN patch that, while the OVN option bcast_arp_nd_req_flood (bcast_arp_req_flood in v1.15.28 and v1.16.7) is unset, skips that hand-off on every switch with a localnet port. The external addresses then stop answering ARP: inbound traffic to EIPs and Floating IPs fails, and so does the return traffic for SNAT egress. kube-ovn fixed this later (v1.16.10 and later, and the release-1.15 branch after v1.15.30).

The manager keeps both option names at manager.ovnBcastArpNdReqFlood:

manager:
ovnBcastArpNdReqFlood: "true" # default

"true" restores the behaviour of kube-ovn v1.15.26 and v1.15.27: the router that owns the address gets the request, and other broadcast ARP still goes to the localnet. kube-ovn versions without the patch ignore the option, so leave the default in place before, during and after a kube-ovn upgrade. "false" sets the upstream default explicitly. Use it only on a kube-ovn that carries the fix, and only after checking ARP from outside. "" leaves the option to the operator. A manager running on a chart that predates the setting treats it as "true". The manager writes the option within a minute of starting and re-checks it every five minutes after that.

Check the current value and the flows on a cluster:

kubectl -n kube-system exec deploy/ovn-central -c ovn-central -- \
ovn-nbctl --no-leader-only --if-exists get nb_global . options:bcast_arp_nd_req_flood
# With the flooding off, this lists a priority-90 flow ending in "action=(next;)":
kubectl -n kube-system exec deploy/ovn-central -c ovn-central -- \
ovn-sbctl --no-leader-only lflow-list ext-public | grep -E 'priority=90 .*match=\(\(?eth.bcast && arp.op == 1'

After any kube-ovn upgrade, run arping from a host on the external VLAN against a Floating IP and a LoadBalancer EIP. Tests from inside the cluster do not use the gateway's ARP, so they miss this failure.

Key points​

  1. Single ProviderNetwork: Use one ProviderNetwork per physical interface with multiple VLANs attached
  2. Automatic Configuration: OVS bridges, patch ports, and OVN logical switches are created automatically
  3. VLAN Trunking: The physical interface supports multiple VLANs simultaneously
  4. GitOps-owned host state: Kube-OVN and the ext-net-bridge-tag DaemonSet own the host OVS ports; the operator still owns the physical switch trunk and upstream routing

Before you begin​

  • Physical network infrastructure supporting VLAN trunking
  • vSwitch configured with appropriate VLAN IDs

Troubleshooting​

Check the VLAN is trunked into OVS on the nodes​

The OVS provider bridge carries the public VLAN. Do not expect a Linux bond0.300 sub-interface to exist (kube-ovn attaches the trunk NIC to br-ext-cloud and tags in OVS). Check the bridge and, on public-L2 clusters, the anchor interface the fleet creates:

# On cluster nodes
sudo ovs-vsctl show | grep -A6 br-ext-cloud # trunk NIC + patch ports present
ip -br link show ext-pub-anchor # public L2 anchor (EXT_NET_PUBLIC_ANCHOR_INTERFACE)

Check OVN resources​

# Check OVN-EIP resources
kubectl get ovn-eip | grep ext-public

# Check subnet status
kubectl get subnet ext-public -o yaml

Test connectivity​

# Test from pod
kubectl exec -n [namespace] [pod] -- wget -qO- http://httpbin.org/ip

Qualify client source restrictions​

To qualify client source restrictions for direct LoadBalancer Services, shared Gateway routes, and Floating IPs, follow Qualify exposure source policies. That page covers the chart controls, tenant route and certificate policies, the acceptance steps, address-pool headroom, and rollback. The sections here cover the shared Gateway and Floating IP behavior that the acceptance depends on.

Verify Gateway transport and ingress maintenance​

Test fresh allowed-client TLS connections and the first application response on every ingress node. A successful handshake followed by a read timeout is an availability failure. Use valid CA/SNI controls when testing client-certificate rejection; do not count an application read timeout as source denial.

For host-network Envoy reaching Service addresses through loopback and an OVN overlay, verify the upstream TCP maximum segment size (MSS) fits the actual path MTU. If the node advertises a loopback-sized MSS before Service DNAT, qualify an installation-specific Envoy upstream TCP socket setting. Verify the bootstrap and active cluster configuration on every serving replica, and inspect fresh upstream SYNs. An MSS value qualified on one installation does not qualify another installation or UDP fragmentation.

Verify which physical nodes the public frontdoor reaches during rolling ingress maintenance. Multiple ready Envoy replicas and maxUnavailable: 1 do not ensure continuous service when the public address targets one node and traffic requires a local endpoint. Measure existing endpoint availability through rotation and verify recovery before claiming high availability.

Preserve shared Gateway hostname ownership​

Once hostname claims are authoritative on the installation, each hostname is owned by one cluster-scoped HostnameClaim; see Hostname claims. The reservation ledger below decides only until then.

Service-generated HTTP, HTTPS, and TLS passthrough share an atomic hostname reservation ledger on the platform Gateway. Records bind namespace, Service name, and Service UID. Resource-version updates serialize exact and wildcard overlap checks across controller replicas. Reservations survive certificate and policy waits, route withdrawal, source-list transitions, and controller restarts.

The controller imports existing UID-proven publications before withdrawing them. A protected Service marker also discovers cancellation before the first route exists. Cleanup releases a reservation after fresh owned-route and listener absence; orphan cleanup uses exact UID ownership and UID/resource-version delete preconditions. It never transfers a claim to a same-name replacement Service.

A conflicting Gateway hostname produces a GatewayHostnameConflict Service event and a fixed 10-second retry. After another owner releases its claim, waiting Services can retry without the controller's increasing error backoff. Unknown API, ledger, or cleanup failures remain errors. During a hostname edit, a previously published route can retain its old hostname and UID-bound claim while the requested hostname is unavailable. This does not publish the conflicting name. Source tightening still withdraws unsafe forwarding before the retry.

Keep tenant Gateway metadata writes denied. Deploy the reservation-aware binary on every leader-capable controller and serving webhook replica before qualifying concurrent ownership. Trusted native route producers remain outside this Service-reservation guarantee and require separate ownership review. Malformed records and annotation growth above 240 KiB stop new claims; source tightening still withdraws unsafe forwarding. Do not manually remove ownership records to resolve a conflict. Remove obsolete exposure through the Service lifecycle and verify withdrawal. A downgrade to a binary without this ledger requires separate hostname-ownership qualification.

Dead HTTPS listener cleanup​

Service reconciles start a sweep of the platform Gateway at most once every 30 minutes. The sweep looks at generated HTTPS listeners: listeners named https-<service>-<namespace> whose certificate reference is in that namespace. It removes a listener only when it can prove that the controller wrote it:

  • the Gateway carries the controller's network.kube-dc.com/listener-owner-* annotation for that Service; or
  • the Gateway's managedFields show the field manager manager as the only writer of that listener entry.

A listener with that proof goes in these cases:

  • Namespace or Service gone: removed on the first sweep.
  • Service still exists: removed when two sweeps at least 15 minutes apart agree that the Service no longer requests HTTPS for the listener's hostname, or that the listener belongs to an earlier Service with the same name. This covers removed exposure annotations, a change to HTTP or TLS passthrough, a Service type the Gateway does not serve, and a changed route hostname. The listener stays while the Service's own HTTPRoute still attaches to it, for example while a new hostname waits for its certificate. The sweep keeps its observations in memory, so a manager restart starts the 15-minute window again.

A listener stays if another Service holds a hostname reservation that overlaps its hostname. A listener that looks generated and dead but lacks the ownership proof also stays. The controller logs it as Gateway listener looks dead but nothing proves the controller wrote it. Check it and remove it by hand.

When the Service no longer requests HTTPS at all, the sweep first deletes the Certificate and ReferenceGrant that the controller created for that Service UID. It never deletes TLS Secrets. If that cleanup fails, the listener stays and the next sweep tries again. Removal re-checks each listener against fresh reads, under the same per-Service lock that the Service's own route reconcile takes. If a read fails during that check, the listener stays.

Plan shared Gateway listener capacity​

The Gateway API allows at most 64 listeners on one Gateway and 64 in one ListenerSet. HTTPS exposures and restricted TLS passthrough need a listener each; HTTP and unrestricted TLS passthrough share the platform's listeners. What this means for tenants depends on the installation's listener placement (see Where tenant hostnames get their listener):

  • With listenerPlacement: gateway, platform listeners and every tenant's HTTPS and restricted TLS listeners share the 64 listeners of Gateway eg.
  • With listenerPlacement: listenerset, the listeners of organizations placed in sets go into tenant ListenerSets, and the manager adds a set when one is full. Those tenants are bounded by their organization's custom hostname limit once hostname claims are authoritative, not by the Gateway. An organization not yet migrated still takes Gateway listeners. Keep the Gateway itself and the fleet-owned platform set below 64.

The controller checks capacity on every optimistic update retry. When no listener is free, the exposure is not rejected and never falls back to unrestricted forwarding: the Service waits with route state Waiting, reason ListenerSlot, and is retried every minute. A full Gateway also gives the Service a GatewayListenerCapacityExhausted event and fires KubeDcGatewayListenerCapacityExhausted. KubeDcGatewayListenerSlotsHigh warns at 80% of the Gateway or a fleet-owned set; tenant sets are left out.

Existing owned listeners can be edited at capacity. A change to restricted TLS withdraws the open route first and then waits like a new exposure. A change from HTTP to HTTPS keeps the HTTP route serving until the certificate and the new listener are ready, then switches the route. Metadata updates, certificate renewal and exposure removal do not need another slot. Remove unused exposure through its owning Service and verify listener cleanup. Do not manually delete active listeners or their ownership annotations to free capacity. Do not fill the shared live Gateway to test exhaustion.

Qualify Floating IP restrictions​

Floating IP enforcement needs router-port ACL support and verified NAT and chassis convergence.

For a bounded FIP qualification, set manager.fipSourcePolicy.namespaceUIDs to an object mapping each qualification namespace to its live Kubernetes UID. Admission and NAT publication verify that exact namespace incarnation through the API. Restrictive requests outside the scope fail; losing the scope withdraws the owned NAT. Open FIPs remain unrestricted and can still be created or edited. The scope has no enabling effect while manager.fipSourcePolicy.enabled is false. An empty object with the gate true retains installation-wide enablement. Do not use an empty scope for a bounded qualification.

Deploy the scope-aware manager and chart with the gate false first. Verify the immutable image and exact UID map on every manager/webhook replica before separately reviewing the gate change. An older replica ignores the scope and can admit restrictions outside it if enablement accompanies the image rollout. Keep backend capabilities off until their traffic and authenticated console acceptance pass. Scope removal and gate rollback require the restricted-resource inventory and withdrawal procedure in Qualify exposure source policies.

After bounded qualification, delete owned restrictive FIPs first and verify their actual NAT and ACL/group rows are absent. Remove the remaining owned workloads and addresses through normal finalizers. Set the gate false while retaining the nonempty UID map, then verify every serving webhook replica and the elected controller disabled. Clear the map only in a separate reviewed change after that verification.

For VM migration acceptance, record the same VMI UID moving between distinct nodes, denied-client isolation during the move, fresh recovery controls and allowed-client interruptions. A successful migration does not establish uninterrupted endpoint availability. Compare large or fragmented traffic with a working open baseline; a denied fragment without an allowed control does not qualify filtering.

Backend method availability can be limited to qualified namespaces through backend.exposureSourcePolicy.namespaces; managed API availability has its own namespace list. Gateway LoadBalancer Services require both direct and Gateway qualification. Do not publish a generic capability for untested protocols, database families, VM migrations or shared External worker transport.