<commit_before>******************
On-Premise Solutions
******************

Vagrant
=======

Using OpenEBS with Kubernetes on Local Machine
----------------------------------------------
The following procedure helps you setup and use OpenEBS on a local machine:

1. Install Vagrant Box
  
   To run the kubernetes cluster on local machine, you need a vagrant box. If you do not have vagrant box follow the steps given `here`_.
    .. _here: https://github.com/openebs/openebs/tree/master/k8s/lib/vagrant/test/k8s/1.6#installing-kubernetes-16-and-openebs-clusters-on-ubuntu

2. Download OpenEBS Vagrant file using the following command.
   ::
     $ wget https://raw.githubusercontent.com/openebs/openebs/master/k8s/lib/vagrant/test/k8s/1.6/Vagrantfile

3. Bring up k8s Cluster.
   ::
      openebs@openebs:~$ cd openebs/k8s/lib/vagrant/test/k8s/1.6
      openebs@openebs:~/openebs/k8s/lib/vagrant/test/k8s/1.6$ vagrant up

It will bring up one kubemaster and two kubeminions.

4. SSH to kubemaster using the following command.
   ::
      openebs@openebs:~/openebs/k8s/lib/vagrant/test/k8s/1.6$ vagrant ssh kubemaster-01

5. Run OpenEBS Operator.

   * Download the latest OpenEBS Operator Files inside kubemaster-01 using the following commands.
     ::
        ubuntu@kubemaster-01:~$ git clone https://github.com/openebs/openebs
        ubuntu@kubemaster-01:~$ cd openebs/k8s

   * Run OpenEBS Operator using the following command.
     ::
           ubuntu@kubemaster-01:~/openebs/k8s$ kubectl apply -f openebs-operator.yaml

   * Add OpenEBS related storage classes using the following command, that can then be used by developers or applications.
     ::
           ubuntu@kubemaster-01:~/openebs/k8s$ kubectl apply -f openebs-storageclasses.yaml   

6. Run stateful workloads with OpenEBS storage.  
   
To use OpenEBS as persistent storage for your stateful workloads, set the storage class in the PVC to OpenEBS storage class.

Get the list of storage classes using the following command. Choose the storage class that best suits your application.
::
    ubuntu@kubemaster-01:~$ kubectl get sc


Some sample yaml files for stateful workloads using OpenEBS are provided in the `openebs/k8s/demo`_.
 .. _openebs/k8s/demo: https://github.com/openebs/openebs/tree/master/k8s/demo

The *ubuntu@kubemaster-01:~$ kubectl apply -f demo/jupyter/demo-jupyter-openebs.yaml* command creates the following, which you can verify using the corresponding kubectl commands.

* Launch a Jupyter Server, with the specified notebook file from github (kubectl get deployments)
* Create an OpenEBS Volume and mount to the Jupyter Server Pod (/mnt/data) (kubectl get pvc) (kubectl get pv) (kubectl get pods)
* Expose the Jupyter Server to external world through http://NodeIP:8888 (NodeIP is any of the minion nodes' external IP) (kubectl get pods)



Virtual Machines
=================

Setting up OpenEBS On-Premise
-----------------------------
This section provides detailed instructions on how to perform the OpenEBS on-premise deployment. The objective of this procedure is to have the following functional.

* Kubernetes cluster (K8s master & K8s minions/host) configured with the OpenEBS iSCSI flexvol driver,
* OpenEBS Maya Master
* OpenEBS Storage Hosts

Depending on your need, you can either setup only the Kubernetes cluster or the OpenEBS cluster or both. The number of nodes in each category is configurable.

The Kubernetes cluster is setup, in this framework using *kubeadm*.

Running the Setup on Ubuntu 16.04
---------------------------------
The following instructions have been verified on -<commit_msg>Update titles for Vagrant and Ansible<commit_after>******************
On-Premise Solutions
******************

Using Vagrant
=============

Setting Up OpenEBS with Kubernetes on Local Machine
---------------------------------------------------
The following procedure helps you setup and use OpenEBS on a local machine:

1. Install Vagrant Box
  
   To run the kubernetes cluster on local machine, you need a vagrant box. If you do not have vagrant box follow the steps given `here`_.
    .. _here: https://github.com/openebs/openebs/tree/master/k8s/lib/vagrant/test/k8s/1.6#installing-kubernetes-16-and-openebs-clusters-on-ubuntu

2. Download OpenEBS Vagrant file using the following command.
   ::
     $ wget https://raw.githubusercontent.com/openebs/openebs/master/k8s/lib/vagrant/test/k8s/1.6/Vagrantfile

3. Bring up k8s Cluster.
   ::
      openebs@openebs:~$ cd openebs/k8s/lib/vagrant/test/k8s/1.6
      openebs@openebs:~/openebs/k8s/lib/vagrant/test/k8s/1.6$ vagrant up

It will bring up one kubemaster and two kubeminions.

4. SSH to kubemaster using the following command.
   ::
      openebs@openebs:~/openebs/k8s/lib/vagrant/test/k8s/1.6$ vagrant ssh kubemaster-01

5. Run OpenEBS Operator.

   * Download the latest OpenEBS Operator Files inside kubemaster-01 using the following commands.
     ::
        ubuntu@kubemaster-01:~$ git clone https://github.com/openebs/openebs
        ubuntu@kubemaster-01:~$ cd openebs/k8s

   * Run OpenEBS Operator using the following command.
     ::
           ubuntu@kubemaster-01:~/openebs/k8s$ kubectl apply -f openebs-operator.yaml

   * Add OpenEBS related storage classes using the following command, that can then be used by developers or applications.
     ::
           ubuntu@kubemaster-01:~/openebs/k8s$ kubectl apply -f openebs-storageclasses.yaml   

6. Run stateful workloads with OpenEBS storage.  
   
To use OpenEBS as persistent storage for your stateful workloads, set the storage class in the PVC to OpenEBS storage class.

Get the list of storage classes using the following command. Choose the storage class that best suits your application.
::
    ubuntu@kubemaster-01:~$ kubectl get sc


Some sample yaml files for stateful workloads using OpenEBS are provided in the `openebs/k8s/demo`_.
 .. _openebs/k8s/demo: https://github.com/openebs/openebs/tree/master/k8s/demo

The *ubuntu@kubemaster-01:~$ kubectl apply -f demo/jupyter/demo-jupyter-openebs.yaml* command creates the following, which you can verify using the corresponding kubectl commands.

* Launch a Jupyter Server, with the specified notebook file from github (kubectl get deployments)
* Create an OpenEBS Volume and mount to the Jupyter Server Pod (/mnt/data) (kubectl get pvc) (kubectl get pv) (kubectl get pods)
* Expose the Jupyter Server to external world through http://NodeIP:8888 (NodeIP is any of the minion nodes' external IP) (kubectl get pods)



Using Ansible
=============

Setting Up OpenEBS on Ubuntu Hosts or Virtual Machines
------------------------------------------------------
This section provides detailed instructions on how to perform the OpenEBS on-premise deployment. The objective of this procedure is to have the following functional.

* Kubernetes cluster (K8s master & K8s minions/host) configured with the OpenEBS iSCSI flexvol driver,
* OpenEBS Maya Master
* OpenEBS Storage Hosts

Depending on your need, you can either setup only the Kubernetes cluster or the OpenEBS cluster or both. The number of nodes in each category is configurable.

The Kubernetes cluster is setup, in this framework using *kubeadm*.

Running the Setup on Ubuntu 16.04
---------------------------------
The following instructions have been verified on -
{'fraction_non_alphanumeric': 0.11862087836913394, 'fraction_numerical': 0.01669174989738678, 'mean_word_length': 3.3615751789976134, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '822284', 'n_tokens_mistral': 2369, 'n_tokens_neox': 2244, 'n_words': 806}