start

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2015 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindCertArgs

func BindCertArgs(args *CertArgs, flags *pflag.FlagSet, prefix string)

func BindImageFormatArgs

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

func BindKubeConnectionArgs

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

func BindListenArg

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

func BindMasterArgs

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

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

func BindNodeArgs

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

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

func BindPolicyArgs

func BindPolicyArgs(args *PolicyArgs, flags *pflag.FlagSet, prefix string)

func GetAllInOneArgs

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

func ReadMasterConfig

func ReadMasterConfig(filename string) (*configapi.MasterConfig, error)

func ReadNodeConfig

func ReadNodeConfig(filename string) (*configapi.NodeConfig, error)

func StartMaster

func StartMaster(openshiftMasterConfig *configapi.MasterConfig) error

func StartNode

func StartNode(config configapi.NodeConfig) error

func WriteMaster

func WriteMaster(config *configapi.MasterConfig) ([]byte, error)

WriteMaster serializes the config to yaml.

func WriteNode

func WriteNode(config *configapi.NodeConfig) ([]byte, error)

WriteNode serializes the config to yaml.

Types

type AllInOneOptions

type AllInOneOptions struct {
	MasterArgs *MasterArgs
	NodeArgs   *NodeArgs

	WriteConfigOnly  bool
	MasterConfigFile string
	NodeConfigFile   string
}

func NewCommandStartAllInOne

func NewCommandStartAllInOne() (*cobra.Command, *AllInOneOptions)

NewCommandStartMaster provides a CLI handler for 'start' command

func (AllInOneOptions) Complete

func (o AllInOneOptions) Complete() error

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 CertArgs

type CertArgs struct {
	CertDir        string
	CreateCerts    bool
	OverwriteCerts bool
}

func NewDefaultCertArgs

func NewDefaultCertArgs() *CertArgs

type ImageFormatArgs

type ImageFormatArgs struct {
	ImageTemplate variable.ImageTemplate
}

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

func NewDefaultImageFormatArgs

func NewDefaultImageFormatArgs() *ImageFormatArgs

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

	CertArgs *CertArgs
}

func NewDefaultKubeConnectionArgs

func NewDefaultKubeConnectionArgs() *KubeConnectionArgs

func (KubeConnectionArgs) GetExternalKubernetesClientConfig

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

func (KubeConnectionArgs) GetKubernetesAddress

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

type ListenArg

type ListenArg struct {
	ListenAddr flagtypes.Addr
}

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

func NewDefaultListenArg

func NewDefaultListenArg() *ListenArg

func (*ListenArg) UseTLS

func (l *ListenArg) UseTLS() bool

type MasterArgs

type MasterArgs struct {
	MasterAddr flagtypes.Addr
	EtcdAddr   flagtypes.Addr
	PortalNet  flagtypes.IPNet
	// addresses for external clients
	MasterPublicAddr     flagtypes.Addr
	KubernetesPublicAddr flagtypes.Addr

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

	EtcdDir string

	NodeList util.StringList

	CORSAllowedOrigins util.StringList

	ListenArg          *ListenArg
	PolicyArgs         *PolicyArgs
	ImageFormatArgs    *ImageFormatArgs
	KubeConnectionArgs *KubeConnectionArgs
	CertArgs           *CertArgs

	SchedulerConfigFile string
}

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) GetAssetBindAddress

func (args MasterArgs) GetAssetBindAddress() string

func (MasterArgs) GetAssetPublicAddress

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

func (MasterArgs) GetDNSBindAddress

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

func (MasterArgs) GetEtcdAddress

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

func (MasterArgs) GetEtcdBindAddress

func (args MasterArgs) GetEtcdBindAddress() string

func (MasterArgs) GetEtcdPeerBindAddress

func (args MasterArgs) GetEtcdPeerBindAddress() string

func (MasterArgs) GetKubernetesPublicAddress

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

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) 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() error

type MasterOptions

type MasterOptions struct {
	MasterArgs *MasterArgs

	WriteConfigOnly bool
	ConfigFile      string
}

func NewCommandStartMaster

func NewCommandStartMaster() (*cobra.Command, *MasterOptions)

NewCommandStartMaster provides a CLI handler for 'start' command

func (MasterOptions) Complete

func (o MasterOptions) Complete() error

func (MasterOptions) CreateBootstrapPolicy

func (o MasterOptions) CreateBootstrapPolicy() error

func (MasterOptions) CreateCerts

func (o MasterOptions) CreateCerts() error

func (MasterOptions) RunMaster

func (o MasterOptions) RunMaster() error

RunMaster takes the options and: 1. Creates certs if needed 2. Reads fully specified master config OR builds a fully specified master config from the args 3. Writes the fully specified master config and exits if needed 4. Starts the master based on the fully specified config

func (MasterOptions) StartMaster

func (o MasterOptions) StartMaster() error

StartMaster calls RunMaster and then waits forever

func (MasterOptions) Validate

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

type NodeArgs

type NodeArgs struct {
	NodeName string

	AllowDisabledDocker bool
	VolumeDir           string

	DefaultKubernetesURL url.URL
	ClusterDomain        string
	ClusterDNS           net.IP

	ListenArg          *ListenArg
	ImageFormatArgs    *ImageFormatArgs
	KubeConnectionArgs *KubeConnectionArgs
	CertArgs           *CertArgs
}

NodeArgs 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 NewDefaultNodeArgs

func NewDefaultNodeArgs() *NodeArgs

NewDefaultNodeArgs creates NodeArgs with sub-objects created and default values set.

func (NodeArgs) BuildSerializeableNodeConfig

func (args NodeArgs) BuildSerializeableNodeConfig() (*configapi.NodeConfig, error)

BuildSerializeableNodeConfig takes the NodeArgs (partially complete config) and uses them along with defaulting behavior to create the fully specified config object for starting the node

type NodeOptions

type NodeOptions struct {
	NodeArgs *NodeArgs

	WriteConfigOnly bool
	ConfigFile      string
}

func NewCommandStartNode

func NewCommandStartNode() (*cobra.Command, *NodeOptions)

NewCommandStartMaster provides a CLI handler for 'start' command

func (NodeOptions) Complete

func (o NodeOptions) Complete() error

func (NodeOptions) CreateCerts

func (o NodeOptions) CreateCerts() error

func (NodeOptions) RunNode

func (o NodeOptions) RunNode() error

RunNode takes the options and: 1. Creates certs if needed 2. Reads fully specified node config OR builds a fully specified node config from the args 3. Writes the fully specified node config and exits if needed 4. Starts the node based on the fully specified config

func (NodeOptions) StartNode

func (o NodeOptions) StartNode() error

StartNode calls RunNode and then waits forever

func (NodeOptions) Validate

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

type PolicyArgs

type PolicyArgs struct {
	PolicyFile          string
	CreatePolicyFile    bool
	OverwritePolicyFile bool
}

func NewDefaultPolicyArgs

func NewDefaultPolicyArgs() *PolicyArgs

Jump to

Keyboard shortcuts

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