Skip to content

Feature: Floating IP Support #413

@josecelano

Description

@josecelano

Overview

The deployer is not aware of floating IPs (also called static IPs, reserved IPs, or elastic IPs depending on the provider). A floating IP is an IP address owned independently of any specific server and can be reassigned between servers without changing DNS.

During the Hetzner Demo deployment (#405) floating IPs were used deliberately to allow zero-downtime failover and maintenance:

  • Instance IP: 46.225.234.201 — the bare VM's IP, stored in the deployer's internal environment state after provisioning
  • Floating IP: 116.202.176.169 — the IP published in all DNS A records

The deployer records the instance IP during provision and uses that IP as the expected DNS target in the test command's DNS checks. Because DNS points to the floating IP, every domain triggers a false-positive warning:

⚠️  DNS check: api.torrust-tracker-demo.com resolves to [116.202.176.169]
    but expected 46.225.234.201

This is not an error. The deployment works correctly — traffic reaches the server through the floating IP. The deployer simply lacks the notion of a separate "public" IP that differs from the provisioned instance IP.

Current Workaround

Until this feature is implemented, test command DNS warnings can be safely ignored when floating IPs are in use. The DNS setup for the Hetzner demo (floating IP assignment, VM network configuration, and DNS record creation) is documented in docs/deployments/hetzner-demo-tracker/post-provision/dns-setup.md.

Why Floating IPs?

  1. Zero-downtime failover: Floating IP can be reassigned to a standby server instantly. DNS TTLs are not a concern because the IP itself does not change.
  2. Maintenance without downtime: A new server can be fully provisioned before traffic is cut over.

Other providers use the same concept under different names: AWS Elastic IP, GCP Reserved IP, DigitalOcean Reserved IP, Azure Static Public IP.

Proposed Solution

Add an optional public_ip field to the environment config:

"provider": {
  "name": "hetzner",
  "instance_ip": "46.225.234.201",
  "public_ip": "116.202.176.169"
}

When public_ip is configured:

  • test DNS checks compare resolved IPs against public_ip, eliminating false-positive warnings
  • provision output includes public_ip alongside instance_ip
  • Future: provision could automatically assign the floating IP to the instance via provider APIs

Acceptance Criteria

  • test command emits no DNS warnings when public_ip is configured and DNS resolves to that IP
  • provision output includes public_ip when configured
  • Environment config schema validates public_ip as a valid IP address
  • Unit tests cover DNS check with and without public_ip
  • Pre-commit checks pass: ./scripts/pre-commit.sh

Spec

See docs/issues/ for the full issue specification.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions