openshift

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2016 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultDNSPort   = 53
	AlternateDNSPort = 8053
)

Variables

View Source
var (
	BasePorts             = []int{80, 443, 4001, 7001, 8443, 10250}
	DefaultPorts          = append(BasePorts, DefaultDNSPort)
	PortsWithAlternateDNS = append(BasePorts, AlternateDNSPort)
	SocatPidFile          = filepath.Join(homedir.HomeDir(), cliconfig.OpenShiftConfigHomeDir, "socat-8443.pid")
)

Functions

func CheckSocat

func CheckSocat() error

func CreateProject

func CreateProject(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 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 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) 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) InstallRegistry

func (h *Helper) InstallRegistry(kubeClient kclient.Interface, f *clientcmd.Factory, configDir, images string, out 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 kclient.Interface, f *clientcmd.Factory, configDir, images, hostIP string, portForwarding bool, out io.Writer) error

InstallRouter installs a default router on the OpenShift server

func (*Helper) Master

func (h *Helper) Master(ip string) string

func (*Helper) OriginLog

func (h *Helper) OriginLog() string

func (*Helper) OtherIPs

func (h *Helper) OtherIPs(excludeIP string) ([]string, error)

OtherIPs tries to find other IPs besides the argument IP for the Docker host

func (*Helper) ServerIP

func (h *Helper) ServerIP() (string, error)

ServerIP retrieves the Server ip through the openshift start command

func (*Helper) Start

func (h *Helper) Start(opt *StartOptions, out io.Writer) (string, error)

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

func (h *Helper) TestForwardedIP(ip string) error

func (*Helper) TestIP

func (h *Helper) TestIP(ip string) error

func (*Helper) TestPorts

func (h *Helper) TestPorts(ports []int) error

type StartOptions

type StartOptions struct {
	ServerIP           string
	DNSPort            int
	UseSharedVolume    bool
	SetPropagationMode bool
	Images             string
	HostVolumesDir     string
	HostConfigDir      string
	HostDataDir        string
	UseExistingConfig  bool
	Environment        []string
	LogLevel           int
	MetricsHost        string
	PortForwarding     bool
}

StartOptions represent the parameters sent to the start command

Jump to

Keyboard shortcuts

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