diff --git a/cmd/openshift-install/create.go b/cmd/openshift-install/create.go index 5b7ce3836cc..3b9264d4a1f 100644 --- a/cmd/openshift-install/create.go +++ b/cmd/openshift-install/create.go @@ -2,7 +2,9 @@ package main import ( "context" + "encoding/json" "io/ioutil" + "os" "os/exec" "path/filepath" "strings" @@ -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 }