Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions cmd/kubelet-starter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package main

import (
"context"
"fmt"
"io/ioutil"
"os"
"os/exec"
Expand All @@ -25,6 +26,7 @@ import (

"github.com/vmware/vic/lib/config"
"github.com/vmware/vic/lib/constants"
"github.com/vmware/vic/lib/portlayer/util"
viclog "github.com/vmware/vic/pkg/log"
"github.com/vmware/vic/pkg/log/syslog"
"github.com/vmware/vic/pkg/trace"
Expand Down Expand Up @@ -75,12 +77,27 @@ func main() {
viclog.Init(logcfg)
trace.InitLogger(logcfg)

// Get the port numbers for Docker and Portlayer
personaPort := os.Getenv("PERSONA_PORT")
portlayerPort := os.Getenv("PORTLAYER_PORT")

if vchConfig.Diagnostics.DebugLevel > 2 {
// expose portlayer service on client interface
plPort := constants.DebugPortLayerPort
os.Setenv("PORTLAYER_ADDR", strconv.Itoa(plPort))
portlayerPort = strconv.Itoa(constants.DebugPortLayerPort)
}

clientIP, err := util.ClientIP()

if err != nil {
op.Fatalf("Cannot get Client IP err: %s", err)
}

personaAddr := fmt.Sprintf("%s:%s", clientIP, personaPort)
portlayerAddr := fmt.Sprintf("%s:%s", clientIP, portlayerPort)

os.Setenv("PERSONA_ADDR", personaAddr)
os.Setenv("PORTLAYER_ADDR", portlayerAddr)

op.Infof("KUBELET_NAME = %s", os.Getenv("KUBELET_NAME"))
op.Infof("KUBERNETES_SERVICE_HOST = %s", os.Getenv("KUBERNETES_SERVICE_HOST"))
op.Infof("KUBERNETES_SERVICE_PORT = %s", os.Getenv("KUBERNETES_SERVICE_PORT"))
Expand Down
2 changes: 2 additions & 0 deletions cmd/vicadmin/vicadm.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ var (
"port-layer.log",
"vicadmin.log",
"init.log",
"kubelet-starter.log",
"virtual-kubelet.log",
}

// VMFiles is the set of files to collect per VM associated with the VCH
Expand Down
8 changes: 8 additions & 0 deletions isos/vicadmin/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ <h3 class="card-title">Logs</h3>
<div class="sixty"><a href="/logs/vicadmin.log">Admin Server</a></div>
<div class="forty"><a href="/logs/tail/vicadmin.log">Live Log</a></div>
</div>
<div class="row">
<div class="sixty"><a href="/logs/kubelet-starter.log">Kubelet Starter</a></div>
<div class="forty"><a href="/logs/tail/kubelet-starter.log">Live Log</a></div>
</div>
<div class="row">
<div class="sixty"><a href="/logs/virtual-kubelet.log">Virtual Kubelet</a></div>
<div class="forty"><a href="/logs/tail/virtual-kubelet.log">Live Log</a></div>
</div>
{{else}}
<div class="row">
<div class="sixty">
Expand Down
4 changes: 2 additions & 2 deletions lib/install/management/appliance.go
Original file line number Diff line number Diff line change
Expand Up @@ -624,8 +624,8 @@ func (d *Dispatcher) createAppliance(conf *config.VirtualContainerHostConfigSpec
kubeletStarter.Env = append(kubeletStarter.Env, fmt.Sprintf("%s=%s", "KUBELET_NAME", kubeletName))

// Set up the persona and port layer
kubeletStarter.Env = append(kubeletStarter.Env, fmt.Sprintf("%s=%s:%s", "PERSONA_ADDR", "localhost", d.DockerPort))
kubeletStarter.Env = append(kubeletStarter.Env, fmt.Sprintf("%s=%s:%d", "PORTLAYER_ADDR", "localhost", portLayerPort))
kubeletStarter.Env = append(kubeletStarter.Env, fmt.Sprintf("%s=%s", "PERSONA_PORT", d.DockerPort))
kubeletStarter.Env = append(kubeletStarter.Env, fmt.Sprintf("%s=%d", "PORTLAYER_PORT", portLayerPort))

if settings.HTTPProxy != nil {
kubeletStarter.Env = append(kubeletStarter.Env, fmt.Sprintf("%s=%s", config.GeneralHTTPProxy, settings.HTTPProxy.String()))
Expand Down