Hi Devs, I have done the required change and PR can be found in [1]. It has now merged with the master branch. With this change when you are adding a cartridge which uses kubernetes Iaas, you need to provide another property called kubernetesPortType under the portMapping section. Acceptable values for this are NodePort and ClusterIP. Following is a sample for PortMapping.
{ "name": "http-80", "protocol": "http", "port": "50070", "proxyPort": "8281", "kubernetesPortType":"NodePort" } Please note that we generate access URLs only for NodePort type. Thank you! [1] - https://github.com/apache/stratos/pull/415 On Sun, Aug 2, 2015 at 5:13 PM, Imesh Gunaratne <im...@apache.org> wrote: > Hi Pubudu, > > Yes please go ahead with this improvement. May be in the port mapping > definition the new property can be called "kubernetesPortType". > > Thanks > > On Thu, Jul 30, 2015 at 1:49 AM, Pubudu Gunatilaka <pubu...@wso2.com> > wrote: > >> Hi Devs, >> >> Currently I am working on $subject. In Kubernetes there are 3 kinds of >> services types. They are NodePort, ClusterIP and LoadBalancer [1]. At the >> moment Stratos supports only NodePort type. My intention is to extend this >> to have ClusterIP type as well. >> >> *Why We Need ClusterIP* >> >> 1. NodePort type has limited number of ports. i.e 30000 to 32767. >> 2. There can be situations where we need to expose some ports for >> communication between containers only. In this kind of situation we can use >> ClusterIP type to save limited port numbers. >> >> *Design Decisions * >> >> 1. When creating a cartridge for kubernetes, you need to specify the type >> in PortMapping as either NodePort or ClusterIP. This should be done for >> every port mapping defined in the cartridge for kubernetes. >> 2. If you have set the type as ClusterIP, Access URLs are not generated. >> >> *Identified Improvements to be done in the future releases* >> >> 1. There is no mechanism to reuse already used port which is vacant. >> 2. Currently we generate a service for every port mapping. But a service >> can have multiple port mappings. We can improve to have a single service >> with multiple port mappings. >> >> >> Please share your thoughts! >> >> [1] - >> https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/user-guide/services.md#external-services >> >> Thank you! >> >> -- >> >> *Pubudu Gunatilaka* >> Software Engineer >> WSO2, Inc.: http://wso2.com >> lean.enterprise.middleware >> mobile: +94 77 4078049 >> > > > > -- > Imesh Gunaratne > > Senior Technical Lead, WSO2 > Committer & PMC Member, Apache Stratos > -- *Pubudu Gunatilaka* Software Engineer WSO2, Inc.: http://wso2.com lean.enterprise.middleware mobile: +94 77 4078049