Ejemplo n.º 1
0
// ServerInfo displays server information after a successful start
func (c *ClientStartConfig) ServerInfo(out io.Writer) error {
	metricsInfo := ""
	if c.ShouldInstallMetrics && c.ShouldInitializeData() {
		metricsInfo = fmt.Sprintf("The metrics service is available at:\n"+
			"    https://%s\n\n", openshift.MetricsHost(c.RoutingSuffix, c.ServerIP))
	}
	loggingInfo := ""
	if c.ShouldInstallLogging && c.ShouldInitializeData() {
		loggingInfo = fmt.Sprintf("The kibana logging UI is available at:\n"+
			"    https://%s\n\n", openshift.LoggingHost(c.RoutingSuffix, c.ServerIP))
	}
	msg := fmt.Sprintf("OpenShift server started.\n"+
		"The server is accessible via web console at:\n"+
		"    %s\n\n%s%s", c.OpenShiftHelper().Master(c.ServerIP), metricsInfo, loggingInfo)

	if c.ShouldCreateUser() {
		msg += fmt.Sprintf("You are logged in as:\n"+
			"    User:     %s\n"+
			"    Password: %s\n\n", initialUser, initialPassword)
	}

	msg += "To login as administrator:\n" +
		"    oc login -u system:admin\n\n"

	fmt.Fprintf(out, msg)
	return nil
}
Ejemplo n.º 2
0
// StartOpenShift starts the OpenShift container
func (c *ClientStartConfig) StartOpenShift(out io.Writer) error {
	var err error
	opt := &openshift.StartOptions{
		ServerIP:           c.ServerIP,
		RouterIP:           c.RouterIP,
		UseSharedVolume:    !c.UseNsenterMount,
		SetPropagationMode: c.SetPropagationMode,
		Images:             c.imageFormat(),
		HostVolumesDir:     c.HostVolumesDir,
		HostConfigDir:      c.HostConfigDir,
		HostDataDir:        c.HostDataDir,
		UseExistingConfig:  c.UseExistingConfig,
		Environment:        c.Environment,
		LogLevel:           c.ServerLogLevel,
		DNSPort:            c.DNSPort,
		PortForwarding:     c.PortForwarding,
	}
	if c.ShouldInstallMetrics {
		opt.MetricsHost = openshift.MetricsHost(c.RoutingSuffix, c.ServerIP)
	}
	if c.ShouldInstallLogging {
		opt.LoggingHost = openshift.LoggingHost(c.RoutingSuffix, c.ServerIP)
	}
	c.LocalConfigDir, err = c.OpenShiftHelper().Start(opt, out)
	return err
}
Ejemplo n.º 3
0
// InstallLogging will start the installation of logging components
func (c *ClientStartConfig) InstallLogging(out io.Writer) error {
	f, err := c.Factory()
	if err != nil {
		return err
	}
	publicMaster := c.PublicHostname
	if len(publicMaster) == 0 {
		publicMaster = c.ServerIP
	}
	return c.OpenShiftHelper().InstallLogging(f, publicMaster, openshift.LoggingHost(c.RoutingSuffix, c.ServerIP), c.Image, c.ImageVersion)
}