{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/33319","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/33319/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/33319/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/33319/events","html_url":"https://github.com/kubernetes/kubernetes/pull/33319","id":178714631,"number":33319,"title":"Add option to set a service nodeport","user":{"login":"juanvallejo","id":3902875,"avatar_url":"https://avatars.githubusercontent.com/u/3902875?v=3","gravatar_id":"","url":"https://api.github.com/users/juanvallejo","html_url":"https://github.com/juanvallejo","followers_url":"https://api.github.com/users/juanvallejo/followers","following_url":"https://api.github.com/users/juanvallejo/following{/other_user}","gists_url":"https://api.github.com/users/juanvallejo/gists{/gist_id}","starred_url":"https://api.github.com/users/juanvallejo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juanvallejo/subscriptions","organizations_url":"https://api.github.com/users/juanvallejo/orgs","repos_url":"https://api.github.com/users/juanvallejo/repos","events_url":"https://api.github.com/users/juanvallejo/events{/privacy}","received_events_url":"https://api.github.com/users/juanvallejo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/cla:%20yes","name":"cla: yes","color":"bfe5bf"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/release-note-label-needed","name":"release-note-label-needed","color":"db5a64"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/size/M","name":"size/M","color":"eebb00"}],"state":"open","locked":false,"assignee":{"login":"AdoHe","id":1555564,"avatar_url":"https://avatars.githubusercontent.com/u/1555564?v=3","gravatar_id":"","url":"https://api.github.com/users/AdoHe","html_url":"https://github.com/AdoHe","followers_url":"https://api.github.com/users/AdoHe/followers","following_url":"https://api.github.com/users/AdoHe/following{/other_user}","gists_url":"https://api.github.com/users/AdoHe/gists{/gist_id}","starred_url":"https://api.github.com/users/AdoHe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdoHe/subscriptions","organizations_url":"https://api.github.com/users/AdoHe/orgs","repos_url":"https://api.github.com/users/AdoHe/repos","events_url":"https://api.github.com/users/AdoHe/events{/privacy}","received_events_url":"https://api.github.com/users/AdoHe/received_events","type":"User","site_admin":false},"assignees":[{"login":"AdoHe","id":1555564,"avatar_url":"https://avatars.githubusercontent.com/u/1555564?v=3","gravatar_id":"","url":"https://api.github.com/users/AdoHe","html_url":"https://github.com/AdoHe","followers_url":"https://api.github.com/users/AdoHe/followers","following_url":"https://api.github.com/users/AdoHe/following{/other_user}","gists_url":"https://api.github.com/users/AdoHe/gists{/gist_id}","starred_url":"https://api.github.com/users/AdoHe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdoHe/subscriptions","organizations_url":"https://api.github.com/users/AdoHe/orgs","repos_url":"https://api.github.com/users/AdoHe/repos","events_url":"https://api.github.com/users/AdoHe/events{/privacy}","received_events_url":"https://api.github.com/users/AdoHe/received_events","type":"User","site_admin":false},{"login":"pwittrock","id":7882754,"avatar_url":"https://avatars.githubusercontent.com/u/7882754?v=3","gravatar_id":"","url":"https://api.github.com/users/pwittrock","html_url":"https://github.com/pwittrock","followers_url":"https://api.github.com/users/pwittrock/followers","following_url":"https://api.github.com/users/pwittrock/following{/other_user}","gists_url":"https://api.github.com/users/pwittrock/gists{/gist_id}","starred_url":"https://api.github.com/users/pwittrock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pwittrock/subscriptions","organizations_url":"https://api.github.com/users/pwittrock/orgs","repos_url":"https://api.github.com/users/pwittrock/repos","events_url":"https://api.github.com/users/pwittrock/events{/privacy}","received_events_url":"https://api.github.com/users/pwittrock/received_events","type":"User","site_admin":false}],"milestone":null,"comments":10,"created_at":"2016-09-22T20:39:16Z","updated_at":"2016-09-27T23:13:18Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/33319","html_url":"https://github.com/kubernetes/kubernetes/pull/33319","diff_url":"https://github.com/kubernetes/kubernetes/pull/33319.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/33319.patch"},"body":"**Release note**:\r\n```release-note\r\nrelease-note-none\r\n```\r\n\r\nThis patch adds the option to set a nodeport when creating a NodePort\r\nservice. In case of a port allocation error due to a specified port\r\nbeing out of the valid range, the error now includes the valid\r\nrange. If a `--node-port` value is not specified, it defaults to zero, in\r\nwhich case the allocator will default to its current behavior of\r\nassigning an available port.\r\n\r\nThis patch also adds a new helper function in `cmd/util/helpers.go` to\r\nretrieve `Int32` cobra flags.\r\n\r\n**Example**\r\n```\r\n# create a nodeport service with an invalid port\r\n$ kubectl create service nodeport mynodeport --tcp=8080:7777 --node-port=1\r\nThe Service \"mynodeport\" is invalid: spec.ports[0].nodePort: Invalid\r\nvalue: 1: provided port is not in the valid range. Valid ports range\r\nfrom 30000-32767\r\n\r\n# create a nodeport service with a valid port\r\n$ kubectl create service nodeport mynodeport --tcp=8080:7777 --node-port=30000\r\nservice \"mynodeport\" created\r\n\r\n# create a nodeport service with a port already in use\r\n$ kubectl create service nodeport mynodeport --tcp=8080:7777 --node-port=30000\r\nThe Service \"mynodeport\" is invalid: spec.ports[0].nodePort: Invalid value: 3000: provided port is already allocated\r\n\r\n$ kubectl describe service mynodeport\r\nName:                   mynodeport\r\nNamespace:              default\r\nLabels:                 app=mynodeport\r\nSelector:               app=mynodeport\r\nType:                   NodePort\r\nIP:                     172.30.81.254\r\nPort:                   8080-7777       8080/TCP\r\nNodePort:               8080-7777       30000/TCP\r\nEndpoints:              <none>\r\nSession Affinity:       None\r\nNo events.\r\n```\r\n\r\n@fabianofranz\r\n\r\n<!-- Reviewable:start -->\r\n---\r\nThis change is [<img src=\"https://reviewable.kubernetes.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/33319)\r\n<!-- Reviewable:end -->\r\n"},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/250026226","html_url":"https://github.com/kubernetes/kubernetes/pull/33319#issuecomment-250026226","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/33319","id":250026226,"user":{"login":"pwittrock","id":7882754,"avatar_url":"https://avatars.githubusercontent.com/u/7882754?v=3","gravatar_id":"","url":"https://api.github.com/users/pwittrock","html_url":"https://github.com/pwittrock","followers_url":"https://api.github.com/users/pwittrock/followers","following_url":"https://api.github.com/users/pwittrock/following{/other_user}","gists_url":"https://api.github.com/users/pwittrock/gists{/gist_id}","starred_url":"https://api.github.com/users/pwittrock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pwittrock/subscriptions","organizations_url":"https://api.github.com/users/pwittrock/orgs","repos_url":"https://api.github.com/users/pwittrock/repos","events_url":"https://api.github.com/users/pwittrock/events{/privacy}","received_events_url":"https://api.github.com/users/pwittrock/received_events","type":"User","site_admin":false},"created_at":"2016-09-27T23:13:18Z","updated_at":"2016-09-27T23:13:18Z","body":"Adding the flag makes sense to me.  @AdoHe looks like @lavalamp has already done a review on this, but makes sense to take a pass and make sure things conform to kubectl best practices"}}
{"actor":{"display_login":"pwittrock"}}