{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/3453","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/3453/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/3453/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/3453/events","html_url":"https://github.com/GoogleCloudPlatform/kubernetes/issues/3453","id":54288404,"number":3453,"title":"Revist design of Annotations currently stored in docker container name","user":{"login":"saad-ali","id":10052848,"avatar_url":"https://avatars.githubusercontent.com/u/10052848?v=3","gravatar_id":"","url":"https://api.github.com/users/saad-ali","html_url":"https://github.com/saad-ali","followers_url":"https://api.github.com/users/saad-ali/followers","following_url":"https://api.github.com/users/saad-ali/following{/other_user}","gists_url":"https://api.github.com/users/saad-ali/gists{/gist_id}","starred_url":"https://api.github.com/users/saad-ali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saad-ali/subscriptions","organizations_url":"https://api.github.com/users/saad-ali/orgs","repos_url":"https://api.github.com/users/saad-ali/repos","events_url":"https://api.github.com/users/saad-ali/events{/privacy}","received_events_url":"https://api.github.com/users/saad-ali/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/labels/component/kubelet","name":"component/kubelet","color":"0052cc"},{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/labels/kind/design","name":"kind/design","color":"50cba5"},{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/labels/priority/P2","name":"priority/P2","color":"fbca04"},{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/labels/team/node","name":"team/node","color":"d2b48c"}],"state":"open","locked":false,"assignee":{"login":"yujuhong","id":10524058,"avatar_url":"https://avatars.githubusercontent.com/u/10524058?v=3","gravatar_id":"","url":"https://api.github.com/users/yujuhong","html_url":"https://github.com/yujuhong","followers_url":"https://api.github.com/users/yujuhong/followers","following_url":"https://api.github.com/users/yujuhong/following{/other_user}","gists_url":"https://api.github.com/users/yujuhong/gists{/gist_id}","starred_url":"https://api.github.com/users/yujuhong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yujuhong/subscriptions","organizations_url":"https://api.github.com/users/yujuhong/orgs","repos_url":"https://api.github.com/users/yujuhong/repos","events_url":"https://api.github.com/users/yujuhong/events{/privacy}","received_events_url":"https://api.github.com/users/yujuhong/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/milestones/6","html_url":"https://github.com/GoogleCloudPlatform/kubernetes/milestones/v1.0","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/milestones/6/labels","id":969317,"number":6,"title":"v1.0","description":"Issues that need to be resolved for v1.0 of Kubernetes.","creator":{"login":"goltermann","id":9358478,"avatar_url":"https://avatars.githubusercontent.com/u/9358478?v=3","gravatar_id":"","url":"https://api.github.com/users/goltermann","html_url":"https://github.com/goltermann","followers_url":"https://api.github.com/users/goltermann/followers","following_url":"https://api.github.com/users/goltermann/following{/other_user}","gists_url":"https://api.github.com/users/goltermann/gists{/gist_id}","starred_url":"https://api.github.com/users/goltermann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goltermann/subscriptions","organizations_url":"https://api.github.com/users/goltermann/orgs","repos_url":"https://api.github.com/users/goltermann/repos","events_url":"https://api.github.com/users/goltermann/events{/privacy}","received_events_url":"https://api.github.com/users/goltermann/received_events","type":"User","site_admin":false},"open_issues":109,"closed_issues":22,"state":"open","created_at":"2015-02-06T20:27:16Z","updated_at":"2015-03-03T04:54:25Z","due_on":null,"closed_at":null},"comments":41,"created_at":"2015-01-14T06:21:32Z","updated_at":"2015-03-03T15:28:38Z","closed_at":null,"body":"We currently only supports one annotation (container source), and it is stored as part of the docker container name ([pkg/kubelet/types.go#L73](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/pkg/kubelet/types.go#L73)):\r\n```GO\r\n// GetPodFullName returns a name that uniquely identifies a pod across all config sources.\r\nfunc GetPodFullName(pod *api.BoundPod) string {\r\n\treturn fmt.Sprintf(\"%s.%s.%s\", pod.Name, pod.Namespace, pod.Annotations[ConfigSourceAnnotationKey])\r\n}\r\n\r\n// ParsePodFullName unpacks a pod full name and returns the pod name, namespace, and annotations.\r\n// If the pod full name is invalid, empty strings are returend.\r\nfunc ParsePodFullName(podFullName string) (podName, podNamespace string, podAnnotations map[string]string) {\r\n\tparts := strings.Split(podFullName, \".\")\r\n\texpectedNumFields := 3\r\n\tactualNumFields := len(parts)\r\n\tif actualNumFields != expectedNumFields {\r\n\t\tglog.Warningf(\"found a podFullName (%q) with too few fields: expected %d, actual %d.\", podFullName, expectedNumFields, actualNumFields)\r\n\t\treturn\r\n\t}\r\n\tpodName = parts[0]\r\n\tpodNamespace = parts[1]\r\n\tpodAnnotations = make(map[string]string)\r\n\tpodAnnotations[ConfigSourceAnnotationKey] = parts[2]\r\n\treturn\r\n}\r\n```\r\nExample Kubernetes Docker container name:\r\n```\r\n/k8s_mynginx1.18b0b73d_ca4e7148-9ab9-11e4-924c-f0921cde18c1.default.etcd_ca4e7148-9ab9-11e4-924c-f0921cde18c1_7b81f5b7\r\n  ^     ^       ^           ^                                                 ^                                   ^\r\n  |     |       |           |                                                 |                                   |\r\n prefix |    hash       full pod name                                       uuid                          rand.Uint32()\r\n      container name\r\n```\r\nThe delimiter is \"```_```\", so the full pod name is:\r\n```\r\nca4e7148-9ab9-11e4-924c-f0921cde18c1.default.etcd\r\n  ^                                   ^        ^\r\n  |                                   |        |\r\npod name                     pod name space    |\r\n                                           pod source\r\n```\r\nThe delimiter is \"```.```\", and so the source is:\r\n ```\r\netcd\r\n```\r\n\r\nQuestions to consider:\r\n* Will we ever have more then one annotation?\r\n* If so, should annotations be stored in the docker container name, or elsewhere?\r\n* If the annotations should be stored in the container name, what would the key value pairs/delimiters look like (keep in mind that \".\" is already used as a delimiter for the pod name fields and \"_\" is used as a delimiter for the container name fields)?\r\n* If the annotations should be stored in the container name, what validation, if any should be done on key/value pairs to avoid parsing errors?"},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/comments/76966643","html_url":"https://github.com/GoogleCloudPlatform/kubernetes/issues/3453#issuecomment-76966643","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/3453","id":76966643,"user":{"login":"bgrant0607","id":7725777,"avatar_url":"https://avatars.githubusercontent.com/u/7725777?v=3","gravatar_id":"","url":"https://api.github.com/users/bgrant0607","html_url":"https://github.com/bgrant0607","followers_url":"https://api.github.com/users/bgrant0607/followers","following_url":"https://api.github.com/users/bgrant0607/following{/other_user}","gists_url":"https://api.github.com/users/bgrant0607/gists{/gist_id}","starred_url":"https://api.github.com/users/bgrant0607/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgrant0607/subscriptions","organizations_url":"https://api.github.com/users/bgrant0607/orgs","repos_url":"https://api.github.com/users/bgrant0607/repos","events_url":"https://api.github.com/users/bgrant0607/events{/privacy}","received_events_url":"https://api.github.com/users/bgrant0607/received_events","type":"User","site_admin":false},"created_at":"2015-03-03T15:28:38Z","updated_at":"2015-03-03T15:28:38Z","body":"Name generation in Kubelet needs to be deterministic, so that it can easily evaluate whether the pods in files have already been created or not. It's just a matter of how we want to express that.\r\n\r\nGenerateName should have no effect in apiserver if Name is already initialized by Kubelet."}}