One more time!
We tried using opaque host names for a while, but switched back to role-based names after we found our pagerduty alerts were suddenly impossible to understand.
We ended up with three and a half styles of domain names:
This style is used for virtualized node FQDNs, where the service maps to a chef role, the env to a chef/app environment, and geo to a datacenter or cloud region. The index is an opaque, unique identifier. At the moment we're using 3 digit decimal, but fully intend to switch to hex.
This style is used for support services (like the cache, queue, db, or elasticsearch) required for running service app. Implies that security groups should only allow access from other nodes that start with app-*.
{service(-{subservice})}.{env}.{geo}.{base-domain}, eg
app-db.stg.sfo.corp.net
This style is used for load balancer VIPs, CNAMES, and round-robin DNS pools. It is intended to be a logical/semantic name for clients who need to access the service. Developers found hardcoding indexed hostnames are beaten until morale has improved.
This style is used for physical servers, and the rack index is shared with our datacenter provider's rack indexing. That way when we absolutely need a physical person walk to a physical location and press a physical button, it's straightforward.
We also have this naming script integrated with our provisioning tools, we can build a "unipony" app dev instance in our default datacenter with a single command:
$ mkbox unipony
Which builds a t1.micro with a node name of something like
unipony-639.dev.dfw.corp.net and bootstraps with a chef runlist of ['role[unipony]']. More complicated usage is like the following:
$ mkbox unipony prod sfo hs1.8xlarge
--
http://josephholsten.com