Apache Stratos Cartridge Agent: Day 0

  1. Listen to the message broker events that are intended to it and publish events notifying any listening parties of its current state (STARTED|ACTIVATED|MAINTENANCE_MODE etc)
  2. Check if the intended ports of the instance are active or not and publish the status accordingly
  3. Periodically check the health statistics of the instance and publish them to an expecting Thrift compatible Complex Event Processor
  4. Clone from and constantly update an artifact repository if specified

Message broker communication

Apache Stratos has a loosely-coupled component structure which executes the major communication bulk over a message broker. This enables any new component to join the chit-chat without disrupting the ongoing communication or without any impact on the configuration of the existing components. Any component can go silent and it wouldn’t affect the communication channel. The communication happens via message broker Events and Topics in the common communication channel. Therefore each component should only be aware of the location (and sometimes the credentials) of the common communication channel, the message broker.

Ports activity check

For each cartridge, a set of ports are defined in the cartridge definition. The intended services should run on these ports. The agent should determine if a the intended service is up or not before it can announce that it is ready to accept requests. It does so by checking if the specified ports are active or not.

Health statistics publishing

The Cloud is about Scale, and Scale is about Health. Apache Stratos auto-scaling feature takes care of the complex scaling requirements of the deployed services based on a number of parameters, on a number of levels. From the point of the instance, its contribution to the scaling effort should be to announce its health status to the decision making process.

Artifacts Distribution

Most cartridge types deal with a set of artifacts that are hosted on a remote repository, that should be copied over to the instance and executed on. For an example a PHP cartridge will require a remote repository location to copy the web artifacts from. It is the Cartridge Agent that performs this artifact management task. In addition to cloning from the remote repository, there are cases where the locally modified artifacts should be pushed to the remote repository. This is also carried out by the Cartridge Agent.

--

--

developer, #cloud enthusiast, #apacheStratos committer, expect #linux, #containers, #kubernetes, #microservices, and #devops in general

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
chamila de alwis

chamila de alwis

400 Followers

developer, #cloud enthusiast, #apacheStratos committer, expect #linux, #containers, #kubernetes, #microservices, and #devops in general