Documentation ¶
Index ¶
- Constants
- func BindImageFormatArgs(args *ImageFormatArgs, flags *pflag.FlagSet, prefix string)
- func BindKubeConnectionArgs(args *KubeConnectionArgs, flags *pflag.FlagSet, prefix string)
- func BindListenArg(args *ListenArg, flags *pflag.FlagSet, prefix string)
- func BindMasterArgs(args *MasterArgs, flags *pflag.FlagSet, prefix string)
- func BindNetworkArgs(args *NetworkArgs, flags *pflag.FlagSet, prefix string)
- func BindNodeArgs(args *NodeArgs, flags *pflag.FlagSet, prefix string, components bool)
- func BindNodeNetworkArgs(args *NodeArgs, flags *pflag.FlagSet, prefix string)
- func BuildKubernetesMasterConfig(openshiftConfig *origin.MasterConfig) (*kubernetes.MasterConfig, error)
- func GetAllInOneArgs() (*MasterArgs, *NodeArgs, *ListenArg, *ImageFormatArgs, *KubeConnectionArgs)
- func NewNetworkComponentFlag() *utilflags.ComponentFlag
- func NewNodeComponentFlag() *utilflags.ComponentFlag
- func StartAPI(oc *origin.MasterConfig, kc *kubernetes.MasterConfig) error
- func StartNode(nodeConfig configapi.NodeConfig, components *utilflags.ComponentFlag) error
- func ValidateRuntime(config *configapi.NodeConfig, components *utilflags.ComponentFlag) error
- type AllInOneOptions
- type EtcdOptions
- type ImageFormatArgs
- type KubeConnectionArgs
- type ListenArg
- type Master
- type MasterArgs
- func (args MasterArgs) BuildSerializeableEtcdConfig() (*configapi.EtcdConfig, error)
- func (args MasterArgs) BuildSerializeableKubeMasterConfig() (*configapi.KubernetesMasterConfig, error)
- func (args MasterArgs) BuildSerializeableMasterConfig() (*configapi.MasterConfig, error)
- func (args MasterArgs) BuildSerializeableOAuthConfig() (*configapi.OAuthConfig, error)
- func (args MasterArgs) GetAssetPublicAddress() (*url.URL, error)
- func (args MasterArgs) GetConfigFileToWrite() string
- func (args MasterArgs) GetDNSBindAddress() (flagtypes.Addr, error)
- func (args MasterArgs) GetEtcdAddress() (*url.URL, error)
- func (args MasterArgs) GetEtcdBindAddress() string
- func (args MasterArgs) GetEtcdPeerAddress() (*url.URL, error)
- func (args MasterArgs) GetEtcdPeerBindAddress() string
- func (args MasterArgs) GetMasterAddress() (*url.URL, error)
- func (args MasterArgs) GetMasterPublicAddress() (*url.URL, error)
- func (args MasterArgs) GetPolicyFile() string
- func (args MasterArgs) GetServerCertHostnames() (sets.String, error)
- func (args MasterArgs) Validate() error
- type MasterOptions
- func NewCommandStartMaster(basename string, out io.Writer) (*cobra.Command, *MasterOptions)
- func NewCommandStartMasterAPI(name, basename string, out io.Writer) (*cobra.Command, *MasterOptions)
- func NewCommandStartMasterControllers(name, basename string, out io.Writer) (*cobra.Command, *MasterOptions)
- func (o *MasterOptions) Complete() error
- func (o MasterOptions) CreateBootstrapPolicy() error
- func (o MasterOptions) CreateCerts() error
- func (o *MasterOptions) DefaultsFromName(basename string)
- func (o MasterOptions) IsRunFromConfig() bool
- func (o MasterOptions) IsWriteConfigOnly() bool
- func (o MasterOptions) RunMaster() error
- func (o MasterOptions) StartMaster() error
- func (o MasterOptions) Validate(args []string) error
- type NetworkArgs
- type NodeArgs
- type NodeOptions
- func (o NodeOptions) Complete() error
- func (o NodeOptions) CreateNodeConfig() error
- func (o NodeOptions) IsRunFromConfig() bool
- func (o NodeOptions) IsWriteConfigOnly() bool
- func (options *NodeOptions) Run(c *cobra.Command, args []string)
- func (o NodeOptions) RunNode() error
- func (o NodeOptions) StartNode() error
- func (o NodeOptions) Validate(args []string) error
Constants ¶
const ( ComponentGroupNetwork = "network" ComponentProxy = "proxy" ComponentPlugins = "plugins" ComponentKubelet = "kubelet" )
const RecommendedStartEtcdServerName = "etcd"
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 ¶
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 ¶ added in v0.5.2
func BindNetworkArgs(args *NetworkArgs, flags *pflag.FlagSet, prefix string)
BindNetworkArgs binds values to the given arguments by using flags
func BindNodeArgs ¶
BindNodeArgs binds the options to the flags with prefix + default flag names
func BindNodeNetworkArgs ¶ added in v1.1.4
BindNodeNetworkArgs binds the options to the flags with prefix + default flag names
func BuildKubernetesMasterConfig ¶ added in v1.1.2
func BuildKubernetesMasterConfig(openshiftConfig *origin.MasterConfig) (*kubernetes.MasterConfig, error)
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 NewNetworkComponentFlag ¶ added in v1.1.4
func NewNetworkComponentFlag() *utilflags.ComponentFlag
NewNodeComponentFlag returns a flag capable of handling enabled components for the network
func NewNodeComponentFlag ¶ added in v1.1.4
func NewNodeComponentFlag() *utilflags.ComponentFlag
NewNodeComponentFlag returns a flag capable of handling enabled components for the node
func StartAPI ¶ added in v1.1.2
func StartAPI(oc *origin.MasterConfig, kc *kubernetes.MasterConfig) error
StartAPI starts the components of the master that are considered part of the API - the Kubernetes API and core controllers, the Origin API, the group, policy, project, and authorization caches, etcd, the asset server (for the UI), the OAuth server endpoints, and the DNS server. TODO: allow to be more granularly targeted
func StartNode ¶
func StartNode(nodeConfig configapi.NodeConfig, components *utilflags.ComponentFlag) error
func ValidateRuntime ¶ added in v1.1.4
func ValidateRuntime(config *configapi.NodeConfig, components *utilflags.ComponentFlag) error
Types ¶
type AllInOneOptions ¶
type AllInOneOptions struct { MasterOptions *MasterOptions NodeArgs *NodeArgs ConfigDir util.StringFlag NodeConfigFile string PrintIP bool ServiceNetworkCIDR string }
func NewCommandStartAllInOne ¶
NewCommandStartAllInOne provides a CLI handler for 'start' command
func (*AllInOneOptions) Complete ¶
func (o *AllInOneOptions) Complete() error
func (AllInOneOptions) IsRunFromConfig ¶ added in v0.5.1
func (o AllInOneOptions) IsRunFromConfig() bool
func (AllInOneOptions) IsWriteConfigOnly ¶ added in v0.5.1
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 EtcdOptions ¶ added in v1.1.2
func NewCommandStartEtcdServer ¶ added in v1.1.2
NewCommandStartEtcdServer starts only the etcd server
func (*EtcdOptions) RunEtcdServer ¶ added in v1.1.2
func (o *EtcdOptions) RunEtcdServer() error
RunEtcdServer takes the options and starts the etcd server
func (*EtcdOptions) StartEtcdServer ¶ added in v1.1.2
func (o *EtcdOptions) StartEtcdServer() error
StartEtcdServer calls RunEtcdServer and then waits forever
func (*EtcdOptions) Validate ¶ added in v1.1.2
func (o *EtcdOptions) Validate() 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 (KubeConnectionArgs) Validate ¶ added in v0.4.3
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
type Master ¶ added in v1.0.5
type Master struct {
// contains filtered or unexported fields
}
Master encapsulates starting the components of the master
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 // 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 // StartAPI controls whether the API component of the master is started (to support the API role) // TODO: once we implement bastion role and kube/os controller role, revisit StartAPI bool // StartControllers controls whether the controller component of the master is started (to support // the controller role) StartControllers bool PauseControllers bool // DNSBindAddr exposed for integration tests to set DNSBindAddr flagtypes.Addr // EtcdDir is the etcd data directory. EtcdDir string ConfigDir *util.StringFlag // 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 []string APIServerCAFiles []string ListenArg *ListenArg ImageFormatArgs *ImageFormatArgs KubeConnectionArgs *KubeConnectionArgs SchedulerConfigFile string NetworkArgs *NetworkArgs OverrideConfig func(config *configapi.MasterConfig) error }
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 ¶ added in v0.4.3
func (args MasterArgs) BuildSerializeableOAuthConfig() (*configapi.OAuthConfig, error)
func (MasterArgs) GetAssetPublicAddress ¶
func (args MasterArgs) GetAssetPublicAddress() (*url.URL, error)
func (MasterArgs) GetConfigFileToWrite ¶ added in v0.5.1
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 ¶ added in v0.4.3
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 ¶ added in v0.5.1
func (args MasterArgs) GetPolicyFile() string
GetPolicyFile returns the policy filepath for master
func (MasterArgs) GetServerCertHostnames ¶
func (args MasterArgs) GetServerCertHostnames() (sets.String, 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 CreateCertificates bool ConfigFile string Output io.Writer DisabledFeatures []string }
func NewCommandStartMaster ¶
NewCommandStartMaster provides a CLI handler for 'start master' command
func NewCommandStartMasterAPI ¶ added in v1.0.5
func NewCommandStartMasterAPI(name, basename string, out io.Writer) (*cobra.Command, *MasterOptions)
NewCommandStartMasterAPI starts only the APIserver
func NewCommandStartMasterControllers ¶ added in v1.0.5
func NewCommandStartMasterControllers(name, basename string, out io.Writer) (*cobra.Command, *MasterOptions)
NewCommandStartMasterControllers starts only the controllers
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) DefaultsFromName ¶ added in v1.0.5
func (o *MasterOptions) DefaultsFromName(basename string)
func (MasterOptions) IsRunFromConfig ¶ added in v0.5.1
func (o MasterOptions) IsRunFromConfig() bool
func (MasterOptions) IsWriteConfigOnly ¶ added in v0.5.1
func (o MasterOptions) IsWriteConfigOnly() bool
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 NetworkArgs ¶ added in v0.5.2
type NetworkArgs struct { // NetworkPluginName is the name of the networking plugin to be used for networking. NetworkPluginName string // ClusterNetworkCIDR is the CIDR string representing the network that all containers // should belong to. ClusterNetworkCIDR string // HostSubnetLength is the length of subnet each host is given from the network-cidr. HostSubnetLength uint // ServiceNetworkCIDR is the CIDR string representing the network that service IP // addresses will be allocated from ServiceNetworkCIDR string }
NetworkArgs is a struct that the command stores flag values into.
func NewDefaultNetworkArgs ¶ added in v0.5.2
func NewDefaultNetworkArgs() *NetworkArgs
NewDefaultNetworkArgs returns a new set of network arguments
type NodeArgs ¶
type NodeArgs struct { // Components is the set of enabled components. Components *utilflags.ComponentFlag // NodeName is the hostname to identify this node with the master. NodeName string MasterCertDir string ConfigDir util.StringFlag AllowDisabledDocker bool // VolumeDir is the volume storage directory. VolumeDir string DefaultKubernetesURL *url.URL ClusterDomain string ClusterDNS net.IP // NetworkPluginName is the network plugin to be called for configuring networking for pods. NetworkPluginName string ListenArg *ListenArg ImageFormatArgs *ImageFormatArgs KubeConnectionArgs *KubeConnectionArgs }
NodeArgs is a struct that the command stores flag values into. It holds a partially complete set of parameters for starting a node. 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
func (NodeArgs) GetServerCertHostnames ¶ added in v1.0.8
GetServerCertHostnames returns the set of hostnames and IP addresses a serving certificate for node on this host might need to be valid for.
type NodeOptions ¶
func NewCommandStartNetwork ¶ added in v1.1.4
NewCommandStartNetwork provides a CLI handler for 'start network' command
func NewCommandStartNode ¶
NewCommandStartNode provides a CLI handler for 'start node' command
func (NodeOptions) Complete ¶
func (o NodeOptions) Complete() error
func (NodeOptions) CreateNodeConfig ¶ added in v0.5.1
func (o NodeOptions) CreateNodeConfig() error
func (NodeOptions) IsRunFromConfig ¶ added in v0.5.1
func (o NodeOptions) IsRunFromConfig() bool
func (NodeOptions) IsWriteConfigOnly ¶ added in v0.5.1
func (o NodeOptions) IsWriteConfigOnly() bool
func (*NodeOptions) Run ¶ added in v1.1.4
func (options *NodeOptions) Run(c *cobra.Command, args []string)
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