Add a service generator and a command to easily expose services.

This commit is contained in:
Brendan Burns
2015-01-16 17:52:27 -08:00
parent c65f83f424
commit 09166f5252
8 changed files with 291 additions and 28 deletions

View File

@@ -394,7 +394,11 @@ Additional help topics:
kubectl rollingupdate Perform a rolling update of the given ReplicationController
kubectl resize Set a new size for a resizable resource (currently only Replication Controllers)
kubectl run-container Run a particular image on the cluster.
<<<<<<< HEAD
kubectl stop Gracefully shutdown a resource
=======
kubectl expose Take a replicated application and expose it as Kubernetes Service
>>>>>>> Add a service generator and a command to easily expose services.
Use "kubectl help [command]" for more information about that command.
```
@@ -899,7 +903,7 @@ Examples:
Usage:
```
kubectl run-container <name> --image=<image> [--replicas=replicas] [--dry-run=<bool>] [--overrides=<inline-json>] [flags]
kubectl run-container <name> --image=<image> [--port=<port>] [--replicas=replicas] [--dry-run=<bool>] [--overrides=<inline-json>] [flags]
Available Flags:
--alsologtostderr=false: log to standard error as well as files
@@ -911,12 +915,11 @@ Usage:
--cluster="": The name of the kubeconfig cluster to use
--context="": The name of the kubeconfig context to use
--dry-run=false: If true, only print the object that would be sent, don't actually do anything
--generator="run-container/v1": The name of the api generator that you want to use. Default 'run-container-controller-v1'
--generator="run-container/v1": The name of the api generator that you want to use. Default 'run-container-controller/v1'
-h, --help=false: help for run-container
--image="": The image for the container you wish to run.
--insecure-skip-tls-verify=false: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--kubeconfig="": Path to the kubeconfig file to use for CLI requests.
-l, --labels="": Labels to apply to the pod(s) created by this call to run.
--log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
--log_dir=: If non-empty, write log files in this directory
--log_flush_frequency=5s: Maximum number of seconds between log flushes
@@ -928,6 +931,8 @@ Usage:
-o, --output="": Output format: json|yaml|template|templatefile
--output-version="": Output the formatted object with the given version (default api-version)
--overrides="": An inline JSON override for the generated object. If this is non-empty, it is parsed used to override the generated object. Requires that the object supply a valid apiVersion field.
--port=-1: The port that this container exposes.
--public-ip="": A public IP address to use for this service.
-r, --replicas=1: Number of replicas to create for this container. Default 1
-s, --server="": The address of the Kubernetes API server
--stderrthreshold=2: logs at or above this threshold go to stderr
@@ -940,6 +945,7 @@ Usage:
```
<<<<<<< HEAD
#### stop
Gracefully shutdown a resource
@@ -949,11 +955,29 @@ If the resource is resizable it will be resized to 0 before deletion.
Examples:
$ kubectl stop replicationcontroller foo
foo stopped
=======
#### expose
Take a replicated application and expose it as Kubernetes Service.
Looks up a ReplicationController named <name>, and uses the selector for that replication controller
as the selector for a new Service which services on <port>
Examples:
$ kubectl expose nginx --port=80 --container-port=8000
<creates a service for a replicated nginx, which serves on port 80 and connects to the containers on port 8000>
$ kubectl expose streamer --port=4100 --protocol=udp --service-name=video-stream
<create a service for a replicated streaming application on port 4100 balancing UDP traffic and is named 'video-stream'>
>>>>>>> Add a service generator and a command to easily expose services.
Usage:
```
<<<<<<< HEAD
kubectl stop <resource> <id> [flags]
=======
kubectl expose <name> --port=<port> [--protocol=TCP|UDP] [--container-port=<number-or-name>] [--service-name=<name>] [--public-ip=<ip>] [--create-external-load-balancer] [flags]
>>>>>>> Add a service generator and a command to easily expose services.
Available Flags:
--alsologtostderr=false: log to standard error as well as files
@@ -963,18 +987,45 @@ Usage:
--client-certificate="": Path to a client key file for TLS.
--client-key="": Path to a client key file for TLS.
--cluster="": The name of the kubeconfig cluster to use
<<<<<<< HEAD
--context="": The name of the kubeconfig context to use
--insecure-skip-tls-verify=false: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--kubeconfig="": Path to the kubeconfig file to use for CLI requests.
=======
--container-port="": Name or number for the port on the container that the service should direct traffic to. Optional.
--context="": The name of the kubeconfig context to use
--create-external-load-balancer=false: If true, create an external load balancer for this service. Implementation is cloud provider dependent. Default false
--dry-run=false: If true, only print the object that would be sent, don't actually do anything
--generator="service/v1": The name of the api generator that you want to use. Default 'service/v1'
-h, --help=false: help for expose
--insecure-skip-tls-verify=false: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--kubeconfig="": Path to the kubeconfig file to use for CLI requests.
-l, --labels="": Labels to apply to the pod(s) created by this call to run.
>>>>>>> Add a service generator and a command to easily expose services.
--log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
--log_dir=: If non-empty, write log files in this directory
--log_flush_frequency=5s: Maximum number of seconds between log flushes
--logtostderr=true: log to standard error instead of files
--match-server-version=false: Require server version to match client version
<<<<<<< HEAD
--namespace="": If present, the namespace scope for this CLI request.
--ns-path="": Path to the namespace info file that holds the namespace context to use for CLI requests.
-s, --server="": The address of the Kubernetes API server
--stderrthreshold=2: logs at or above this threshold go to stderr
=======
-n, --namespace="": If present, the namespace scope for this CLI request.
--no-headers=false: When using the default output, don't print headers
--ns-path="/home/username/.kubernetes_ns": Path to the namespace info file that holds the namespace context to use for CLI requests.
-o, --output="": Output format: json|yaml|template|templatefile
--output-version="": Output the formatted object with the given version (default api-version)
--overrides="": An inline JSON override for the generated object. If this is non-empty, it is parsed used to override the generated object. Requires that the object supply a valid apiVersion field.
--port=-1: The port that the service should serve on. Required.
--protocol="TCP": The network protocol for the service you want to be created. Default 'tcp'
-s, --server="": The address of the Kubernetes API server
--service-name="": The name for the newly create service.
--stderrthreshold=2: logs at or above this threshold go to stderr
-t, --template="": Template string or path to template file to use when -o=template or -o=templatefile.
>>>>>>> Add a service generator and a command to easily expose services.
--token="": Bearer token for authentication to the API server.
--user="": The name of the kubeconfig user to use
--v=0: log level for V logs