[OpenShift] – Getting started with a cluster installation

Evaluate installation

If your intention is just checking how it works and/or contribute with it then I’d like to recommend you install locally the Minishift which will be easier.

Cluster Installation

 

1_hX5dwGlqq4-myZNSbYwZ7g

The following content is based on in the Enterprise installation, however, it will be similar and it will be helpful if you are trying to do a cluster installation for the OKD version. Follow up the proper documentation according to the type/version.

Install the OpenShift in a cluster can be really tricky, the first recommendation is to follow up sequentially the documentation steps. The installation is based on the usage of Ansible scripts implemented and offered by the product to do it. The host file in the default/example contains the configuration variables and you will find in this documentation the description of them as the options/values which you can use.

Following the Steps and Tips

  • Planning your installation: In this step is required measure according to the business requirements how many master and nodes the installation should have as its specifications.
  • System and environment requirements and Preparing your hosts: In these step are required to check the minimal resources for each node and master, and the system and libs/tools versions required in each one as perform some actions in order to ensure that all which is required to install the OpenShift will be properly made.
  • Configuring Your Inventory File: This is the part where you will spend more effort. After the installation is possible to do changes in the configuration, however, the best approach is the inventory file contemplate all that is required to be done as the correct values. So, you will be able to follow up the docs, however, unfortunately, some variables and setups required are not covered by them.

tips

  1. The best approach is to use and/or create your own from the scratch however based on some examples.  See here.
  2. Also, always check the release notes of the version where important and useful information will be found.
  3. The OpenShift will generate a lot of logs and metrics then NFS to storage then is not the best option at all.
  4. Check an example of [OSEv3:vars] map here.
  • Installing: The installation is based on install the Openshift client ($yum -y install atomic-openshift-clients openshift-ansible) and runs the Ansible scripts which are provided into it, note that it is divided into two steps/scripts. You will first run the playbooks/prerequisites.yml then you will run the playbooks/deploy_cluster.yml.

tips Following a few checks that are good to do be done before running the scripts.

  1. Check if you are able to access the hosts mapped by using $ ansible all -m ping.
  2. Check if the Docker is installed and its version by using $ ansible nodes -m shell -a”systemctl status docker | grep Active” and $ ansible nodes -m shell -a”docker version|grep Version”
  3. Verify the yum repositories by $ ansible all -m shell -a”yum repolist”
  • Check the installation: Before continue is required to check if the OpenShift was installed properly. Following some tips.
    • Login as admin. ($ oc login -u system:admin)
    • Check the nodes. ($ oc get nodes )
    • Check that all pods are running. ($oc get pods –all-namespaces -o wide)
    • Check the events. ($ oc get events –sort-by=’.lastTimestamp’)
    • Connect in the Openshift web console. The URL for it is defined in the host file, for example, it will be in the openshift_master_cluster_public_hostname variable definition if it was set up to have public access.
    • Create a mock-test project in order to verify if the application will be deployed in the pods and try to create a database to check the storage setup of it.

tips

  1. See the section known issues in order to try to solve problems which may be faced.
  2. The best approach is to identify the issue and perform the fix in the host file then uninstall the product and try to install it again instead of working on to fix the installation performed.
    # Run the uninstall playbook: 
    $ ansible-playbook /usr/share/ansible/openshift-ansible/playbooks/adhoc/uninstall.yml 
    # To delete all left over content for example certificates.
    $ ansible nodes -m shell -a "rm -rf /etc/origin"
    # Make sure to clean out any NFS if it is the storage option used 
    $ ansible nfs -m shell -a 'rm -rf /srv/nfs/*'
  3. In the case of some issue be faced to check the logs and use the verbose levels in order to try to get further information as for example $ ansible-playbook playbooks/deploy_cluster.yml –vvvv.
  • Post Actions: It is possible that be required to perform some steps after the installation as for example creates PVs, and/or sync LDAP groups for example in the master,  and/or some others extra configurations which were not mapped to be done in the installation process.

 tips See a summary with useful oc commands which can be helpful here

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s