Documentation ¶
Index ¶
- Constants
- Variables
- func AddClusterRole(osClient client.Interface, role, user string) error
- func AddRoleToServiceAccount(osClient client.Interface, role, sa, namespace string) error
- func AddSCCToServiceAccount(kubeClient kclientset.Interface, scc, sa, namespace string) error
- func CatalogHost(routingSuffix, serverIP string) string
- func CheckSocat() error
- func CreateProject(f *clientcmd.Factory, name, display, desc, basecmd string, out io.Writer) error
- func ErrOpenShiftFailedToStart(container string) errors.Error
- func ErrPortsNotAvailable(ports []int) error
- func ErrSocatNotFound() errors.Error
- func ErrTimedOutWaitingForStart(container string) errors.Error
- func GetConfigFromContainer(client dockerhelper.Interface) (*configapi.MasterConfig, error)
- func ImportObjects(f *clientcmd.Factory, ns, location string) error
- func IsPortsNotAvailableErr(err error) bool
- func KillExistingSocat() error
- func LoggedInUserFactory() (*clientcmd.Factory, error)
- func LoggingHost(routingSuffix, serverIP string) string
- func Login(username, password, server, configDir string, f *clientcmd.Factory, ...) error
- func MetricsHost(routingSuffix, serverIP string) string
- func SaveSocatPid(pid int) error
- func UnavailablePorts(err error) []int
- type Helper
- func (h *Helper) CheckNodes(kclient kclientset.Interface) error
- func (h *Helper) DetermineNodeHost(hostConfigDir string, names ...string) (string, error)
- func (h *Helper) GetConfigFromLocalDir(configDir string) (*configapi.MasterConfig, string, error)
- func (h *Helper) GetNodeConfigFromLocalDir(configDir string) (*configapi.NodeConfig, string, error)
- func (h *Helper) InstallLogging(f *clientcmd.Factory, ...) error
- func (h *Helper) InstallLoggingViaAnsible(f *clientcmd.Factory, ...) error
- func (h *Helper) InstallMetrics(f *clientcmd.Factory, hostName, imagePrefix, imageVersion string) error
- func (h *Helper) InstallMetricsViaAnsible(f *clientcmd.Factory, ...) error
- func (h *Helper) InstallRegistry(kubeClient kclientset.Interface, f *clientcmd.Factory, ...) error
- func (h *Helper) InstallRouter(kubeClient kclientset.Interface, f *clientcmd.Factory, ...) error
- func (h *Helper) InstallServiceCatalog(f *clientcmd.Factory, publicMaster, catalogHost string) error
- func (h *Helper) Master(ip string) string
- func (h *Helper) OriginLog() string
- func (h *Helper) OtherIPs(excludeIP string) ([]string, error)
- func (h *Helper) ServerIP() (string, error)
- func (h *Helper) ServerPrereleaseVersion() (semver.Version, error)
- func (h *Helper) ServerVersion() (semver.Version, error)
- func (h *Helper) SetupPersistentStorage(osclient client.Interface, kclient kclientset.Interface, dir string) error
- func (h *Helper) Start(opt *StartOptions, out io.Writer) (string, error)
- func (h *Helper) StartNode(opt *StartOptions, out io.Writer) error
- func (h *Helper) TestContainerNetworking(ip string) error
- func (h *Helper) TestForwardedIP(ip string) error
- func (h *Helper) TestIP(ip string) error
- func (h *Helper) TestPorts(ports []int) error
- type StartOptions
Constants ¶
const ( DefaultNamespace = "default" SvcDockerRegistry = "docker-registry" SvcRouter = "router" RegistryServiceIP = "172.30.1.1" )
const ( DefaultDNSPort = 53 AlternateDNSPort = 8053 OpenShiftContainer = "origin" OpenshiftNamespace = "openshift" OpenshiftInfraNamespace = "openshift-infra" )
const (
ServiceCatalogServiceIP = "172.30.1.2"
)
Variables ¶
var ( BasePorts = []int{4001, 7001, 8443, 10250} RouterPorts = []int{80, 443} DefaultPorts = append(BasePorts, DefaultDNSPort) PortsWithAlternateDNS = append(BasePorts, AlternateDNSPort) AllPorts = append(append(RouterPorts, DefaultPorts...), AlternateDNSPort) SocatPidFile = filepath.Join(homedir.HomeDir(), cliconfig.OpenShiftConfigHomeDir, "socat-8443.pid") )
Functions ¶
func AddClusterRole ¶ added in v1.4.0
func AddRoleToServiceAccount ¶ added in v1.4.0
func AddSCCToServiceAccount ¶ added in v1.4.0
func AddSCCToServiceAccount(kubeClient kclientset.Interface, scc, sa, namespace string) error
func CatalogHost ¶
func CheckSocat ¶
func CheckSocat() error
func CreateProject ¶
CreateProject creates a project
func ErrOpenShiftFailedToStart ¶
ErrOpenShiftFailedToStart is thrown when the OpenShift server failed to start
func ErrPortsNotAvailable ¶
func ErrSocatNotFound ¶
func ErrTimedOutWaitingForStart ¶
ErrTimedOutWaitingForStart is thrown when the OpenShift server can't be pinged after reasonable amount of time.
func GetConfigFromContainer ¶ added in v1.4.0
func GetConfigFromContainer(client dockerhelper.Interface) (*configapi.MasterConfig, error)
func ImportObjects ¶
ImportObjects imports objects into OpenShift from a particular location into a given namespace
func IsPortsNotAvailableErr ¶
func KillExistingSocat ¶
func KillExistingSocat() error
func LoggedInUserFactory ¶ added in v1.4.0
func LoggingHost ¶ added in v1.4.0
func Login ¶
func Login(username, password, server, configDir string, f *clientcmd.Factory, c *cobra.Command, out io.Writer) error
Login logs into the specified server using given credentials and CA file
func MetricsHost ¶
func SaveSocatPid ¶
func UnavailablePorts ¶
Types ¶
type Helper ¶
type Helper struct {
// contains filtered or unexported fields
}
Helper contains methods and utilities to help with OpenShift startup
func NewHelper ¶
func NewHelper(dockerHelper *dockerhelper.Helper, hostHelper *host.HostHelper, image, containerName, publicHostname, routingSuffix string) *Helper
NewHelper creates a new OpenShift helper
func (*Helper) CheckNodes ¶
func (h *Helper) CheckNodes(kclient kclientset.Interface) error
CheckNodes determines if there is more than one node that corresponds to the current machine and removes the one that doesn't match the default node name
func (*Helper) DetermineNodeHost ¶
func (*Helper) GetConfigFromLocalDir ¶ added in v1.4.0
func (*Helper) GetNodeConfigFromLocalDir ¶
func (*Helper) InstallLogging ¶ added in v1.4.0
func (h *Helper) InstallLogging(f *clientcmd.Factory, publicHostname, loggerHost, imagePrefix, imageVersion string) error
InstallLogging checks whether logging is installed and installs it if not already installed
func (*Helper) InstallLoggingViaAnsible ¶
func (h *Helper) InstallLoggingViaAnsible(f *clientcmd.Factory, serverIP, publicHostname, loggerHost, imagePrefix, imageVersion, hostConfigDir, imageStreams string) error
InstallLoggingViaAnsible checks whether logging is installed and installs it if not already installed
func (*Helper) InstallMetrics ¶
func (h *Helper) InstallMetrics(f *clientcmd.Factory, hostName, imagePrefix, imageVersion string) error
InstallMetrics checks whether metrics is installed and installs it if not already installed
func (*Helper) InstallMetricsViaAnsible ¶
func (h *Helper) InstallMetricsViaAnsible(f *clientcmd.Factory, serverIP, publicHostname, hostName, imagePrefix, imageVersion, hostConfigDir, imageStreams string) error
InstallMetricsViaAnsible checks whether metrics is installed and installs it if not already installed
func (*Helper) InstallRegistry ¶
func (h *Helper) InstallRegistry(kubeClient kclientset.Interface, f *clientcmd.Factory, configDir, images, pvDir string, out, errout io.Writer) error
InstallRegistry checks whether a registry is installed and installs one if not already installed
func (*Helper) InstallRouter ¶
func (h *Helper) InstallRouter(kubeClient kclientset.Interface, f *clientcmd.Factory, configDir, images, hostIP string, portForwarding bool, out, errout io.Writer) error
InstallRouter installs a default router on the OpenShift server
func (*Helper) InstallServiceCatalog ¶
func (h *Helper) InstallServiceCatalog(f *clientcmd.Factory, publicMaster, catalogHost string) error
InstallServiceCatalog checks whether the service catalog is installed and installs it if not already installed
func (*Helper) OtherIPs ¶
OtherIPs tries to find other IPs besides the argument IP for the Docker host
func (*Helper) ServerPrereleaseVersion ¶
func (*Helper) SetupPersistentStorage ¶
func (*Helper) Start ¶
Start starts the OpenShift master as a Docker container and returns a directory in the local file system where the OpenShift configuration has been copied
func (*Helper) StartNode ¶
func (h *Helper) StartNode(opt *StartOptions, out io.Writer) error
StartNode starts the OpenShift node as a Docker container and returns a directory in the local file system where the OpenShift configuration has been copied
func (*Helper) TestContainerNetworking ¶
TestContainerNetworking launches a container that will check whether the container can communicate with the master API and DNS endpoints.
func (*Helper) TestForwardedIP ¶
type StartOptions ¶
type StartOptions struct { ServerIP string AdditionalIPs []string RoutingSuffix string DNSPort int Images string HostVolumesDir string HostConfigDir string HostDataDir string HostPersistentVolumesDir string UseExistingConfig bool Environment []string LogLevel int MetricsHost string LoggingHost string PortForwarding bool HTTPProxy string HTTPSProxy string NoProxy []string KubeconfigContents string DockerRoot string ServiceCatalog bool }
StartOptions represent the parameters sent to the start command