{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/14484","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/14484/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/14484/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/14484/events","html_url":"https://github.com/kubernetes/kubernetes/issues/14484","id":108113987,"number":14484,"title":"Proposal: Affinity Priority for pods of different RC/services","user":{"login":"kevin-wangzefeng","id":6914660,"avatar_url":"https://avatars.githubusercontent.com/u/6914660?v=3","gravatar_id":"","url":"https://api.github.com/users/kevin-wangzefeng","html_url":"https://github.com/kevin-wangzefeng","followers_url":"https://api.github.com/users/kevin-wangzefeng/followers","following_url":"https://api.github.com/users/kevin-wangzefeng/following{/other_user}","gists_url":"https://api.github.com/users/kevin-wangzefeng/gists{/gist_id}","starred_url":"https://api.github.com/users/kevin-wangzefeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevin-wangzefeng/subscriptions","organizations_url":"https://api.github.com/users/kevin-wangzefeng/orgs","repos_url":"https://api.github.com/users/kevin-wangzefeng/repos","events_url":"https://api.github.com/users/kevin-wangzefeng/events{/privacy}","received_events_url":"https://api.github.com/users/kevin-wangzefeng/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/area/scheduling","name":"area/scheduling","color":"ab6420"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/priority/P2","name":"priority/P2","color":"fbca04"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/team/api","name":"team/api","color":"d2b48c"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/team/control-plane","name":"team/control-plane","color":"d2b48c"}],"state":"open","locked":false,"assignee":{"login":"davidopp","id":8264113,"avatar_url":"https://avatars.githubusercontent.com/u/8264113?v=3","gravatar_id":"","url":"https://api.github.com/users/davidopp","html_url":"https://github.com/davidopp","followers_url":"https://api.github.com/users/davidopp/followers","following_url":"https://api.github.com/users/davidopp/following{/other_user}","gists_url":"https://api.github.com/users/davidopp/gists{/gist_id}","starred_url":"https://api.github.com/users/davidopp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidopp/subscriptions","organizations_url":"https://api.github.com/users/davidopp/orgs","repos_url":"https://api.github.com/users/davidopp/repos","events_url":"https://api.github.com/users/davidopp/events{/privacy}","received_events_url":"https://api.github.com/users/davidopp/received_events","type":"User","site_admin":false},"milestone":null,"comments":8,"created_at":"2015-09-24T11:40:44Z","updated_at":"2015-10-01T13:59:56Z","closed_at":null,"body":"When deploying a multi-layer application, a typical model is to spread the pods of same layer while placing pods of different layers together.\r\nCurrently the scheduler can spread pods from the same RC and/or Service, but cannot affiliate a pod to another.\r\n\r\nThis proposal is to support the affinity priority between pods of different RC/services.\r\n\r\nAs a first step, we use label selector to implement. When scheduling, the scheduler compares affinitySelector with all pods’ labels on each node. Nodes with pods(that have particular label values) running on will get high score.\r\n\r\nThe initial version will be in a followup PR, thanks to have a look and let me know.\r\n\r\n**Here is a example of usage**  \r\nThe definition of Redis:  \r\n```\r\napiVersion: v1\r\nkind: ReplicationController\r\nmetadata:\r\n  name: redis-rc\r\n  labels:\r\n    name: redis-rc\r\nspec:\r\n  replicas: 2\r\n  selector:\r\n    service: redis\r\n  template:\r\n    metadata:\r\n      labels:\r\n        service: redis\r\n    spec:\r\n      containers:\r\n      - name: redis-container\r\n        image: redis\r\n```\r\n\r\n\r\nThe definition of application that accesses Redis:\r\n```\r\napiVersion: v1\r\nkind: ReplicationController\r\nmetadata:\r\n  name: nodejs\r\n  labels:\r\n    name: nodejs\r\nspec:\r\n  replicas: 2\r\n  selector:\r\n    name: nodejs\r\n  template:\r\n    metadata:\r\n      labels:\r\n        name: nodejs\r\n    spec:\r\n      containers:\r\n      - name: nodejs-container\r\n        image: nodejs\r\n      affinitySelector:\r\n        service: redis\r\n```"},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/144734392","html_url":"https://github.com/kubernetes/kubernetes/issues/14484#issuecomment-144734392","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/14484","id":144734392,"user":{"login":"kevin-wangzefeng","id":6914660,"avatar_url":"https://avatars.githubusercontent.com/u/6914660?v=3","gravatar_id":"","url":"https://api.github.com/users/kevin-wangzefeng","html_url":"https://github.com/kevin-wangzefeng","followers_url":"https://api.github.com/users/kevin-wangzefeng/followers","following_url":"https://api.github.com/users/kevin-wangzefeng/following{/other_user}","gists_url":"https://api.github.com/users/kevin-wangzefeng/gists{/gist_id}","starred_url":"https://api.github.com/users/kevin-wangzefeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevin-wangzefeng/subscriptions","organizations_url":"https://api.github.com/users/kevin-wangzefeng/orgs","repos_url":"https://api.github.com/users/kevin-wangzefeng/repos","events_url":"https://api.github.com/users/kevin-wangzefeng/events{/privacy}","received_events_url":"https://api.github.com/users/kevin-wangzefeng/received_events","type":"User","site_admin":false},"created_at":"2015-10-01T13:59:56Z","updated_at":"2015-10-01T13:59:56Z","body":"Thanks for the feedback, I will update the implementation in the PR thread and let's see if it will look better then."}}