Hi Gayan,+1 for properly identifying attributes to be used for labels and annotations. As I mentioned earlier I tried to use them as labels but ran into length limitation issues.
memberId and clusterId cannot be used directly since they are generated as follows;
memberId = clusterId + UUID
clusterId = applicationId + "." + alias + "." + cartridgeType + ".domain"As you can see those can go be beyond 63 characters since we don't have a limitation for applicationId length. I'm -1 on imposing a character limitation to applicationId only to get away with Kubernetes restriction. What if some other provider comes out with a different limitation? It should be restricted but only for good reasons concerning to Stratos.
I had an offline chat with Imesh and we were discussing about implementing a sequence number based approach for generating clusterId and memberId without using UUIDs. Any thoughts?
On Sun, Sep 20, 2015 at 10:55 PM, Gayan Gunarathne <firstname.lastname@example.org> wrote:As per Kubernetes definition I think we are using labels and annotation in a wrong way.As annotations are arbitrary non-identifying metadata , they might not shown them in their UI/CLII think first we need to recognize what are the identifiers for the pod.In think we may need to use member id , application idAlso what is the ration behind of using the md5Hex of the member id as a identifier. IMO we can directly use the member id. As member id is UUID it won't be more than 63 characters.Thanks,Gayan--On Sun, Sep 20, 2015 at 10:13 PM, Imesh Gunaratne <email@example.com> wrote:Hi Akila,Right, I get your point on the length limitation, but this is how Kubernetes has described Labels and Annotations:
We'll eventually index and reverse-index labels for efficient queries and watches, use them to sort and group in UIs and CLIs, etc. We don't want to pollute labels with non-identifying, especially large and/or structured, data. Non-identifying information should be recorded using annotations.The idea is to use labels for all identifiers.On Sun, Sep 20, 2015 at 10:05 PM, Akila Ravihansa Perera <firstname.lastname@example.org> wrote:Hi Imesh,Yes, I tried adding them as labels but ran into a problem since label length cannot be greater than 63 characters. I'm not sure why we don't see annotations in the UI for pods created. But I can see the annotations added for services. Might have to raise this in K8s mailing list.Thanks.On Sun, Sep 20, 2015 at 10:00 PM, Imesh Gunaratne <email@example.com> wrote:Hi Akila,We do not query pod labels, its handled by the Kubernetes service selector, at the moment this is called "name". I have now fixed this issue locally, will push in few minutes.In addition I think it would be better to use labels instead of annotations because they are not visible in the UI:ThanksOn Sun, Sep 20, 2015 at 9:52 PM, Akila Ravihansa Perera <firstname.lastname@example.org> wrote:Hi Imesh,Where do we query those pod labels?I'm in the process of moving label names to constants. I can apply the same in all the places. I think better to change that label to md5Hex-memberId to avoid any confusion when troubleshooting issues. One might mistakenly take that as the actual memberId when it is not the case.Thanks.On Sun, Sep 20, 2015 at 9:40 PM, Imesh Gunaratne <email@example.com> wrote:I'm seeing a problem, we have removed the "name" label in the pod and added a new label called "md5Hex-memberId". Due to this load balancing would not work:Map<String, String> podLabels = new HashMap<>();
Map<String, String> podAnnotations = new HashMap<>();
kubernetesApi.createPod(podId, podName, podLabels, podAnnotations, dockerImage, cpu, memory, ports,
environmentVariables);--On Sun, Sep 20, 2015 at 2:51 PM, Akila Ravihansa Perera <firstname.lastname@example.org> wrote:Hi all,I've pushed release artifacts to staging repo at . Please take few mins to verify the release. Also I've pushed cartridge-base, php and tomcat Docker images with 4.1.3 artifacts to DockerHub.Imesh GunaratneSenior Technical Lead, WSO2Committer & PMC Member, Apache Stratos----Imesh GunaratneSenior Technical Lead, WSO2Committer & PMC Member, Apache Stratos----Imesh GunaratneSenior Technical Lead, WSO2Committer & PMC Member, Apache StratosGayan Gunarathne
Technical Lead, WSO2 Inc.Committer & PMC Member, Apache Stratos--