Hi Pirinthapan, We had the same problem in Stratos when creating K8S services. The way we resolved that is using a sequence number and a prefix [1]: *"service-<seqno>"*
[1] https://github.com/apache/stratos/blob/master/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/kubernetes/KubernetesIaas.java#L683 Thanks On Thu, Mar 3, 2016 at 9:42 PM, Pirinthapan Mahendran <[email protected]> wrote: > Hi all, > > In AppCloud, when deploying application in Kubernetes we are using the > following pattern as the service name. > > *<Application Name>-<Version>-<Port>* > > We are using the above pattern because a particular Application can be > identified by Application Name and Version within a tenant. > > But Kubernetes limits the number of characters of this service name to 24. > According to our current implementation, the version can have maximum of 13 > character. So if we consider these limitations, the Application Name can > have only 6 characters. So we are trying to come up with a solution to > increase the length of the application name. > > Initially we thought about using UUID as primary key and replacing > *'<Application > Name>-<Version>' *with the UUID. But according to the standared, UUID has > 36 characters. So we cannot use UUID. > > Currently we have the follwoing two options to solve this issue. > > 1. Using auto generated id of mysql database, which is generated during > adding application, instead of *'<Application Name>-<Version>'*. But its > not the recommonded way to use the auto generated id outside to database. > > 2. Defining our own hash function to generate a 24 character string > instead of *'**<Application Name>-<Version>-<Port>'*. > > Could you please share your opinion on the above options? > > Thanks & Regards, > Mahendran Pirinthapan > Software Engineer | WSO2 Inc. > Mobile +94772378732. > -- *Imesh Gunaratne* Senior Technical Lead WSO2 Inc: http://wso2.com T: +94 11 214 5345 M: +94 77 374 2057 W: http://imesh.io Lean . Enterprise . Middleware
_______________________________________________ Architecture mailing list [email protected] https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
