cmd

package
v0.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2017 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

View Source
const EtcdCertsCmdName string = "etcdcerts"

EtcdCertsCmdName the command name to use to invoke kmm for generating etcd certs

View Source
const ExitOnCompletionFlagName string = "exit-on-completion"

ExitOnCompletionFlagName is the syntax for the flag

View Source
const MasterSubCommand string = "master"

MasterSubCommand is the sub command syntax

Variables

View Source
var AddonsCmd = &cobra.Command{
	Use:   "addons",
	Short: "Will deploy cluster resources",
	Long:  "Will deploy / redeploy essential cluster resources",
	Run: func(cmd *cobra.Command, args []string) {
		cfg, err := getKmmConfig(cmd)
		if err != nil {
			log.Fatal(err)
		}
		if err = cfg.Kmm.UpdateCloudCfg(); err != nil {
			log.Fatal(err)
		}
		if err = cfg.Kubeadm.Addons(); err != nil {
			log.Fatal(err)
		}
	},
}

AddonsCmd represents the addons command

View Source
var EtcdCertsCmd = &cobra.Command{
	Use:   EtcdCertsCmdName,
	Short: "Will generate etcd certs",
	Long:  "Will generate etcd server, peer and client certs from a specified ca",
	Run: func(c *cobra.Command, args []string) {
		cfg, err := getConfig(c)
		if err == nil {
			err = etcd.GenCerts(cfg)
		}
		if err != nil {
			log.Fatal(err)
			os.Exit(-1)
		}
	},
}

EtcdCertsCmd represents the command for generating etcd certs

View Source
var (
	// RootCmd represents the base command when called without any subcommands
	RootCmd = &cobra.Command{
		Use:   "kmm",
		Short: "Kubernetes multi-master",
		Long:  "Kubernetes multi-master. Given CA's for etcd and Kubernetes, will automate starting kubernetes masters",
		RunE: func(c *cobra.Command, args []string) error {
			if c.Flags().Changed("version") {
				printVersion()
				return nil
			}
			return c.Usage()
		},
	}
)

Functions

func Execute

func Execute()

Execute adds all child commands to the root command sets flags appropriately. This is called by main(). It only needs to happen once to the rootCmd.

func GetEtcdHostNames

func GetEtcdHostNames(cmd *cobra.Command, minimalDefaultHosts []string) ([]string, error)

GetEtcdHostNames will get the hosts names from command flags and environment variables and a minimal defaults

func GetHostNamesFromEnvUrls

func GetHostNamesFromEnvUrls(envName string, minimalDefault []string) ([]string, error)

GetHostNamesFromEnvUrls - Will get host names from an environment variable and some defaults

func GetHostNamesFromUrls

func GetHostNamesFromUrls(urls string, minimalDefault []string) ([]string, error)

GetHostNamesFromUrls - Will parse host-names and adding specified additional extra minimal names...

func GetUrlsFromInitialClusterString

func GetUrlsFromInitialClusterString(initialCluster string) (string, error)

GetUrlsFromInitialClusterString - Should return a , separated list of urls

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL