mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 07:27:21 +00:00
Allow replica set to be exposed as a service and add kubectl command tests for replica sets.
This commit is contained in:
@@ -39,12 +39,14 @@ Take a replication controller, service or pod and expose it as a new Kubernetes
|
||||
### Synopsis
|
||||
|
||||
|
||||
Take a replication controller, service, or pod and expose it as a new Kubernetes service.
|
||||
Take a replication controller, service, replica set or pod and expose it as a new Kubernetes service.
|
||||
|
||||
Looks up a replication controller, service, or pod by name and uses the selector for that resource as the
|
||||
selector for a new service on the specified port. Note that if no port is specified via --port and the
|
||||
exposed resource has multiple ports, all will be re-used by the new service. Also if no labels are specified,
|
||||
the new service will re-use the labels from the resource it exposes.
|
||||
Looks up a replication controller, service, replica set or pod by name and uses the selector for that
|
||||
resource as the selector for a new service on the specified port. A replica set will be exposed as a
|
||||
service only if it's selector is convertible to a selector that service supports, i.e. when the
|
||||
replica set selector contains only the matchLabels component. Note that if no port is specified
|
||||
via --port and the exposed resource has multiple ports, all will be re-used by the new service. Also
|
||||
if no labels are specified, the new service will re-use the labels from the resource it exposes.
|
||||
|
||||
```
|
||||
kubectl expose (-f FILENAME | TYPE NAME) [--port=port] [--protocol=TCP|UDP] [--target-port=number-or-name] [--name=name] [--external-ip=external-ip-of-service] [--type=type]
|
||||
@@ -67,6 +69,9 @@ $ kubectl expose service nginx --port=443 --target-port=8443 --name=nginx-https
|
||||
|
||||
# Create a service for a replicated streaming application on port 4100 balancing UDP traffic and named 'video-stream'.
|
||||
$ kubectl expose rc streamer --port=4100 --protocol=udp --name=video-stream
|
||||
|
||||
# Create a service for a replicated nginx using replica set, which serves on port 80 and connects to the containers on port 8000.
|
||||
$ kubectl expose rs nginx --port=80 --target-port=8000
|
||||
```
|
||||
|
||||
### Options
|
||||
@@ -88,7 +93,7 @@ $ kubectl expose rc streamer --port=4100 --protocol=udp --name=video-stream
|
||||
--protocol="TCP": The network protocol for the service to be created. Default is 'tcp'.
|
||||
--record[=false]: Record current kubectl command in the resource annotation.
|
||||
--save-config[=false]: If true, the configuration of current object will be saved in its annotation. This is useful when you want to perform kubectl apply on this object in the future.
|
||||
--selector="": A label selector to use for this service. If empty (the default) infer the selector from the replication controller.
|
||||
--selector="": A label selector to use for this service. Only equality-based selector requirements are supported. If empty (the default) infer the selector from the replication controller or replica set.
|
||||
--session-affinity="": If non-empty, set the session affinity for the service to this; legal values: 'None', 'ClientIP'
|
||||
-a, --show-all[=false]: When printing, show all resources (default hide terminated pods.)
|
||||
--show-labels[=false]: When printing, show all labels as the last column (default hide labels column)
|
||||
@@ -130,7 +135,7 @@ $ kubectl expose rc streamer --port=4100 --protocol=udp --name=video-stream
|
||||
|
||||
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
|
||||
|
||||
###### Auto generated by spf13/cobra on 22-Jan-2016
|
||||
###### Auto generated by spf13/cobra on 10-Feb-2016
|
||||
|
||||
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
|
||||
[]()
|
||||
|
||||
Reference in New Issue
Block a user