openshift

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2017 License: Apache-2.0 Imports: 50 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultNamespace  = "default"
	SvcDockerRegistry = "docker-registry"
	SvcRouter         = "router"

	RegistryServiceIP = "172.30.1.1"
)
View Source
const (
	DefaultDNSPort   = 53
	AlternateDNSPort = 8053

	OpenShiftContainer = "origin"
)

Variables

View Source
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 AddClusterRole(osClient client.Interface, role, user string) error

func AddRoleToServiceAccount added in v1.4.0

func AddRoleToServiceAccount(osClient client.Interface, role, sa, namespace string) error

func AddSCCToServiceAccount added in v1.4.0

func AddSCCToServiceAccount(kubeClient kclientset.Interface, scc, sa, namespace string) error

func CheckSocat

func CheckSocat() error

func CreateProject

func CreateProject(f *clientcmd.Factory, name, display, desc, basecmd string, out io.Writer) error

CreateProject creates a project

func ErrOpenShiftFailedToStart

func ErrOpenShiftFailedToStart(container string) errors.Error

ErrOpenShiftFailedToStart is thrown when the OpenShift server failed to start

func ErrPortsNotAvailable

func ErrPortsNotAvailable(ports []int) error

func ErrSocatNotFound

func ErrSocatNotFound() errors.Error

func ErrTimedOutWaitingForStart

func ErrTimedOutWaitingForStart(container string) errors.Error

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 *docker.Client) (*configapi.MasterConfig, error)

func ImportObjects

func ImportObjects(f *clientcmd.Factory, ns, location string) error

ImportObjects imports objects into OpenShift from a particular location into a given namespace

func IsPortsNotAvailableErr

func IsPortsNotAvailableErr(err error) bool

func KillExistingSocat

func KillExistingSocat() error

func LoggedInUserFactory added in v1.4.0

func LoggedInUserFactory() (*clientcmd.Factory, error)

func LoggingHost added in v1.4.0

func LoggingHost(routingSuffix, serverIP string) string

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 MetricsHost(routingSuffix, serverIP string) string

func SaveSocatPid

func SaveSocatPid(pid int) error

func UnavailablePorts

func UnavailablePorts(err error) []int

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(client *docker.Client, hostHelper *host.HostHelper, image, containerName, publicHostname, routingSuffix string) *Helper

NewHelper creates a new OpenShift helper

func (*Helper) DetermineNodeHost

func (h *Helper) DetermineNodeHost(hostConfigDir string, names ...string) (string, error)

func (*Helper) GetConfigFromLocalDir added in v1.4.0

func (h *Helper) GetConfigFromLocalDir(configDir string) (*configapi.MasterConfig, string, error)

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