Merge pull request #103 from justinsb/upup_dns_zone

upup: allow -dns-zone to be specified
This commit is contained in:
Justin Santa Barbara 2016-06-11 23:06:04 -04:00 committed by GitHub
commit 771c436101
2 changed files with 13 additions and 1 deletions

View File

@ -71,9 +71,13 @@ You must pass --yes to actually delete resources (without the `#` comment!)
* Try HA mode: `-zone=us-east-1b,us-east-1c,us-east-1d`
* Specify the number of nodes: `-node-count=4`
* Specify the node size: `-node-size=m4.large`
* Specify the number of nodes: `-node-count=4`
* Specify the master size: `-master-size=m4.large`
* Override the default DNS zone: `-dns-zone=<my.hosted.zone>`
# How it works

View File

@ -60,6 +60,9 @@ func main() {
nodeCount := 0
flag.IntVar(&nodeCount, "node-count", nodeCount, "Set the number of nodes")
dnsZone := ""
flag.StringVar(&dnsZone, "dns-zone", dnsZone, "DNS hosted zone to use (defaults to last two components of cluster name)")
flag.Parse()
config.NodeZones = parseZoneList(zones)
@ -76,6 +79,10 @@ func main() {
config.NodeCount = nodeCount
}
if dnsZone != "" {
config.DNSZone = dnsZone
}
if dryrun {
target = "dryrun"
}
@ -177,6 +184,7 @@ func (c *CreateClusterCmd) Run() error {
if c.Config.DNSZone == "" {
tokens := strings.Split(c.Config.MasterPublicName, ".")
c.Config.DNSZone = strings.Join(tokens[len(tokens)-2:], ".")
glog.Infof("Defaulting DNS zone to: %s", c.Config.DNSZone)
}
if len(c.Config.NodeZones) == 0 {