upup: Allow node-count to be specified on the CLI

The other super-important option!
This commit is contained in:
Justin Santa Barbara 2016-06-10 13:35:16 -04:00
parent 329039497e
commit 70002068fa
2 changed files with 12 additions and 2 deletions

View File

@ -71,6 +71,10 @@ You must pass --yes to actually delete resources (without the `#` comment!)
* Try HA mode: `-zone=us-east-1b,us-east-1b,us-east-1d`
* Specify the node size: `-node-size=m4.large`
* Specify the number of nodes: `-node-count=4`
# How it works
Everything is driven by a local configuration directory tree, called the "model". The model represents
@ -95,14 +99,14 @@ So you don't use terraform for the 'proto' phase (you can't anyway, because of t
```
export MYZONE=<kubernetes.myzone.com>
${GOPATH}/bin/cloudup --v=0 --logtostderr -cloud=aws -zone=us-east-1c -name=${MYZONE} -kubernetes-version=1.2.2 --model=models/proto
${GOPATH}/bin/cloudup --v=0 --logtostderr -cloud=aws -zone=us-east-1c -name=${MYZONE} --model=models/proto
```
And then you can use terraform to do the full installation:
```
export MYZONE=<kubernetes.myzone.com>
${GOPATH}/bin/cloudup --v=0 --logtostderr -cloud=aws -zone=us-east-1c -name=${MYZONE} -kubernetes-version=1.2.2 --model=models/cloudup --target=terraform
${GOPATH}/bin/cloudup --v=0 --logtostderr -cloud=aws -zone=us-east-1c -name=${MYZONE} --model=models/cloudup --target=terraform
```
Then, to apply using terraform:

View File

@ -54,6 +54,9 @@ func main() {
nodeSize := ""
flag.StringVar(&nodeSize, "node-size", nodeSize, "Set instance size for nodes")
nodeCount := 0
flag.IntVar(&nodeCount, "node-count", nodeCount, "Set the number of nodes")
flag.Parse()
config.Zones = strings.Split(zones, ",")
@ -64,6 +67,9 @@ func main() {
if nodeSize != "" {
config.NodeMachineType = nodeSize
}
if nodeCount != 0 {
config.NodeCount = nodeCount
}
if dryrun {
target = "dryrun"