OnBots Installation Guide
Want to know about OneDevOps OnBot Components?
Learn about components to setup local development environment here.
OnBots Components and Architecture
Basic Components of the OnBots Framework:
Kubernetes Environment-Creates base environment required to execute and maintain Bots. Kubernetes spawn docker image with base Ubuntu 16.04 with additional software's like NodeJS,CoffeeScript,npm e.tc.
Elastic Search-Holds logs,metrics related information
MongoDB - Used to maintain Approval flow. Generates and Maintain Ticket related information.
MiddleWare Application - Act as a interceptor to read admin response and manages communication between various
Bots.
This section will help you to setup Environment for OnBot. Browse various categories provided below:
Expand | ||
---|---|---|
| ||
Kubernetes Master & Node configuration |
...
title | Network Ports |
---|
...
OnBots Installation Guide
Want to know about OneDevOps OnBot Components?
Learn about components to setup local development environment here.
OnBots Components and Architecture
Basic Components of the OnBots Framework:
Kubernetes Environment-Creates base environment required to execute and maintain Bots. Kubernetes spawn docker image with base Ubuntu 16.04 with additional software's like NodeJS,CoffeeScript,npm e.tc.
Elastic Search-Holds logs,metrics related information
MongoDB - Used to maintain Approval flow. Generates and Maintain Ticket related information.
MiddleWare Application - Act as a interceptor to read admin response and manages communication between various
Bots.
This section will help you to setup Environment for OnBot. Browse various categories provided below:
Expand | ||
---|---|---|
| ||
Kubernetes Master & Node configuration |
Expand | ||
---|---|---|
| ||
Kubernetes Master 6443
|
...
Expand | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||
Step 1: Installing kubelet and kubeadm on your hosts(to be followed in both Master and Slave)
Step 2: Initializing the master (Below Commands applicable only for master)To initialize the master, pick one of the machines you previously installed kubeadm on, and run: 1. # kubeadm initIn case, kubernetes cluster configuration located in $HOME/.kube/config then run the following command
Step 2: Initializing the master (Below Commands applicable only for master)To initialize the master, pick one of the machines you previously installed kubeadm on, and run: 1. # kubeadm init sudo chown $(id -u):$(id -g) $HOME/.kube/config export KUBECONFIG=$HOME/.kube/config
In case, kubernetes configuration located in $HOME/admin.conf then run the following commands: sudo chown $(id -u):$(id -g) $HOME/admin.kube/configconf export KUBECONFIG=$HOME/admin.kube/configconf
In case, kubernetes configuration located in $HOME/admin.conf then run the following commands: chown $(id -u):$(id -g) $HOME/admin.conf export KUBECONFIG=$HOME/admin.conf
# kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml
3. Create a cluster role and bind all services then allow anonymous user to access Kube API
Execute the following commands in the Slave machines to connect to the Master machine: # kubeadm join --token <token id> <Primary IP>:6443 Above token helps slave to join master node. Token should run in all slaves once step 3 completes. Master Isolation: By default, your cluster will not schedule pods on the master for security reasons. If you want to be able to schedule pods on the master, e.g. a single-machine Kubernetes cluster for development, run:
This will remove the node-role.kubernetes.io/master taint from any nodes that have it, including the master node, meaning that the scheduler will then be able to schedule pods everywhere Step 3: Installing a pod network(Below Commands applicable only for master)You must install a pod network add-on so that your pods can communicate with each other. go to addon hyperlink and get weave.net kubectl apply -f https://git.io/weave-kube-1.6 Step 4: Adding Slaves to Master node(Below Commands applicable only for slaves)Run the obtained token given below from Step 2 in all slave nodes not needed to run in add-on server: kubeadm join --token <token id> <Primary IP>:6443 You will get an output similar to the one shown below - | ||||||||||||||||||||||||||||||
Expand | ||||||||||||||||||||||||||||||
|
Code Block | ||||
---|---|---|---|---|
| ||||
# Where to store the data.
dbpath=/var/lib/mongodb
#where to log
logpath=/var/log/mongodb/mongodb.log
logappend=true
bind_ip = <public_IP_of_your_machine>
port = 27017
# Enable journaling,
http://www.mongodb.org/display/DOCS/Journaling
journal=true |
4) Make the mongodb user as mongodb. Usually the user will be mongodb by default. You may check it and skip this step if not required:
chown -R mongodb:mongodb /var/lib/mongodb
5) Start mongodb as a service:
sudo service mongodb start
You can check the status after starting mongodb by this command: sudo service mongodb status
6) Export your existing collections from your pre-existing mongodb service (if any):
sudo mongoexport -db <db_name> -c <collection_name> --out <filename>.json
[eg sudo mongoexport --db botstore -c BotCategory --out BotCat_bkp.json]
This will export all your collection data into a json file inside the present working directory. Now copy that json file into the machine where you have newly installed mongodb and execute the following command:
sudo mongoimport --db <db_name> --collection <collection_name> < /path/to/exported_json
[eg - sudo mongoimport --db botstore --collection BotCategory < /home/487398/BotCat_bkp.json]
This will import all you data into the new mongodb installation.
7) Restart the mongodb service:
sudo service mongodb restart
...
# kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml
3. Create a cluster role and bind all services then allow anonymous user to access Kube API
Execute the following commands in the Slave machines to connect to the Master machine: # kubeadm join --token <token id> <Primary IP>:6443 Above token helps slave to join master node. Token should run in all slaves once step 3 completes. Master Isolation: By default, your cluster will not schedule pods on the master for security reasons. If you want to be able to schedule pods on the master, e.g. a single-machine Kubernetes cluster for development, run:
This will remove the node-role.kubernetes.io/master taint from any nodes that have it, including the master node, meaning that the scheduler will then be able to schedule pods everywhere Step 3: Installing a pod network(Below Commands applicable only for master)You must install a pod network add-on so that your pods can communicate with each other. go to addon hyperlink and get weave.net kubectl apply -f https://git.io/weave-kube-1.6 Step 4: Adding Slaves to Master node(Below Commands applicable only for slaves)Run the obtained token given below from Step 2 in all slave nodes not needed to run in add-on server: kubeadm join --token <token id> <Primary IP>:6443 You will get an output similar to the one shown below - |
Expand | |||||||
---|---|---|---|---|---|---|---|
| |||||||
Run the following commands:
Here, assign bind_ip with public IP of your machine. Specify the dbpath and logpath according to your choice. sudo mongoexport -db <db_name> -c <collection_name> --out <filename>.json [eg sudo mongoexport --db botstore -c BotCategory --out BotCat_bkp.json] |
Expand | |||||||
---|---|---|---|---|---|---|---|
| |||||||
Run the below commands to install Java 8 in your Ubuntu machine:
|
Expand | ||
---|---|---|
| ||
Install npm and nodejs by executing the following commands: APPROVAL_APP_URL: middleware application endpoint which will handle approval flow in mattermost MONGO_DB_NAME: The database name which has MONGO_COLL and MONGO_COUNTER in it Certificate_Path: Path to certificate.pem file dbName: The mongodb database name which contains botCollections Run Application |
Expand | ||
---|---|---|
| ||
1. Clone |
...
SlackApp from repository |