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/CLI
I think first we need to recognize what are the identifiers for the pod.In think we may need to use member id , application id Also 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 <im...@apache.org> 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. > > http://kubernetes.io/v1.0/docs/user-guide/labels.html > > On Sun, Sep 20, 2015 at 10:05 PM, Akila Ravihansa Perera < > raviha...@wso2.com> 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 <im...@apache.org> >> 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: >>> >>> >>> >>> Thanks >>> >>> On Sun, Sep 20, 2015 at 9:52 PM, Akila Ravihansa Perera < >>> raviha...@wso2.com> 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 <im...@apache.org> >>>> 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<>(); >>>>> podLabels.put("md5Hex-memberId", >>>>> DigestUtils.md5Hex(memberContext.getMemberId())); >>>>> >>>>> Map<String, String> podAnnotations = new HashMap<>(); >>>>> podAnnotations.put("memberId", memberContext.getMemberId()); >>>>> podAnnotations.put("cartridgeType", memberContext.getCartridgeType()); >>>>> podAnnotations.put("applicationId", memberContext.getApplicationId()); >>>>> podAnnotations.put("clusterId", memberContext.getClusterId()); >>>>> podAnnotations.put("clusterInstanceId", >>>>> memberContext.getClusterInstanceId()); >>>>> >>>>> kubernetesApi.createPod(podId, podName, podLabels, podAnnotations, >>>>> dockerImage, cpu, memory, ports, >>>>> environmentVariables); >>>>> >>>>> >>>>> On Sun, Sep 20, 2015 at 2:51 PM, Akila Ravihansa Perera < >>>>> raviha...@wso2.com> wrote: >>>>> >>>>>> Hi all, >>>>>> >>>>>> I've pushed release artifacts to staging repo at [1]. 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. >>>>>> >>>>>> [1] >>>>>> https://repository.apache.org/content/repositories/orgapachestratos-1057/ >>>>>> >>>>>> Thanks. >>>>>> >>>>>> -- >>>>>> Akila Ravihansa Perera >>>>>> WSO2 Inc.; http://wso2.com/ >>>>>> >>>>>> Blog: http://ravihansa3000.blogspot.com >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Imesh Gunaratne >>>>> >>>>> Senior Technical Lead, WSO2 >>>>> Committer & PMC Member, Apache Stratos >>>>> >>>> >>>> >>>> >>>> -- >>>> Akila Ravihansa Perera >>>> WSO2 Inc.; http://wso2.com/ >>>> >>>> Blog: http://ravihansa3000.blogspot.com >>>> >>> >>> >>> >>> -- >>> Imesh Gunaratne >>> >>> Senior Technical Lead, WSO2 >>> Committer & PMC Member, Apache Stratos >>> >> >> >> >> -- >> Akila Ravihansa Perera >> WSO2 Inc.; http://wso2.com/ >> >> Blog: http://ravihansa3000.blogspot.com >> > > > > -- > Imesh Gunaratne > > Senior Technical Lead, WSO2 > Committer & PMC Member, Apache Stratos > -- Gayan Gunarathne Technical Lead, WSO2 Inc. (http://wso2.com) Committer & PMC Member, Apache Stratos email : gay...@wso2.com | mobile : +94 775030545 <%2B94%20766819985>