stratos-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rajkumar Rajaratnam <rajkum...@wso2.com>
Subject Re: [Discuss] Specifying CPU and Memory in Docker Cartridges
Date Wed, 20 May 2015 21:03:12 GMT
I went through the code and figured it out :-)

If we don't specify these parameters, the default values will be cpu -> 1
and ram-> 1024. I guess that should be the way to do it.

Thanks.

On Thu, May 21, 2015 at 2:14 AM, Rajkumar Rajaratnam <rajkumarr@wso2.com>
wrote:

> This is great Imesh!
>
> If we don't specify these parameters, the CPU and Memory won't be
> restricted right? Do we have to explicitly set these to 0?
>
> Thanks.
>
> On Thu, May 21, 2015 at 12:54 AM, Imesh Gunaratne <imesh@apache.org>
> wrote:
>
>> Hi Devs,
>>
>> I have now implemented support to specify CPU (number of cores) and
>> Memory (in MB) in Docker Cartridges. These values will be passed to
>> Kubernetes when creating a Pod and Kubernetes will limit those resources to
>> containers accordingly.
>>
>> If CPU and Memory should not be restricted, above parameter values can be
>> set to zero. Please find a sample cartridge definition below:
>>
>> {
>>     "type": "php",
>>     "provider": "apache",
>>     "category": "framework",
>>     "host": "php.stratos.org",
>>     "displayName": "php",
>>     "description": "php Cartridge",
>>     "version": "7",
>>     "multiTenant": "false",
>>     "loadBalancingIPType": "public",
>>     "portMapping": [
>>         {
>>             "protocol": "http",
>>             "port": "80",
>>             "proxyPort": "8281"
>>         }
>>     ],
>>     "deployment": {
>>         "baseDir": "/var/www"
>>     },
>>     "iaasProvider": [
>>         {
>>             "type": "kubernetes",
>>             "imageId": "stratos/php:4.1.0-beta",
>>             "networkInterfaces": [
>>             ],
>>             "property": [
>>             ]
>>         }
>>     ],
>>     "property": [
>>         {
>>             "name": "KUBERNETES_CONTAINER_CPU",
>>             "value": "1"
>>         },
>>         {
>>             "name": "KUBERNETES_CONTAINER_MEMORY",
>>             "value": "512"
>>         }
>>     ]
>> }
>>
>> Thanks
>>
>> --
>> Imesh Gunaratne
>>
>> Senior Technical Lead, WSO2
>> Committer & PMC Member, Apache Stratos
>>
>
>
>
> --
> Rajkumar Rajaratnam
> Committer & PMC Member, Apache Stratos
> Software Engineer, WSO2
>
> Mobile : +94777568639
> Blog : rajkumarr.com
>



-- 
Rajkumar Rajaratnam
Committer & PMC Member, Apache Stratos
Software Engineer, WSO2

Mobile : +94777568639
Blog : rajkumarr.com

Mime
View raw message