Hide Forgot
Description of problem: Didn't have '--nodeport' option for create nodeport service , couldn't specify the nodeport for nodeport service. Version-Release number of selected component (if applicable): openshift version openshift v1.4.0-alpha.0+16f2d39 kubernetes v1.4.0-beta.3+d19513f etcd 3.0.9 How reproducible: Always Steps to Reproduce: 1. Login OpenShift and create project; 2. Check help info for create nodeport service command; Actual results: 2. There was no '--nodeport' option for nodeport service command Expected results: 2. Should have option for create nodeport service to specify the nodeport. Additional info:
Hm, could you clarify a bit more on this bug? I believe I may be misunderstanding this bug: Although `oc create service nodeport` does not have a `--nodeport` option, it does have a `--tcp` option which takes a "<port>:<target_port>". 1. Create a new nodeport service `$ oc create service nodeport mynodeport --tcp=80:8080` 2. Describe this service ``` $ oc describe service/mynodeport Name: mynodeport Namespace: default Labels: app=mynodeport Selector: app=mynodeport Type: NodePort IP: 172.30.149.2 Port: 80-8080 80/TCP NodePort: 80-8080 30206/TCP Endpoints: <none> Session Affinity: None No events. ``` As can be seen in the above case, although there is no `--nodeport` option, a "nodeport" value can still be specified through the command with `--tcp`. Version: oc v1.3.0-rc1+2b9e40a-dirty kubernetes v1.4.0-beta.3+d19513f features: Basic-Auth Server https://10.13.137.149:8443 openshift v1.3.0-rc1 kubernetes v1.3.0+52492b4
But the nodeport (NodePort: 80-8080 30206/TCP) is random from the range, if has option, we could specify the nodeport.
Juan, Zhou, yes, I see what you mean. If you don't want the nodeport to be randomly generated, you'd need to specify it somehow. Juan, I can show you where that could be set.
Thanks for your help Cesar! Related PR: https://github.com/openshift/origin/pull/11059
Confirmed with the latest origin ami , the issue has fixed: openshift version openshift v1.4.0-alpha.0+606716e kubernetes v1.4.0+776c994 etcd 3.1.0-alpha.1 [zhouy@zhouy testjson]$ oc create service nodeport hello-pod --tcp=5678:8080 --node-port=30899 service "hello-pod" created [zhouy@zhouy testjson]$ oc get service NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE hello-pod 172.30.43.122 <nodes> 5678/TCP <invalid> [zhouy@zhouy testjson]$ oc describe service hello-pod Name: hello-pod Namespace: zhouy Labels: app=hello-pod Selector: app=hello-pod Type: NodePort IP: 172.30.43.122 Port: 5678-8080 5678/TCP NodePort: 5678-8080 30899/TCP Endpoints: 172.17.0.2:8080 Session Affinity: None No events. [root@ip-172-18-4-233 ~]# curl 172.18.4.233:30899 Hello OpenShift!