kxr / ocp4_setup_upi_kvm

Script to Setup an OpenShift 4 UPI Cluster on KVM. Based on this guide: https://kxr.me/2019/08/17/openshift-4-upi-install-libvirt-kvm/
52 stars 57 forks source link

~/.kube/config is not created #15

Closed Cheny-chen closed 4 years ago

Cheny-chen commented 4 years ago

Fedora 32 Linux kernel 5.8.9-200.fc32.x86_64 Red Hat OpenShit Version = 4.5.9 Red Hat CoreOS Version = 4.5.6

Install command ./ocp4_setup_upi_kvm.sh --cluster-name ocp4 --ocp-version 4.5.latest --pull-secret pull-secret --vm-dir /mnt/vms2/images

#################################

OPENSHIFT CLUSTERVERSION

#################################

====> Waiting for clusterversion: --> Working towards 4.5.9: 62% complete --> Patching ingress controller to run router pods on master nodes: ingresscontroller.operator.openshift.io/default patched --> Unable to apply 4.5.9: an unknown error has occurred: MultipleErrors --> Patching image registry to use EmptyDir: config.imageregistry.operator.openshift.io/cluster patched --> Working towards 4.5.9: 82% complete, waiting on authentication, cluste ... --> Working towards 4.5.9: 86% complete --> Working towards 4.5.9: 87% complete --> Unable to apply 4.5.9: the cluster operator operator-lifecycle-manager ... --> Unable to apply 4.5.9: the cluster operator operator-lifecycle-manager ...

######################################################

OPENSHIFT 4 INSTALLATION FINISHED SUCCESSFULLY

###################################################### time taken = 78 minutes

INFO Waiting up to 30m0s for the cluster at https://api.ocp4.local:6443 to initialize... INFO Waiting up to 10m0s for the openshift-console route to be created... INFO Install complete!
INFO To access the cluster as the system:admin user when using 'oc', run 'export KUBECONFIG=/root/ocp4_setup_ocp4/install_dir/auth/kubeconfig' INFO Access the OpenShift web-console here: https://console-openshift-console.apps.ocp4.local INFO Login to the console with user: "kubeadmin", and password: "JtLWu-Cnrj4-NsmCN-8YGch" INFO Time elapsed: 0s

[root@localhost ~]# oc login -u kubeamdin -p JtLWu-Cnrj4-NsmCN-8YGch https://api.ocp4.local:6443
The server uses a certificate signed by an unknown authority.
You can bypass the certificate check, but any data you send to the server could be intercepted by others.
Use insecure connections? (y/n): y

Login failed (401 Unauthorized)
Verify you have provided correct credentials.
[root@localhost ~]# oc get nodes
error: Missing or incomplete configuration info.  Please login or point to an existing, complete config file:

  1. Via the command-line flag --config
  2. Via the KUBECONFIG environment variable
  3. In your home directory as ~/.kube/config

To view or setup config directly use the 'config' command.

[root@localhost ~]# ls .kube/config ls: cannot access '.kube/config': No such file or directory [root@localhost ~]# kubectl version --client error: no configuration has been provided [root@localhost ~]# kubectl version --client=true error: no configuration has been provided

kxr commented 4 years ago

Check the kubeconfig and kubeadmin-password file in <setup-dir>/install_dir/auth/. You can copy it to the default location cp /<setup-dir>/install_dir/auth/kubeconfig /root/.kube/config

Cheny-chen commented 4 years ago

Check the kubeconfig and kubeadmin-password file in <setup-dir>/install_dir/auth/. You can copy it to the default location cp /<setup-dir>/install_dir/auth/kubeconfig /root/.kube/config

Thank you very much. It works.