How inovex/external-dns-openstack-webhook works
Project type and purpose
• This is a Go-based “webhook provider” plugin for the Kubernetes ExternalDNS system.
• Its sole responsibility is to accept DNS change requests from ExternalDNS (via HTTP) and translate them into API calls against an OpenStack Designate instance (using Gophercloud under the hood).
File structure
• Top‐level entrypoint: cmd/webhook/main.go → starts an HTTP server.
• internal/designate/provider → implements the ExternalDNS “Provider” interface, handling Create/Update/Delete record calls.
• internal/designate/client → encapsulates all low‐level calls to OpenStack Designate (and Keystone for auth).
• Config & packaging: goreleaser.yaml, Dockerfile, Makefile, Helm values are implied by the README.
README for additional insights
• Runs as a sidecar in the ExternalDNS pod via Helm.
• Configured by mounting a Secret containing clouds.yaml and an optional OS_CLOUD env var.
• ExternalDNS sends HTTP POST/GET/DELETE for record changes to this webhook.
a. Main components
1. ExternalDNS Core (running in Kubernetes)
2. Webhook Provider Container (sidecar)
• HTTP Server (listens on /records)
• Provider Logic (internal/designate/provider)
• Designate Client (internal/designate/client)
3. Configuration Source (Kubernetes Secret → clouds.yaml)
4. OpenStack Keystone (Identity service)
5. OpenStack Designate (DNS service)
b. Relationships & data flow
1. ExternalDNS Core issues DNS‐Change HTTP requests → Webhook HTTP Server.
2. Webhook Provider Logic transforms requests → invokes Designate Client.
3. Designate Client authenticates against Keystone → obtains token.
4. Designate Client calls Designate API → manages DNS records.
5. Responses bubble back along the same path → ExternalDNS.
6. Configuration (clouds.yaml) is read at startup and periodically reloaded if desired.
c. Architectural patterns & principles
• Sidecar pattern: co‐located with ExternalDNS in the same Pod.
• “Adapter” pattern: Provider Logic adapts ExternalDNS interface to Designate API.
• Layered separation: HTTP layer → Business Logic layer → Client/Transport layer → External system.
• Immutable configuration via mounted Secret (clouds.yaml).
d. Key technologies & frameworks
• Golang (modules)
• Gophercloud (OpenStack client library)
• Kubernetes Webhook Provider model (HTTP callbacks)
• Helm for deployment