mirror of https://github.com/kubernetes/kops.git
upup: kubecfg generate can default the master API name
It is api.<clustername> by default
This commit is contained in:
parent
72afa859a3
commit
53e4875a5b
|
|
@ -46,7 +46,7 @@ The upup tool is a CLI for doing administrative tasks. You can use it to genera
|
|||
|
||||
```
|
||||
export MYZONE=<kubernetes.myzone.com>
|
||||
${GOPATH}/bin/upup kubecfg generate --state=state --master=api.${MYZONE} --name=${MYZONE} --cloud=aws
|
||||
${GOPATH}/bin/upup kubecfg generate --state=state --name=${MYZONE} --cloud=aws
|
||||
```
|
||||
|
||||
## Delete the cluster
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package main
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/golang/glog"
|
||||
"github.com/spf13/cobra"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
|
|
@ -49,13 +50,13 @@ func init() {
|
|||
}
|
||||
|
||||
func (c *KubecfgGenerateCommand) Run() error {
|
||||
if c.Master == "" {
|
||||
return fmt.Errorf("master must be specified")
|
||||
}
|
||||
|
||||
if c.ClusterName == "" {
|
||||
return fmt.Errorf("name must be specified")
|
||||
}
|
||||
if c.Master == "" {
|
||||
c.Master = "api." + c.ClusterName
|
||||
glog.Infof("Connecting to master at %s", c.Master)
|
||||
}
|
||||
if c.CloudProvider == "" {
|
||||
return fmt.Errorf("cloud must be specified")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue