本文整理汇总了Golang中github.com/deis/deis/pkg/prettyprint.DeisIfy函数的典型用法代码示例。如果您正苦于以下问题:Golang DeisIfy函数的具体用法?Golang DeisIfy怎么用?Golang DeisIfy使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DeisIfy函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: InstallPlatform
// InstallPlatform loads all components' definitions from local unit files.
// After InstallPlatform, all components will be available for StartPlatform.
func InstallPlatform(b backend.Backend, cb config.Backend, checkKeys func(config.Backend) error, stateless bool) error {
if err := checkKeys(cb); err != nil {
return err
}
if stateless {
fmt.Println("Warning: With a stateless control plane, `deis logs` will be unavailable.")
fmt.Println("Additionally, components will need to be configured to use external persistent stores.")
fmt.Println("See the official Deis documentation for details on running a stateless control plane.")
}
var wg sync.WaitGroup
io.WriteString(Stdout, prettyprint.DeisIfy("Installing Deis..."))
installDefaultServices(b, stateless, &wg, Stdout, Stderr)
wg.Wait()
fmt.Fprintln(Stdout, "Done.")
fmt.Fprintln(Stdout, "")
if stateless {
fmt.Fprintln(Stdout, "Please run `deisctl start stateless-platform` to boot up Deis.")
} else {
fmt.Fprintln(Stdout, "Please run `deisctl start platform` to boot up Deis.")
}
return nil
}
示例2: UnInstallSwarm
//UnInstallSwarm uninstall Swarm
func UnInstallSwarm(b backend.Backend) error {
var wg sync.WaitGroup
io.WriteString(Stdout, prettyprint.DeisIfy("Destroying Swarm..."))
fmt.Fprintln(Stdout, "swarm nodes and swarm manager...")
b.Destroy([]string{"swarm-node", "swarm-manager"}, &wg, Stdout, Stderr)
wg.Wait()
fmt.Fprintln(Stdout, "Done.\n ")
return nil
}
示例3: InstallSwarm
//InstallSwarm Installs swarm
func InstallSwarm(b backend.Backend) error {
var wg sync.WaitGroup
io.WriteString(Stdout, prettyprint.DeisIfy("Installing Swarm..."))
fmt.Fprintln(Stdout, "Swarm node and Swarm Manager...")
b.Create([]string{"swarm-node", "swarm-manager"}, &wg, Stdout, Stderr)
wg.Wait()
fmt.Fprintln(Stdout, "Done.\n ")
fmt.Fprintln(Stdout, "Please run `deisctl start swarm` to start swarm.")
return nil
}
示例4: UnInstallSwarm
//UnInstallSwarm uninstall Swarm
func UnInstallSwarm(b backend.Backend) error {
var wg sync.WaitGroup
io.WriteString(Stdout, prettyprint.DeisIfy("Uninstalling Swarm..."))
fmt.Fprintln(Stdout, "Swarm data plane...")
b.Destroy([]string{"swarm-node"}, &wg, Stdout, Stderr)
wg.Wait()
fmt.Fprintln(Stdout, "Swarm control plane...")
b.Destroy([]string{"swarm-manager"}, &wg, Stdout, Stderr)
wg.Wait()
fmt.Fprintln(Stdout, "Done.\n ")
return nil
}
示例5: StartSwarm
//StartSwarm starts Swarm Schduler
func StartSwarm(b backend.Backend) error {
var wg sync.WaitGroup
io.WriteString(Stdout, prettyprint.DeisIfy("Starting Swarm..."))
fmt.Fprintln(Stdout, "Swarm control plane...")
b.Start([]string{"swarm-manager"}, &wg, Stdout, Stderr)
wg.Wait()
fmt.Fprintln(Stdout, "Swarm data plane...")
b.Start([]string{"swarm-node"}, &wg, Stdout, Stderr)
wg.Wait()
fmt.Fprintln(Stdout, "Done.\n ")
fmt.Fprintln(Stdout, "Please run `deisctl config controller set schedulerModule=swarm` to use the swarm scheduler.")
return nil
}
示例6: UninstallPlatform
// UninstallPlatform unloads all components' definitions.
// After UninstallPlatform, all components will be unavailable.
func UninstallPlatform(b backend.Backend, stateless bool) error {
var wg sync.WaitGroup
io.WriteString(Stdout, prettyprint.DeisIfy("Uninstalling Deis..."))
uninstallAllServices(b, stateless, &wg, Stdout, Stderr)
wg.Wait()
fmt.Fprintln(Stdout, "Done.")
return nil
}
示例7: UninstallMesos
// UninstallMesos unloads and uninstalls all Mesos component definitions
func UninstallMesos(b backend.Backend) error {
var wg sync.WaitGroup
io.WriteString(Stdout, prettyprint.DeisIfy("Uninstalling Mesos..."))
uninstallMesosServices(b, &wg, Stdout, Stderr)
wg.Wait()
fmt.Fprintln(Stdout, "Done.")
return nil
}
示例8: StartPlatform
// StartPlatform activates all components.
func StartPlatform(b backend.Backend, stateless bool) error {
var wg sync.WaitGroup
io.WriteString(Stdout, prettyprint.DeisIfy("Starting Deis..."))
startDefaultServices(b, stateless, &wg, Stdout, Stderr)
wg.Wait()
fmt.Fprintln(Stdout, "Done.\n ")
fmt.Fprintln(Stdout, "Please use `deis register` to setup an administrator account.")
return nil
}
示例9: StartMesos
// StartMesos activates all Mesos components.
func StartMesos(b backend.Backend) error {
var wg sync.WaitGroup
io.WriteString(Stdout, prettyprint.DeisIfy("Starting Mesos/Marathon..."))
startMesosServices(b, &wg, Stdout, Stderr)
wg.Wait()
fmt.Fprintln(Stdout, "Done.\n ")
fmt.Fprintln(Stdout, "Please use `deisctl config controller set schedulerModule=mesos_marathon`")
return nil
}
示例10: InstallMesos
// InstallMesos loads all Mesos units for StartMesos
func InstallMesos(b backend.Backend) error {
var wg sync.WaitGroup
io.WriteString(Stdout, prettyprint.DeisIfy("Installing Mesos/Marathon..."))
installMesosServices(b, &wg, Stdout, Stderr)
wg.Wait()
fmt.Fprintln(Stdout, "Done.\n ")
fmt.Fprintln(Stdout, "Please run `deisctl start mesos` to boot up Mesos.")
return nil
}
示例11: StopMesos
// StopMesos deactivates all Mesos components.
func StopMesos(b backend.Backend) error {
var wg sync.WaitGroup
io.WriteString(Stdout, prettyprint.DeisIfy("Stopping Mesos..."))
stopMesosServices(b, &wg, Stdout, Stderr)
wg.Wait()
fmt.Fprintln(Stdout, "Done.")
fmt.Fprintln(Stdout, "")
fmt.Fprintln(Stdout, "Please run `deisctl start mesos` to restart Mesos.")
return nil
}
示例12: UnInstallK8s
//UnInstallK8s uninstall K8s
func UnInstallK8s(b backend.Backend) error {
var wg sync.WaitGroup
io.WriteString(Stdout, prettyprint.DeisIfy("Uninstalling K8s..."))
fmt.Fprintln(Stdout, "K8s router mesh...")
b.Destroy([]string{"kube-proxy"}, &wg, Stdout, Stderr)
wg.Wait()
fmt.Fprintln(Stdout, "K8s data plane...")
b.Destroy([]string{"kube-kubelet"}, &wg, Stdout, Stderr)
wg.Wait()
fmt.Fprintln(Stdout, "K8s control plane...")
b.Destroy([]string{"kube-controller-manager", "kube-scheduler"}, &wg, Stdout, Stderr)
wg.Wait()
b.Destroy([]string{"kube-apiserver"}, &wg, Stdout, Stderr)
wg.Wait()
fmt.Fprintln(Stdout, "Done.\n ")
return nil
}
示例13: StopPlatform
// StopPlatform deactivates all components.
func StopPlatform(b backend.Backend, stateless bool) error {
var wg sync.WaitGroup
io.WriteString(Stdout, prettyprint.DeisIfy("Stopping Deis..."))
stopDefaultServices(b, stateless, &wg, Stdout, Stderr)
wg.Wait()
fmt.Fprintln(Stdout, "Done.\n ")
if stateless {
fmt.Fprintln(Stdout, "Please run `deisctl start stateless-platform` to restart Deis.")
} else {
fmt.Fprintln(Stdout, "Please run `deisctl start platform` to restart Deis.")
}
return nil
}
示例14: StartK8s
//StartK8s starts K8s Schduler
func StartK8s(b backend.Backend) error {
var wg sync.WaitGroup
io.WriteString(Stdout, prettyprint.DeisIfy("Starting K8s..."))
fmt.Fprintln(Stdout, "K8s control plane...")
b.Start([]string{"kube-apiserver"}, &wg, Stdout, Stderr)
wg.Wait()
b.Start([]string{"kube-controller-manager", "kube-scheduler"}, &wg, Stdout, Stderr)
wg.Wait()
fmt.Fprintln(Stdout, "K8s data plane...")
b.Start([]string{"kube-kubelet"}, &wg, Stdout, Stderr)
wg.Wait()
fmt.Fprintln(Stdout, "K8s router mesh...")
b.Start([]string{"kube-proxy"}, &wg, Stdout, Stderr)
wg.Wait()
fmt.Fprintln(Stdout, "Done.\n ")
fmt.Fprintln(Stdout, "Please run `deisctl config controller set schedulerModule=k8s` to use the K8s scheduler.")
return nil
}
示例15: Command
// Command executes the given deisctl command line.
func Command(argv []string) int {
deisctlMotd := prettyprint.DeisIfy("Deis Control Utility")
usage := deisctlMotd + `
Usage: deisctl [options] <command> [<args>...]
Commands, use "deisctl help <command>" to learn more:
install install components, or the entire platform
uninstall uninstall components
list list installed components
start start components
stop stop components
restart stop, then start components
scale grow or shrink the number of routers, registries or store gateways
journal print the log output of a component
config set platform or component values
refresh-units refresh unit files from GitHub
ssh open an interactive shell on a machine in the cluster
dock open an interactive shell on a container in the cluster
help show the help screen for a command
upgrade-prep prepare a running cluster for upgrade
upgrade-takeover allow an upgrade to gracefully takeover a running cluster
rolling-restart perform a rolling restart of a Deis component (currently only router is supported)
Options:
-h --help show this help screen
--endpoint=<url> etcd endpoint for fleet [default: http://127.0.0.1:4001]
--etcd-cafile=<path> etcd CA file authentication [default: ]
--etcd-certfile=<path> etcd cert file authentication [default: ]
--etcd-key-prefix=<path> keyspace for fleet data in etcd [default: /_coreos.com/fleet/]
--etcd-keyfile=<path> etcd key file authentication [default: ]
--known-hosts-file=<path> where to store remote fingerprints [default: ~/.ssh/known_hosts]
--request-timeout=<secs> seconds before a request is considered failed [default: 10.0]
--ssh-timeout=<secs> seconds before SSH connection is considered failed [default: 10.0]
--strict-host-key-checking verify SSH host keys [default: true]
--tunnel=<host> SSH tunnel for communication with fleet and etcd [default: ]
--version print the version of deisctl
`
// pre-parse command-line arguments
argv, helpFlag := parseArgs(argv)
// give docopt an optional final false arg so it doesn't call os.Exit()
args, err := docopt.Parse(usage, argv, false, version.Version, true, false)
if err != nil && err.Error() != "" {
fmt.Println(err)
return 1
}
if len(args) == 0 {
return 0
}
command := args["<command>"]
setTunnel := true
// "--help" and "refresh-units" doesn't need SSH tunneling
if helpFlag || command == "refresh-units" {
setTunnel = false
}
setGlobalFlags(args, setTunnel)
// clean up the args so subcommands don't need to reparse them
argv = removeGlobalArgs(argv)
// construct a client
c, err := client.NewClient("fleet")
if err != nil {
fmt.Printf("Error: %v\n", err)
return 1
}
// Dispatch the command, passing the argv through so subcommands can
// re-parse it according to their usage strings.
switch command {
case "list":
err = c.List(argv)
case "scale":
err = c.Scale(argv)
case "start":
err = c.Start(argv)
case "restart":
err = c.Restart(argv)
case "stop":
err = c.Stop(argv)
case "status":
err = c.Status(argv)
case "journal":
err = c.Journal(argv)
case "install":
err = c.Install(argv)
case "uninstall":
err = c.Uninstall(argv)
case "config":
err = c.Config(argv)
case "refresh-units":
err = c.RefreshUnits(argv)
case "ssh":
err = c.SSH(argv)
case "dock":
err = c.Dock(argv)
case "upgrade-prep":
err = c.UpgradePrep(argv)
case "upgrade-takeover":
err = c.UpgradeTakeover(argv)
//.........这里部分代码省略.........