<commit_before>
=============================================
OpenShift Installation - Standalone and HA
=============================================

.. contents::
   :local:
   :depth: 3
   

Supported Platforms
====================

The VSP integration with OpenShift is supported on RHEL Server hosts (Version 7.4).

.. Note:: For information on other supported platforms and distributions, see the *Nuage VSP Release Notes*.


Ansible Installation
==========================

You only need to install Ansible once on a machine and it can manage the master and all the other remote nodes. Ansible manages nodes using the SSH protocol, therefore it is required that SSH is setup so that the master and nodes are accessible from the host running the Ansible scripts.

.. Note:: SSH Protocol does not require a password.

The Ansible Version to be used is 2.3. To check or install ansible version 2.3, follow the below steps:

    ::

         [root@ansible-host ~]# ansible --version
         ansible 2.4.2.0
         
         [root@ansible-host ~]# sudo pip install ansible==2.3
         
         
OpenShift DaemonSet for Nuage installation
===========================================

DaemonSet is used for installation of Nuage containerized services as part of the OpenShift Ansible Installation for Nuage. The nuage-openshift-monitor, CNI plugin, nuage-infra pod and VRS operate as DaemonSet pods on master and slave nodes.

.. Note:: Nuage recommends using Daemonsets for installation of Nuage services.

Pre-Installation Steps in VSD
-----------------------------
1. Login to VSD UI as csproot and create an  "openshift" Enterprise.

2. Under the "openshift" Enterprise, create a user "ose-admin" and add the user to the "Administrators" group. It is mandatory to add the user to the "Administrators" group on the VSD.

   .. Note:: The steps to create the user and adding the user to a particular group can be found in the "CSP User Management" section in the "Nuage VSP User Guide."

3. Login to the VSD node using the CLI and execute the following command. The certificates must be placed in the /usr/local or any specified directory on the host where ansible is run.

    ::

         /opt/vsd/ejbca/deploy/certMgmt.sh -a generate -u ose-admin -c ose-admin -o openshift -f pem -t client -s root@<ose-ansible-IP>:/usr/local/

         Where:
         -a <action>         Action [generate|revoke|delete|renew|bscopy]
         -u <username>       End-entity Username
         -c <commonName>     Common Name. Needs to match VSD Username
         -o <organization>   Organization. Needs to match VSD Organization
         -f <format>         Certificate Format [pem|jks|p12]
         -t <type>           Certificate Type [client|server|vsc|vrs]
         -s <scpUrl>         The remote scp url. (eg. root@myhost://home/certs/)


    .. Note:: The above command generates the client certificates for the "ose-admin" user and copies it to the /usr/local/ or any specified directory of the OSE node where Ansible is run. This certificate information is used by the nuage-openshift-monitor to securely communicate with the VSD.

Using Git
-------------

You need to have Git installed on your Ansible machine. Perform the following tasks:

1. Make sure https://github.com is reachable from your Ansible machine.

2. Setup SSH and access the master and the minion nodes, using the **ssh** command.

.. Note:: set-up passwordless **ssh** between Ansible node and cluster nodes.
   
3. Copy the nuage-ose-rhel-install-<version>.tar file shipped with the specific Nuage Release to a host machine where Ansible is run.

4. Untar the above image

   ::
   
       [root@ovs-10 ~]# tar -xvf nuage-ose-rhel-install.tar 
       etcd_certificates.yml
       nuage-infra-pod-config-daemonset.j2
       nuage-openshift-ansible.diff
       patch-nuage-openshift-ansible.sh

      
5. Run the patch-nuage-openshift-ansible.sh script to clone the ansible repo and set up Nuage changes.

   .. Note:: The tag version may change based on the Nuage release you use.
   
   ::

      [root@ansible-mc ~]# ./patch-nuage-openshift-ansible.sh 
      Cloning into 'openshift-ansible'...
      remote: Counting objects: 74439, done.
      remote: Compressing objects: 100% (7/7), done.
      remote: Total 74439 (delta 4), reused 2 (delta 2), pack-reused 74430
      Receiving objects: 100% (74439/74439), 18.85 MiB | 3.60 MiB/s, done.
      Resolving deltas: 100% (46284/46284), done.
      Checking connectivity... done.
      Note: checking out 'tags/openshift-ansible-3.7.0-0.116.0'.

      You are in 'detached HEAD' state. You can look around, make experimental
      changes and commit them, and you can discard any commits you make in this
      state without impacting any branches by performing another checkout.

      If you want to create a new branch to retain commits you create, you may
      do so (now or later) by using -b with the checkout command again. Example:

      git checkout -b <new-branch-name>

      HEAD is now at cc47755... Automatic commit of package [openshift-ansible] release [3.7.0-0.116.0].
      Successfully patched Nuage ansible changes into openshift-ansible
      You may now use the openshift-ansible folder for your ansible installation


Setup
----------

1. To prepare the OpenShift cluster for installation, follow the OpenShift Host Preparation guide.
   
   For Nuage releases prior to 5.2.1, go `here <https://docs.openshift.com/container-platform/3.5/install_config/install/host_preparation.html>`_.
   
   For Nuage releases 5.2.1, go `here <https://docs.openshift.com/container-platform/3.6/install_config/install/host_preparation.html>`_. 

   For Nuage releases 5.2.2, go `here <https://docs.openshift.com/container-platform/3.7/install_config/install/host_preparation.html>`_. 
   
   .. Note:: Skip the yum update part in the OpenShift Host Preparation guide.


2. Load the following docker images on your master node:

   ::
   
       nuage-master-docker-<version>.tar
       nuage-cni-docker-<version>.tar
       nuage-vrs-docker-<version>.tar
       nuage-infra-docker-<version>.tar

3. Load the following docker images on your slave nodes:

   ::
   <commit_msg>Update Openshift-Installation.rst<commit_after>
=============================================
OpenShift Installation - Standalone and HA
=============================================

.. contents::
   :local:
   :depth: 3
   

Supported Platforms
====================

The VSP integration with OpenShift is supported on RHEL Server hosts (Version 7.4).

.. Note:: For information on other supported platforms and distributions, see the *Nuage VSP Release Notes*.


Ansible Installation
==========================

You only need to install Ansible once on a machine and it can manage the master and all the other remote nodes. Ansible manages nodes using the SSH protocol, therefore it is required that SSH is setup so that the master and nodes are accessible from the host running the Ansible scripts.

.. Note:: SSH Protocol does not require a password.

The Ansible Version to be used is 2.3. To check or install ansible version 2.3, follow the below steps:

    ::

         [root@ansible-host ~]# ansible --version
         ansible 2.4.2.0
         
         [root@ansible-host ~]# sudo pip install ansible==2.3
         
         
OpenShift DaemonSet for Nuage installation
===========================================

DaemonSet is used for installation of Nuage containerized services as part of the OpenShift Ansible Installation for Nuage. The nuage-openshift-monitor, CNI plugin, nuage-infra pod and VRS operate as DaemonSet pods on master and slave nodes.

.. Note:: Nuage recommends using Daemonsets for installation of Nuage services.

Pre-Installation Steps in VSD
-----------------------------
1. Login to VSD UI as csproot and create an  "openshift" Enterprise.

2. Under the "openshift" Enterprise, create a user "ose-admin" and add the user to the "Administrators" group. It is mandatory to add the user to the "Administrators" group on the VSD.

   .. Note:: The steps to create the user and adding the user to a particular group can be found in the "CSP User Management" section in the "Nuage VSP User Guide."

3. Login to the VSD node using the CLI and execute the following command. The certificates must be placed in the /usr/local or any specified directory on the host where ansible is run.

    ::

         /opt/vsd/ejbca/deploy/certMgmt.sh -a generate -u ose-admin -c ose-admin -o openshift -f pem -t client -s root@<ose-ansible-IP>:/usr/local/

         Where:
         -a <action>         Action [generate|revoke|delete|renew|bscopy]
         -u <username>       End-entity Username
         -c <commonName>     Common Name. Needs to match VSD Username
         -o <organization>   Organization. Needs to match VSD Organization
         -f <format>         Certificate Format [pem|jks|p12]
         -t <type>           Certificate Type [client|server|vsc|vrs]
         -s <scpUrl>         The remote scp url. (eg. root@myhost://home/certs/)


    .. Note:: The above command generates the client certificates for the "ose-admin" user and copies it to the /usr/local/ or any specified directory of the OSE node where Ansible is run. This certificate information is used by the nuage-openshift-monitor to securely communicate with the VSD.

Using Git
-------------

You need to have Git installed on your Ansible machine. Perform the following tasks:

1. Make sure https://github.com is reachable from your Ansible machine.

2. Setup SSH and access the master and the minion nodes, using the **ssh** command.

.. Note:: set-up passwordless **ssh** between Ansible node and cluster nodes.
   
3. Copy the nuage-ose-rhel-install-<version>.tar file shipped with the specific Nuage Release to a host machine where Ansible is run.

4. Untar the above image

   ::
   
       [root@ovs-10 ~]# tar -xvf nuage-ose-rhel-install.tar 
       etcd_certificates.yml
       nuage-infra-pod-config-daemonset.j2
       nuage-openshift-ansible.diff
       patch-nuage-openshift-ansible.sh

      
5. Run the patch-nuage-openshift-ansible.sh script to clone the ansible repo and set up Nuage changes.

   .. Note:: The tag version may change based on the Nuage release you use.
   
   ::

      [root@ansible-mc ~]# ./patch-nuage-openshift-ansible.sh 
      Cloning into 'openshift-ansible'...
      remote: Counting objects: 74439, done.
      remote: Compressing objects: 100% (7/7), done.
      remote: Total 74439 (delta 4), reused 2 (delta 2), pack-reused 74430
      Receiving objects: 100% (74439/74439), 18.85 MiB | 3.60 MiB/s, done.
      Resolving deltas: 100% (46284/46284), done.
      Checking connectivity... done.
      Note: checking out 'tags/openshift-ansible-3.7.0-0.116.0'.

      You are in 'detached HEAD' state. You can look around, make experimental
      changes and commit them, and you can discard any commits you make in this
      state without impacting any branches by performing another checkout.

      If you want to create a new branch to retain commits you create, you may
      do so (now or later) by using -b with the checkout command again. Example:

      git checkout -b <new-branch-name>

      HEAD is now at cc47755... Automatic commit of package [openshift-ansible] release [3.7.0-0.116.0].
      Successfully patched Nuage ansible changes into openshift-ansible
      You may now use the openshift-ansible folder for your ansible installation


Setup
----------

1. To prepare the OpenShift cluster for installation, follow the OpenShift Host Preparation guide.
   
   For Nuage releases prior to 5.2.1, go `here <https://docs.openshift.com/container-platform/3.5/install_config/install/host_preparation.html>`_.
   
   For Nuage releases 5.2.1, go `here <https://docs.openshift.com/container-platform/3.6/install_config/install/host_preparation.html>`_. 

   For Nuage releases 5.2.2 & above, go `here <https://docs.openshift.com/container-platform/3.7/install_config/install/host_preparation.html>`_. 
   
   .. Note:: Skip the yum update part in the OpenShift Host Preparation guide.


2. Load the following docker images on your master node:

   ::
   
       nuage-master-docker-<version>.tar
       nuage-cni-docker-<version>.tar
       nuage-vrs-docker-<version>.tar
       nuage-infra-docker-<version>.tar

3. Load the following docker images on your slave nodes:

   ::
   
{'fraction_non_alphanumeric': 0.11383354755784061, 'fraction_numerical': 0.01944087403598972, 'mean_word_length': 2.9722399489470326, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '928134', 'n_tokens_mistral': 3809, 'n_tokens_neox': 3454, 'n_words': 1452}