Tuesday, January 13, 2015

How to work with Apache Stratos 4.1.0 with Kubernetes

Below are the simple steps, how to configure Kubernetes cluster and work it with Apache Stratos.

Setup Kubernetes host cluster by cloning and setting up the virtual machines      
Login to Kubernetes master and pull the following Docker image
  • cd [vagrant-kubernetes-setup-folder]
  • vagrant ssh master
  • sudo systemctl restart controller-manager
  • docker pull stratos/php:4.1.0-alpha

Verify Kubernetes cluster status, once the following command is run there should be at least one minion listed
  • cd [vagrant-kubernetes-setup-folder]
  • vagrant ssh master
  • kubecfg list minions

Start Stratos instance and tail the log
  • cd [stratos-home-folder]
  • sh bin/stratos.sh start
  • tail -f repository/logs/wso2carbon.log

Set Message Broker and Complex Event Processor IP addresses to Stratos host IP address in the Kubernetes custer
  • cd [stratos-samples-folder]
  • vim single-cartridge/kubernetes/artifacts/kubernetes-cluster.json


Once the server is started run one of the Kubernetes samples available in the Stratos samples checked out above
  • cd [stratos-samples-folder]
  • cd single-cartridge/kubernetes
  • ./deploy.sh

Monitor Stratos log and wait until the application activated log is printed
  • INFO {org.apache.stratos.autoscaler.applications.topic.ApplicationsEventPublisher} -  Publishing Application Active event for [application]: single-cartridge-app [instance]:single-cartridge-app-1

No comments:

Post a Comment