GUIDE: Install OpenShift 4 — The Easy Way — Part 2
--
In Part 1 of this guide we install a three-node OCP 4.7 cluster using the assisted installer. In Part 2 we will:
- Download and configure the oc client
- Setup an authentication provider using htpasswd
- Configure the registry (non-production)
- Create an ephemeral Drupal project.
Download the oc client:
Browse to https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable/ and download the client appropriate for your system.
For Linux clients, wget the client tar file, extract the client tar file, and move the kubectl and oc executables to /usr/local/bin:
wget https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable/openshift-client-linux.tar.gz
tar -zxvf openshift-client-linux.tar.gz
sudo mv kubectl/usr/local/bin/
Test the oc client:
Download the kubeconfig for your cluster from cloud.redhat.com:
Set the KUBECONFIG environment variable and test the connection:
export KUBECONFIG=~/Downloads/kubeconfig
oc get nodes
Running ‘oc get nodes’ should return the information pictured above.
Setup an authentication provider using htpasswd:
The kubeadmin user is not for permanent use, instead you should setup other means of authentication. The easiest way to set up a local user is with htpasswd. Create the users.htpasswd using the following command for testuser:
htpasswd -c -B users.htpasswd testuser
Create a secret in the openshift-config project using the users.htpasswd file you generated:
oc create secret…