{"action":"closed","issue":{"url":"https://api.github.com/repos/mesosphere/kubernetes-mesos/issues/116","labels_url":"https://api.github.com/repos/mesosphere/kubernetes-mesos/issues/116/labels{/name}","comments_url":"https://api.github.com/repos/mesosphere/kubernetes-mesos/issues/116/comments","events_url":"https://api.github.com/repos/mesosphere/kubernetes-mesos/issues/116/events","html_url":"https://github.com/mesosphere/kubernetes-mesos/issues/116","id":53616896,"number":116,"title":"Service takes host port (instead of container ports) to group pods","user":{"login":"sourav82","id":9670913,"avatar_url":"https://avatars.githubusercontent.com/u/9670913?v=3","gravatar_id":"","url":"https://api.github.com/users/sourav82","html_url":"https://github.com/sourav82","followers_url":"https://api.github.com/users/sourav82/followers","following_url":"https://api.github.com/users/sourav82/following{/other_user}","gists_url":"https://api.github.com/users/sourav82/gists{/gist_id}","starred_url":"https://api.github.com/users/sourav82/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sourav82/subscriptions","organizations_url":"https://api.github.com/users/sourav82/orgs","repos_url":"https://api.github.com/users/sourav82/repos","events_url":"https://api.github.com/users/sourav82/events{/privacy}","received_events_url":"https://api.github.com/users/sourav82/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mesosphere/kubernetes-mesos/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-07T10:13:55Z","updated_at":"2015-01-08T04:19:49Z","closed_at":"2015-01-08T04:19:49Z","body":"My service looks like below -\r\n\r\n{\r\n  \"apiVersion\": \"v1beta1\",\r\n  \"kind\": \"Service\",\r\n  \"id\": \"app\",\r\n  \"selector\": {\r\n    \"name\": \"app\"\r\n  },\r\n  \"containerPort\": 80,\r\n  \"port\": 8585,\r\n}\r\nI've pods created with below replication controller config -\r\n{\r\n  \"id\": \"app\",\r\n  \"apiVersion\": \"v1beta1\",\r\n  \"kind\": \"ReplicationController\",\r\n  \"desiredState\": {\r\n    \"replicas\": 3,\r\n    \"replicaSelector\": {\"name\": \"app\"},\r\n    \"podTemplate\": {\r\n      \"desiredState\": {\r\n        \"manifest\": {\r\n          \"version\": \"v1beta1\",\r\n          \"id\": \"app\",\r\n          \"containers\": [\r\n            {\r\n              \"name\": \"app\",\r\n              \"image\": \"10.227.125.10:5000/app-kubernetes\",\r\n              \"ports\": [{\"containerPort\": 80, \"hostPort\": 31020}]\r\n             }\r\n          ]\r\n        }\r\n      },\r\n      \"labels\": {\"name\": \"app\"}\r\n    }\r\n  },\r\n  \"labels\": {\"name\": \"app\"}\r\n}\r\nAfter 3 pods created by this replication controller, I start the service. But not able to access the application using http://10.227.125.10:8585/ (10.227.125.10 is the IP of the system where I created the service).\r\n\r\nBut, if I change the service to use port 31020 as container port, then I am able to use the service from IE in port 8585. As per documentation, \"containerPort\" of service should have the port of the container inside the pods. In this example, container port inside pod is 80 and host port is 31020. But the service is behaving differently. Please help here what wrong I am doing in setting it up.\r\n\r\nThanks & Regards,\r\nSourav"}}