Skip to content

Commit

Permalink
add logs at end of install for kubeadmin, consoleURL
Browse files Browse the repository at this point in the history
  • Loading branch information
sallyom committed Dec 6, 2018
1 parent b4f5ceb commit 1e92fa7
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions cmd/openshift-install/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ package main

import (
"context"
"encoding/json"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"strings"
Expand Down Expand Up @@ -268,13 +270,25 @@ func logComplete(directory string) error {
if err != nil {
return err
}
tfvarsFile := filepath.Join(absDir, cluster.TfVarsFileName)
f, err := os.Open(tfvarsFile)
if err != nil {
return err
}
defer f.Close()
tfVars, _ := ioutil.ReadAll(f)
var result map[string]interface{}
json.Unmarshal([]byte(tfVars), &result)
clusterName := result["cluster_name"]
baseDomain := result["base_domain"]
kubeconfig := filepath.Join(absDir, "auth", "kubeconfig")
pwFile := filepath.Join(absDir, "auth", "kubeadmin-password")
pw, err := ioutil.ReadFile(pwFile)
if err != nil {
return err
}
logrus.Infof("kubeadmin user password: %s", pw)
logrus.Infof("Install complete! The kubeconfig is located here: %s", kubeconfig)
logrus.Infof("Install complete! To manage the cluster with 'oc', the OpenShift CLI, first run 'export KUBECONFIG=%s'", kubeconfig)
logrus.Infof("The cluster is ready when this command succeeds (wait a few minutes): 'oc login -u kubeadmin -p %s'", pw)
logrus.Infof("Access the OpenShift web-console here with user: kubeadmin and pw: %s, `https://console-openshift-console.apps.%s.%s`", pw, clusterName, baseDomain)
return nil
}

0 comments on commit 1e92fa7

Please sign in to comment.