Commit Graph

10 Commits (99ebcd94c9404ae6c00498712b095ad132b8d447)

Author SHA1 Message Date
Yanqiang Miao fe9303d7f7 Make sure the ports is valid when parsing portString 2017-11-13 20:46:05 +08:00
ymqytw 4487cc5e15 switch some commands to use its own scheme 2017-10-27 18:31:42 -07:00
xiangpengzhao 9e31eb280a Populate endpoints and allow ports with headless service 2017-06-28 11:15:51 +08:00
deads2k c9a008dff3 move util/intstr to apimachinery 2017-01-30 12:46:59 -05:00
Clayton Coleman 9a2a50cda7
refactor: use metav1.ObjectMeta in other types 2017-01-17 16:17:19 -05:00
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
AdoHe d66bcbfa61 create service add create ExternalName service implementation 2016-11-16 04:47:10 -05:00
juanvallejo cfbdcec7d6 make portallocator.ErrNotInRange a type 2016-10-04 13:19:24 -04:00
juanvallejo 6b83f89d47 Add option to set a service nodeport
This patch adds the option to set a nodeport when creating a NodePort
service. In case of a port allocation error due to a specified port
being out of the valid range, the error now includes the valid
range. If a `--node-port` value is not specified, it defaults to zero, in
which case the allocator will default to its current behavior of
assigning an available port.

This patch also adds a new helper function in `cmd/util/helpers.go` to
retrieve `Int32` cobra flags.

**Example**
```
$ kubectl create service nodeport mynodeport --tcp=8080:7777 --node-port=1
The Service "mynodeport" is invalid: spec.ports[0].nodePort: Invalid
value: 1: provided port is not in the valid range. Valid ports range
from 30000-32767

$ kubectl create service nodeport mynodeport --tcp=8080:7777 --node-port=30000
service "mynodeport" created

$ oc describe service mynodeport
Name:                   mynodeport
Namespace:              default
Labels:                 app=mynodeport
Selector:               app=mynodeport
Type:                   NodePort
IP:                     172.30.81.254
Port:                   8080-7777       8080/TCP
NodePort:               8080-7777       30000/TCP
Endpoints:              <none>
Session Affinity:       None
No events.
```
2016-10-04 13:19:24 -04:00
Angus Salkeld 42ca885edb Add "create service" sub-commands
This adds:
 create service clusterip
 create service nodeport
 create service loadbalancer
2016-08-08 12:31:21 +10:00