start

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2015 License: Apache-2.0 Imports: 52 Imported by: 242

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindImageFormatArgs

func BindImageFormatArgs(args *ImageFormatArgs, flags *pflag.FlagSet, prefix string)

BindImageFormatArgs binds values to the given arguments by using flags

func BindKubeConnectionArgs

func BindKubeConnectionArgs(args *KubeConnectionArgs, flags *pflag.FlagSet, prefix string)

BindKubeConnectionArgs binds values to the given arguments by using flags

func BindListenArg

func BindListenArg(args *ListenArg, flags *pflag.FlagSet, prefix string)

BindListenArg binds values to the given arguments by using flags

func BindMasterArgs

func BindMasterArgs(args *MasterArgs, flags *pflag.FlagSet, prefix string)

BindMasterArgs binds the options to the flags with prefix + default flag names

func BindNetworkArgs

func BindNetworkArgs(args *NetworkArgs, flags *pflag.FlagSet, prefix string)

BindNetworkArgs binds values to the given arguments by using flags

func BindNodeArgs

func BindNodeArgs(args *NodeArgs, flags *pflag.FlagSet, prefix string)

BindNodeArgs binds the options to the flags with prefix + default flag names

func GetAllInOneArgs

func GetAllInOneArgs() (*MasterArgs, *NodeArgs, *ListenArg, *ImageFormatArgs, *KubeConnectionArgs)

GetAllInOneArgs makes sure that the node and master args that should be shared, are shared

func RunSDNController

func RunSDNController(config *kubernetes.NodeConfig, nodeConfig configapi.NodeConfig)

func StartMaster

func StartMaster(openshiftMasterConfig *configapi.MasterConfig) error

func StartNode

func StartNode(nodeConfig configapi.NodeConfig) error

Types

type AllInOneOptions

type AllInOneOptions struct {
	MasterArgs *MasterArgs
	NodeArgs   *NodeArgs

	CreateCerts      bool
	ConfigDir        util.StringFlag
	MasterConfigFile string
	NodeConfigFile   string

	Output io.Writer
}

func NewCommandStartAllInOne

func NewCommandStartAllInOne(fullName string, out io.Writer) (*cobra.Command, *AllInOneOptions)

NewCommandStartAllInOne provides a CLI handler for 'start' command

func (*AllInOneOptions) Complete

func (o *AllInOneOptions) Complete() error

func (AllInOneOptions) IsRunFromConfig

func (o AllInOneOptions) IsRunFromConfig() bool

func (AllInOneOptions) IsWriteConfigOnly

func (o AllInOneOptions) IsWriteConfigOnly() bool

func (AllInOneOptions) StartAllInOne

func (o AllInOneOptions) StartAllInOne() error

StartAllInOne: 1. Creates the signer certificate if needed 2. Calls RunMaster 3. Calls RunNode 4. If only writing configs, it exits 5. Waits forever

func (AllInOneOptions) Validate

func (o AllInOneOptions) Validate(args []string) error

type ImageFormatArgs

type ImageFormatArgs struct {
	// ImageTemplate is used in expanding parameterized Docker image references
	// from configuration or a file
	ImageTemplate variable.ImageTemplate
}

ImageFormatArgs is a struct that the command stores flag values into.

func NewDefaultImageFormatArgs

func NewDefaultImageFormatArgs() *ImageFormatArgs

NewDefaultImageFormatArgs returns the default image template

type KubeConnectionArgs

type KubeConnectionArgs struct {
	KubernetesAddr flagtypes.Addr

	// ClientConfig is used when connecting to Kubernetes from the master, or
	// when connecting to the master from a detached node. If StartKube is true,
	// this value is not used.
	ClientConfig clientcmd.ClientConfig
	// ClientConfigLoadingRules is the ruleset used to load the client config.
	// Only the CommandLinePath is expected to be used.
	ClientConfigLoadingRules clientcmd.ClientConfigLoadingRules
}

func NewDefaultKubeConnectionArgs

func NewDefaultKubeConnectionArgs() *KubeConnectionArgs

NewDefaultKubeConnectionArgs returns a new set of default connection arguments for Kubernetes

func (KubeConnectionArgs) GetExternalKubernetesClientConfig

func (args KubeConnectionArgs) GetExternalKubernetesClientConfig() (*client.Config, bool, error)

func (KubeConnectionArgs) GetKubernetesAddress

func (args KubeConnectionArgs) GetKubernetesAddress(defaultAddress *url.URL) (*url.URL, error)

func (KubeConnectionArgs) Validate

func (args KubeConnectionArgs) Validate() error

type ListenArg

type ListenArg struct {
	// ListenAddr is the address to listen for connections on (scheme://host:port).
	ListenAddr flagtypes.Addr
}

ListenArg is a struct that the command stores flag values into.

func NewDefaultListenArg

func NewDefaultListenArg() *ListenArg

NewDefaultListenArg returns a new address to listen for connections

func (*ListenArg) UseTLS

func (l *ListenArg) UseTLS() bool

UseTLS checks whether the address we listen for connections uses TLS or not

type MasterArgs

type MasterArgs struct {
	// MasterAddr is the master address for use by OpenShift components (host, host:port, or URL).
	// Scheme and port default to the --listen scheme and port. When unset, attempt to use the first
	// public IPv4 non-loopback address registered on this host.
	MasterAddr flagtypes.Addr

	// EtcdAddr is the address of the etcd server (host, host:port, or URL). If specified, no built-in
	// etcd will be started.
	EtcdAddr flagtypes.Addr

	// PortalNet is a CIDR notation IP range from which to assign portal IPs. This must not overlap
	// with any IP ranges assigned to nodes for pods.
	PortalNet flagtypes.IPNet

	// MasterPublicAddr is the master address for use by public clients, if different (host, host:port,
	// or URL). Defaults to same as --master.
	MasterPublicAddr flagtypes.Addr

	PauseControllers bool

	// DNSBindAddr exposed for integration tests to set
	DNSBindAddr flagtypes.Addr

	// EtcdDir is the etcd data directory.
	EtcdDir   string
	ConfigDir *util.StringFlag

	// NodeList contains the hostnames of each node. This currently must be specified
	// up front. Comma delimited list
	NodeList util.StringList

	// CORSAllowedOrigins is a list of allowed origins for CORS, comma separated.
	// An allowed origin can be a regular expression to support subdomain matching.
	// CORS is enabled for localhost, 127.0.0.1, and the asset server by default.
	CORSAllowedOrigins util.StringList

	ListenArg          *ListenArg
	ImageFormatArgs    *ImageFormatArgs
	KubeConnectionArgs *KubeConnectionArgs

	SchedulerConfigFile string

	NetworkArgs *NetworkArgs
}

MasterArgs is a struct that the command stores flag values into. It holds a partially complete set of parameters for starting the master This object should hold the common set values, but not attempt to handle all cases. The expected path is to use this object to create a fully specified config later on. If you need something not set here, then create a fully specified config file and pass that as argument to starting the master.

func NewDefaultMasterArgs

func NewDefaultMasterArgs() *MasterArgs

NewDefaultMasterArgs creates MasterArgs with sub-objects created and default values set.

func (MasterArgs) BuildSerializeableEtcdConfig

func (args MasterArgs) BuildSerializeableEtcdConfig() (*configapi.EtcdConfig, error)

BuildSerializeableEtcdConfig creates a fully specified etcd startup configuration based on MasterArgs

func (MasterArgs) BuildSerializeableKubeMasterConfig

func (args MasterArgs) BuildSerializeableKubeMasterConfig() (*configapi.KubernetesMasterConfig, error)

BuildSerializeableKubeMasterConfig creates a fully specified kubernetes master startup configuration based on MasterArgs

func (MasterArgs) BuildSerializeableMasterConfig

func (args MasterArgs) BuildSerializeableMasterConfig() (*configapi.MasterConfig, error)

BuildSerializeableMasterConfig takes the MasterArgs (partially complete config) and uses them along with defaulting behavior to create the fully specified config object for starting the master

func (MasterArgs) BuildSerializeableOAuthConfig

func (args MasterArgs) BuildSerializeableOAuthConfig() (*configapi.OAuthConfig, error)

func (MasterArgs) GetAssetBindAddress

func (args MasterArgs) GetAssetBindAddress() string

func (MasterArgs) GetAssetPublicAddress

func (args MasterArgs) GetAssetPublicAddress() (*url.URL, error)

func (MasterArgs) GetConfigFileToWrite

func (args MasterArgs) GetConfigFileToWrite() string

GetConfigFileToWrite returns the configuration filepath for master

func (MasterArgs) GetDNSBindAddress

func (args MasterArgs) GetDNSBindAddress() (flagtypes.Addr, error)

func (MasterArgs) GetEtcdAddress

func (args MasterArgs) GetEtcdAddress() (*url.URL, error)

GetEtcdAddress returns the address for etcd

func (MasterArgs) GetEtcdBindAddress

func (args MasterArgs) GetEtcdBindAddress() string

GetEtcdBindAddress derives the etcd bind address by using the bind address and the default etcd port

func (MasterArgs) GetEtcdPeerAddress

func (args MasterArgs) GetEtcdPeerAddress() (*url.URL, error)

func (MasterArgs) GetEtcdPeerBindAddress

func (args MasterArgs) GetEtcdPeerBindAddress() string

GetEtcdPeerBindAddress derives the etcd peer address by using the bind address and the default etcd peering port

func (MasterArgs) GetMasterAddress

func (args MasterArgs) GetMasterAddress() (*url.URL, error)

GetMasterAddress checks for an unset master address and then attempts to use the first public IPv4 non-loopback address registered on this host. TODO: make me IPv6 safe

func (MasterArgs) GetMasterPublicAddress

func (args MasterArgs) GetMasterPublicAddress() (*url.URL, error)

func (MasterArgs) GetPolicyFile

func (args MasterArgs) GetPolicyFile() string

GetPolicyFile returns the policy filepath for master

func (MasterArgs) GetServerCertHostnames

func (args MasterArgs) GetServerCertHostnames() (util.StringSet, error)

GetServerCertHostnames returns the set of hostnames that any serving certificate for master needs to be valid for.

func (MasterArgs) Validate

func (args MasterArgs) Validate()