WSO2 Enterprise Integrator 6.3.0 in an AWS Kubernetes Cluster
The following resources are required in order to deploy Enterprise Integrator in a Kubernetes Cluster in AWS.
- A Kubernetes Cluster in AWS
- An NFS server to be used as the persistent volume for artifact sharing and persistence
- An NGINX Ingress Controller
Install the Required Tools
Here we will be discussing on how to create a Kubernetes cluster in AWS using Kops.
First install the AWS CLI using the following command.
sudo apt install awscli
Configure the AWS CLI with your user details with the following command.
aws configure
Install Kubernetes CLI using the following commands.
sudo apt-get update && sudo apt-get install -y apt-transport-https
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
sudo touch /etc/apt/sources.list.d/kubernetes.list
echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list
sudo apt-get update
sudo apt-get install -y kubectl
Install Kops using the following command.
sudo snap install kops
Create a Kubernetes Cluster in AWS
In order to create a Kubernetes Cluster in AWS, first you need to create an S3 bucket in AWS.
bucket_name=wso2-kops-ei
aws s3api create-bucket \
--bucket ${bucket_name} \
--region us-east-1
Export a suitable name for the Kubernetes Cluster.
export KOPS_CLUSTER_NAME=wso2.k8s.local
Export the AWS S3 bucket URL to a environment variable.
export KOPS_STATE_STORE=s3://${bucket_name}
Using Kops specify the number of nodes, AWS EC2 instance type, region to deploy and the cluster name.
kops create cluster \
--node-count=5 \
--node-size=t2.large \
--zones=us-east-1a \
--name=${KOPS_CLUSTER_NAME}
Now create the Kubernetes Cluster using the following command.
kops update cluster --name ${KOPS_CLUSTER_NAME} --yes
Setup an NFS Server
Create an AWS instance and login to the using SSH.
Install NFS Server using the following command.
sudo apt-get install nfs-kernel-server
Create four directories as the persistent volumes in the NFS instance.
For example:
mkdir /home/ubuntu/ei
Create a user account named wso2carbon with a user id of 802 and a group named wso2 with a group of id 802 and add the wso2carbon user to the wso2 group.
groupadd --system -g 802 wso2useradd --system -g 802 -u 802 wso2carbon
Create another directory to persist the database.
mkdir /home/ubuntu/rdbms
chmod 707 /home/ubuntu/rdbms
Allow access to the wso2carbon user to created directories.
chown -R wso2carbon:wso2 ei1chown -R wso2carbon:wso2 rdbms
Export the created directories by adding them to the /etc/exports file.
/home/ubuntu/ei1 *(rw,sync,no_subtree_check,insecure)
Now restart the NFS Server for the changes to apply.
service nfs-kernel-server restart
Add an NGINX Ingress Controller
Run the following commands to create an NGINX Ingress Controller
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/mandatory.yamlkubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/provider/aws/service-l4.yamlkubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/provider/aws/patch-configmap-l4.yaml
Now all the prerequisites are completed !!!!
Deploying WSO2 Enterprise Integrator in the created Kubernetes Cluster
Clone the WSO2 Kubernetes EI repository using the following command.
git clone git@github.com:wso2/kubernetes-ei.git
Select the preferred deployment pattern by switching to the relevant directory.
cd kubernetes-ei/<pattern>
Replace the <NFS_SERVER_IP> in volumes/persistent-volumes.yaml with the IP address of the NFS Server instance.
Replace the <NFS_LOCATION_PATH> in volumes/persistent-volumes.yaml with a created persistent volume directory. The volumes/persistent-volumes.yaml file should look as follows.
server: 172.31.12.25path: /home/ubuntu/ei1
Replace the <NFS_SERVER_IP> and <NFS_LOCATION_PATH> in extras/rdbms/volumes/persistent-volumes.yaml as follows.
server: 172.31.12.25path: /home/ubuntu/rdbms
Get the Cluster admin password from the following command.
kops get secrets kube --type secret -oplaintext
Run the following command to deploy WSO2 Enterprise Integrator.
Note: WSO2_USERNAME
and WSO2_PASSWORD
should be replaced with valid WSO2 account credentials. If you do not posses a valid WSO2 account subscription, please register for a Free Trail from HERE.
Replace K8S_CLUSTER_ADMIN_PASSWORD
with the previously obtained Cluster admin password.
./deploy.sh --wso2-username=<WSO2_USERNAME> --wso2-password=<WSO2_PASSWORD> --cluster-admin-password=<K8S_CLUSTER_ADMIN_PASSWORD>
After the pods are created, run the following command to get the Ingress controller details.
Kubectl get ing
Get the Ingress Name and run the below command.
Kubectl describe ing <ING-NAME>
Use the Address and run nslookup to get the IP Address of the Ingress Controller.
nslookup <Address>
Get all the IP Addresses of the Ingress Controllers as above and add them to /etc/hosts as follows.
<IP_ADDRESS> wso2ei-analytics
<IP_ADDRESS> wso2ei-integrator-gateway
<IP_ADDRESS> wso2ei-integrator
Access the Management Console URLs in a browser using the obtained IP Address.
https://<IP-ADDRESS>/publisherhttps://<IP-ADDRESS>/storehttps://<IP-ADDRESS>/carbonhttps://<IP-ADDRESS>/admin
Login using the following credentials.
Username : adminPassword : admin
For more details about WSO2 Enterprise Intergrator, please refer HERE.