Installing OpenShift

Note: This is part of a series. Make sure you started here: Building a Portable Kubernetes Home Lab with OpenShift - OKD4

We are now ready to fire up our OpenShift cluster

  1. Deploy the configuration in preparation for the install:

    labcli --deploy -c -d=dev
    
  2. Disconnect the lab domain from the internet:

    labcli --disconnect -d=dev
    
  3. Start the bootstrap node:

    labcli --start -b -d=dev
    
  4. KVM Based Control-Plane:

    Start the control-plane nodes:

    labcli --start -m -d=dev
    
  5. Bare Metal Cluster or SNO:

    Hit the power button on the control-plane NUCs

  6. Monitor the bootstrap process:

    labcli --monitor -b -d=dev
    

    Note: This command does not affect to install process. You can stop and restart it safely. It is just for monitoring the bootstrap.

    If you want to watch logs for issues:

    ssh core@okd4-bootstrap.${SUB_DOMAIN}.${LAB_DOMAIN} "journalctl -b -f -u release-image.service -u bootkube.service"
    
  7. You will see the following, when the bootstrap is complete:

    INFO Waiting up to 20m0s for the Kubernetes API at https://api.okd4.dev.my.awesome.lab:6443... 
    DEBUG Still waiting for the Kubernetes API: an error on the server ("") has prevented the request from succeeding 
    INFO API v1.20.0-1085+01c9f3f43ffcf0-dirty up     
    INFO Waiting up to 30m0s for bootstrapping to complete... 
    DEBUG Bootstrap status: complete                   
    INFO It is now safe to remove the bootstrap resources 
    DEBUG Time elapsed per stage:                      
    DEBUG Bootstrap Complete: 11m16s                   
    DEBUG                API: 3m5s                     
    INFO Time elapsed: 11m16s
    
  8. When the bootstrap process is complete, remove the bootstrap node:

    labcli --destroy -b -d=dev
    

    This script shuts down and then deletes the Bootstrap VM. Then it removes the bootstrap entries from the HA Proxy configuration.

  9. Monitor the installation process:

    labcli --monitor -i -d=dev
    
  10. Fix for a stuck MCO

    In some recent versions of OKD, the Machine Config Operator cannot complete the installation because it is looking for a non-existent machine config.

    See: https://github.com/openshift/okd/issues/963

    labenv -k
    oc delete mc 99-master-okd-extensions 99-okd-master-disable-mitigations
    

    This will force a recreation of the control plane machine configs, and will allow the install to complete.

  11. Installation Complete:

    DEBUG Cluster is initialized                       
    INFO Waiting up to 10m0s for the openshift-console route to be created... 
    DEBUG Route found in openshift-console namespace: console 
    DEBUG OpenShift console route is admitted          
    INFO Install complete!                            
    INFO To access the cluster as the system:admin user when using 'oc', run 'export KUBECONFIG=/Users/yourhome/okd-lab/okd-install-dir/auth/kubeconfig' 
    INFO Access the OpenShift web-console here: https://console-openshift-console.apps.okd4.dev.my.awesome.lab 
    INFO Login to the console with user: "kubeadmin", and password: "AhnsQ-CGRqg-gHu2h-rYZw3" 
    DEBUG Time elapsed per stage:                      
    DEBUG Cluster Operators: 13m49s                    
    INFO Time elapsed: 13m49s
    
  12. Post Install:

    labcli --post -d=dev
    
  13. Add Users:

    Add a cluster-admin user:

    Note: You can ignore the warning: Warning: User 'admin' not found

    labcli --user -i -a -u=admin -d=dev
    

    Add a non-privileged user:

    labcli --user -u=devuser -d=dev
    

Grow Your Lab

Add Worker Nodes

Add worker nodes to OpenShift cluster with OKD

Add Ceph Storage Provisioner

Install Ceph Storage with Rook