mirror of https://github.com/kubernetes/kops.git
Merge pull request #103 from justinsb/upup_dns_zone
upup: allow -dns-zone to be specified
This commit is contained in:
commit
771c436101
|
@ -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`
|
* 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 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
|
# How it works
|
||||||
|
|
||||||
|
|
|
@ -60,6 +60,9 @@ func main() {
|
||||||
nodeCount := 0
|
nodeCount := 0
|
||||||
flag.IntVar(&nodeCount, "node-count", nodeCount, "Set the number of nodes")
|
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()
|
flag.Parse()
|
||||||
|
|
||||||
config.NodeZones = parseZoneList(zones)
|
config.NodeZones = parseZoneList(zones)
|
||||||
|
@ -76,6 +79,10 @@ func main() {
|
||||||
config.NodeCount = nodeCount
|
config.NodeCount = nodeCount
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if dnsZone != "" {
|
||||||
|
config.DNSZone = dnsZone
|
||||||
|
}
|
||||||
|
|
||||||
if dryrun {
|
if dryrun {
|
||||||
target = "dryrun"
|
target = "dryrun"
|
||||||
}
|
}
|
||||||
|
@ -177,6 +184,7 @@ func (c *CreateClusterCmd) Run() error {
|
||||||
if c.Config.DNSZone == "" {
|
if c.Config.DNSZone == "" {
|
||||||
tokens := strings.Split(c.Config.MasterPublicName, ".")
|
tokens := strings.Split(c.Config.MasterPublicName, ".")
|
||||||
c.Config.DNSZone = strings.Join(tokens[len(tokens)-2:], ".")
|
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 {
|
if len(c.Config.NodeZones) == 0 {
|
||||||
|
|
Loading…
Reference in New Issue