# yassminefeki/resilient-ip-gateway-and-multi-tenant-routing architecture

> Architecture diagram of the GitHub repository yassminefeki/resilient-ip-gateway-and-multi-tenant-routing, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing
- Repository: https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing

## Overview

FelCloud is an OpenStack-based high-availability gateway and multi-tenant routing system. Its operator workflow provisions isolated networks, gateways, and sandbox VMs with Pulumi; generates Ansible inventory from stack outputs; configures gateway routing and VRRP; and serves client traffic through a shared VIP to tenant backends. The Python IPAM control plane adds lease lifecycle, sandbox provisioning, and gateway synchronization. Most Pulumi relationships and key IPAM calls are visible in excerpts; Ansible wiring and several documented product behaviors rely on the README because those sources were not sampled.

Main entry points: [`infra/main.go`](https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/infra/main.go) (Pulumi Entrypoint), [`ansible/site.yml`](https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/ansible/site.yml) (Gateway Playbook), [`infra/router.go`](https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/infra/router.go) (Edge Router), [`ansible/roles/haproxy/tasks/main.yml`](https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/ansible/roles/haproxy/tasks/main.yml) (HAProxy Routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_infra["Infrastructure Provisioning"]
  node_pulumi["Pulumi Entrypoint<br/>[main.go]"]
  node_networks["Isolated Networks<br/>[network.go]"]
  node_router["Edge Router<br/>[router.go]"]
  node_security["Security Groups<br/>[security.go]"]
  node_vipport["VIP Reservation<br/>[vip.go]"]
  node_gatewayports["Gateway Ports<br/>[gateway_ports.go]"]
  node_gatewayinstances["Gateway Instances<br/>[gateways.go]"]
  node_bastion["Bastion Host<br/>[bastion.go]"]
end

subgraph group_config["Gateway Configuration"]
  node_inventory["Inventory Generator"]
  node_ansible["Gateway Playbook<br/>[site.yml]"]
  node_interfaces["Interface Resolution<br/>[main.yml]"]
end

subgraph group_control["IPAM Control Plane"]
  node_ipamapi["IPAM REST API<br/>[ipam_control.py]"]
  node_leases["Lease Lifecycle<br/>[ipam_control.py]"]
  node_gateway_sync["Gateway Sync<br/>[ipam_control.py]"]
  node_sqlite[("SQLite State<br/>[ipam_control.py]")]
end

subgraph group_traffic["Gateway Traffic"]
  node_haproxy["HAProxy Routing<br/>[main.yml]"]
  node_keepalived["VRRP Failover<br/>[main.yml]"]
  node_clients(("External Clients"))
  node_vip["Active VIP"]
end

subgraph group_tenants["Tenant Workloads"]
  node_sandboxes["Sandbox Instances<br/>[sandboxes.go]"]
  node_team_backends["Team Backends"]
end

node_operator(("Operator"))
node_openstack{{"OpenStack"}}

node_operator -->|"runs provisioning"| node_pulumi
node_pulumi -->|"creates networks"| node_networks
node_pulumi -->|"creates router"| node_router
node_pulumi -->|"creates rules"| node_security
node_pulumi -->|"reserves VIP"| node_vipport
node_pulumi -->|"creates ports"| node_gatewayports
node_pulumi -->|"creates gateways"| node_gatewayinstances
node_pulumi -->|"creates bastion"| node_bastion
node_pulumi -->|"creates sandboxes"| node_sandboxes
node_networks -->|"provisions networks"| node_openstack
node_router -->|"attaches edge subnet"| node_openstack
node_security -->|"creates access rules"| node_openstack
node_gatewayports -->|"creates ports"| node_openstack
node_gatewayinstances -->|"creates instances"| node_openstack
node_bastion -->|"creates instance"| node_openstack
node_sandboxes -->|"creates instances"| node_openstack
node_pulumi -->|"exports stack values"| node_inventory
node_operator -.->|"runs configuration"| node_ansible
node_ansible -.->|"configures routing"| node_haproxy
node_ansible -.->|"configures failover"| node_keepalived
node_ansible -.->|"resolves interfaces"| node_interfaces
node_clients -->|"sends HTTP&#40;S&#41;"| node_router
node_router -->|"forwards traffic"| node_vip
node_vip -->|"reaches active gateway"| node_haproxy
node_haproxy -->|"proxies by host"| node_team_backends
node_keepalived -->|"moves VIP"| node_vip
node_ipamapi -->|"handles lease routes"| node_leases
node_ipamapi -->|"invokes sync"| node_gateway_sync
node_leases -->|"stores lease state"| node_sqlite
node_gateway_sync -->|"validates and reloads"| node_haproxy
node_ipamapi -->|"provisions sandbox route"| node_team_backends

click node_pulumi "https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/infra/main.go"
click node_networks "https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/infra/network.go"
click node_router "https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/infra/router.go"
click node_security "https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/infra/security.go"
click node_vipport "https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/infra/vip.go"
click node_gatewayports "https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/infra/gateway_ports.go"
click node_gatewayinstances "https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/infra/gateways.go"
click node_bastion "https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/infra/bastion.go"
click node_sandboxes "https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/infra/sandboxes.go"
click node_inventory "https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/ansible/inventory/generate_inventory.py"
click node_ansible "https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/ansible/site.yml"
click node_haproxy "https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/ansible/roles/haproxy/tasks/main.yml"
click node_keepalived "https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/ansible/roles/keepalived/tasks/main.yml"
click node_interfaces "https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/ansible/roles/interface_resolve/tasks/main.yml"
click node_ipamapi "https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/ipam/ipam_control.py"
click node_leases "https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/ipam/ipam_control.py"
click node_gateway_sync "https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/ipam/ipam_control.py"
click node_sqlite "https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/ipam/ipam_control.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_pulumi,node_networks,node_router,node_security,node_vipport,node_gatewayports,node_gatewayinstances,node_bastion toneBlue
class node_inventory,node_ansible,node_interfaces toneAmber
class node_ipamapi,node_leases,node_gateway_sync,node_sqlite toneMint
class node_haproxy,node_keepalived,node_clients,node_vip toneRose
class node_sandboxes,node_team_backends,node_operator,node_openstack toneIndigo
```

## Components

### Infrastructure Provisioning

- [Pulumi Entrypoint](https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/infra/main.go): `infra/main.go`
- [Isolated Networks](https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/infra/network.go): `infra/network.go`
- [Edge Router](https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/infra/router.go): `infra/router.go`
- [Security Groups](https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/infra/security.go): `infra/security.go`
- [VIP Reservation](https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/infra/vip.go): `infra/vip.go`
- [Gateway Ports](https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/infra/gateway_ports.go): `infra/gateway_ports.go`
- [Gateway Instances](https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/infra/gateways.go): `infra/gateways.go`
- [Bastion Host](https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/infra/bastion.go): `infra/bastion.go`

### Gateway Configuration

- [Inventory Generator](https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/ansible/inventory/generate_inventory.py): `ansible/inventory/generate_inventory.py`
- [Gateway Playbook](https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/ansible/site.yml): `ansible/site.yml`
- [Interface Resolution](https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/ansible/roles/interface_resolve/tasks/main.yml): `ansible/roles/interface_resolve/tasks/main.yml`

### IPAM Control Plane

- [IPAM REST API](https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/ipam/ipam_control.py): `ipam/ipam_control.py`
- [Lease Lifecycle](https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/ipam/ipam_control.py): `ipam/ipam_control.py`
- [Gateway Sync](https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/ipam/ipam_control.py): `ipam/ipam_control.py`
- [SQLite State](https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/ipam/ipam_control.py): `ipam/ipam_control.py`

### Gateway Traffic

- [HAProxy Routing](https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/ansible/roles/haproxy/tasks/main.yml): `ansible/roles/haproxy/tasks/main.yml`
- [VRRP Failover](https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/ansible/roles/keepalived/tasks/main.yml): `ansible/roles/keepalived/tasks/main.yml`
- **External Clients**
- **Active VIP**

### Tenant Workloads

- [Sandbox Instances](https://github.com/yassminefeki/resilient-ip-gateway-and-multi-tenant-routing/blob/main/infra/sandboxes.go): `infra/sandboxes.go`
- **Team Backends**

### Other components

- **Operator**
- **OpenStack**

## Connections

- Operator → Pulumi Entrypoint: runs provisioning (evidence: `README.md`)
- Pulumi Entrypoint → Isolated Networks: creates networks (evidence: `infra/main.go`)
- Pulumi Entrypoint → Edge Router: creates router (evidence: `infra/main.go`)
- Pulumi Entrypoint → Security Groups: creates rules (evidence: `infra/main.go`)
- Pulumi Entrypoint → VIP Reservation: reserves VIP (evidence: `infra/main.go`)
- Pulumi Entrypoint → Gateway Ports: creates ports (evidence: `infra/main.go`)
- Pulumi Entrypoint → Gateway Instances: creates gateways (evidence: `infra/main.go`)
- Pulumi Entrypoint → Bastion Host: creates bastion (evidence: `infra/main.go`)
- Pulumi Entrypoint → Sandbox Instances: creates sandboxes (evidence: `infra/main.go`)
- Isolated Networks → OpenStack: provisions networks (evidence: `infra/network.go`)
- Edge Router → OpenStack: attaches edge subnet (evidence: `infra/router.go`)
- Security Groups → OpenStack: creates access rules (evidence: `infra/security.go`)
- Gateway Ports → OpenStack: creates ports (evidence: `infra/gateway_ports.go`)
- Gateway Instances → OpenStack: creates instances (evidence: `infra/gateways.go`)
- Bastion Host → OpenStack: creates instance (evidence: `infra/bastion.go`)
- Sandbox Instances → OpenStack: creates instances (evidence: `infra/sandboxes.go`)
- Pulumi Entrypoint → Inventory Generator: exports stack values (evidence: `ansible/inventory/generate_inventory.py`)
- Operator → Gateway Playbook: runs configuration
- Gateway Playbook → HAProxy Routing: configures routing
- Gateway Playbook → VRRP Failover: configures failover
- Gateway Playbook → Interface Resolution: resolves interfaces
- External Clients → Edge Router: sends HTTP(S) (evidence: `README.md`)
- Edge Router → Active VIP: forwards traffic (evidence: `README.md`)
- Active VIP → HAProxy Routing: reaches active gateway (evidence: `README.md`)
- HAProxy Routing → Team Backends: proxies by host (evidence: `README.md`)
- VRRP Failover → Active VIP: moves VIP (evidence: `README.md`)
- IPAM REST API → Lease Lifecycle: handles lease routes (evidence: `ipam/ipam_control.py`)
- IPAM REST API → Gateway Sync: invokes sync (evidence: `ipam/ipam_control.py`)
- Lease Lifecycle → SQLite State: stores lease state (evidence: `README.md`)
- Gateway Sync → HAProxy Routing: validates and reloads (evidence: `README.md`)
- IPAM REST API → Team Backends: provisions sandbox route (evidence: `ipam/ipam_control.py`)
