Customizing Cartridges
Cartridges can be customized based on the following criteria:
Customization based on type
WSO2 Private PaaS supports four categories of cartridges:Â Data, Application, Framework and Load Balancer. Administrators need to customize the category
field, which is in the cartridge definition, to be able to add a cartridge that falls under a specific category.
"category":"<CARTRIDGE-TYPE>"
Cartridge Category | Configuration | Example(s) |
---|---|---|
Data |
"category":"data" | MySQL cartridge |
Application |
"category":
"application"
| Wordpress |
Framework |
"category":"framework" | PHP cartridge and Tomcat cartridge |
Load Balancer |
"category":"load-balancer" | Stratos Load Balancer, HAProxy and NGINX |
Customization based on persistence storage
Persistent mapping is attaching a virtual hard drive as an additional storage to the cartridge instance. Persistence mapping is an optional functionality where it should be used only when you need additional storage to be added to the instance. Generally this is useful for data cartridges where an additional storage is required and also when the data stored should be preserved even in the case of instance termination. There are two steps that should be followed to obtain WSO2 Private PaaS persistence volume support as follows:Â
Persistence volume support needs to be defined in the cartridge definition when creating a cartridge.
For example see the sample code snippet below. For information on all the properties that can be used in a cartridge definition, see the Cartridge Property Definitions.Â
"persistence": { "isRequired": "true", "volume" : [ { "device": "/dev/sdc", "mappingPath": "/home/ubuntu/sdc", "size": "10", "removeOnTermination": "false" } ] }
For more information, see Persistence Volume Mapping.
Customization based on tenancy
Cartridges can operate in two modes: single tenant mode and multi-tenant mode. Single tenant cartridges maintain a separate instance for each tenant. Multi-tenant cartridges share an instance among multiple tenants. Single tenant cartridges provide process-level isolation and instance-level dedicated tenancy. Multiple tenants cannot be hosted in a single cartridge instance. Although multiple tenants share one cartridge instance, in multi-tenant cartridges each of the tenants' data will be isolated from each other.
Tenancy in a cartridge can be defined as follows:Â
Cartridge Type | Configuration |
---|---|
Single tenant cartridge |
"multiTenant":"false" |
Multi-tenant cartridge |
"multiTenant":"true" |