Skip to content
srvd is a configuration management tool using DNS SRV record like confd.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
debian
etc
pkg
testutils
tmplfuncs
utils
.gitignore
.travis.yml
Gopkg.toml
Makefile
README.md
command.go
command_test.go
config.go
config_test.go
dns_client.go
dns_client_test.go
flags.go
httpd.go
httpd_test.go
main.go
main_test.go
status.go
template.go
template_test.go
worker.go
worker_test.go

README.md

srvd

srvd is a configuration management tool using DNS SRV record like confd.

Build Status

Usage

srvd -config srvd.toml
Usage of ./pkg/srvd:
  -config string
    	Config file path (default "srvd.toml")
  -dryrun
    	Dry run mode
  -nocheck
    	Skip checking
  -nohttpd
    	Stop httpd
  -noreload
    	Skip reloading
  -oneshot
    	Run once
  -version
    	Print version and exit

Configuration example

src = "/etc/haproxy/haproxy.cfg.tmpl"
dest = "/etc/haproxy/haproxy.cfg"
domains = ["_http._tcp.example.com"]
reload_cmd = "/bin/systemctl reload haproxy.service"
check_cmd = "/usr/sbin/haproxy -c -V -f {{ .src }}"
interval = 1
timeout = 3
#resolv_conf = "/etc/resolv.conf"
cooldown = 60
#status_port = 8080
#sdnotify = false
#disable_rollback_on_reload_failure = false
#edns0_size = 4096

Template example

backend nodes
  mode tcp
  {{ $srvs := fetchsrvs .domains "_http._tcp.example.com" }}
  # see https://godoc.org/github.com/miekg/dns#SRV
  {{ range $srvs }}
  server {{ .Target }} {{ .Target }}:{{ .Port }}
  {{ end }}

Check status

$ curl localhost:8080/status
{"LastUpdate":"2018-08-02T23:38:25.647297201+09:00","Ok":true}
You can’t perform that action at this time.