infra: generate coredns/hosts from stack.toml domain + service list #135
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
coredns/hostshas 10+ lines hardcoding192.168.1.192andhomelab.fhirworx.iosubdomains. Adding a new service means editing bothcompose.ymlANDcoredns/hostsmanually.Fix
Add a
dev/scripts/gen_coredns_hosts.pythat:[platform].domainand[platform].host_ipfromstack.tomltraefik/dynamic/services.yml(or a[platform].serviceslist instack.toml)coredns/hostsRun it in bootstrap or as a pre-commit hook.
Files
coredns/hosts(generated, add to .gitignore or check in)coredns/Corefile(use env var for zone name)dev/scripts/gen_coredns_hosts.py