Change RC to deployments in multi-container and simple-nginx docs

pull/505/head
Janet Kuo 2016-05-12 15:35:22 -07:00
parent 7edbc5f944
commit ded5417580
2 changed files with 17 additions and 18 deletions

View File

@ -15,16 +15,13 @@ Multi-container pods must be created with the `create` command. Properties
are passed to the command as a YAML- or JSON-formatted configuration file. are passed to the command as a YAML- or JSON-formatted configuration file.
The `create` command can be used to create a pod directly, or it can create The `create` command can be used to create a pod directly, or it can create
a pod or pods through a replication controller. It is highly recommended that a pod or pods through a `Deployment`. It is highly recommended that
you use a you use a
[replication controller](/docs/user-guide/replication-controller/) [Deployment](/docs/user-guide/deployments/)
to create your pods. The controller watches for failed pods and will start up to create your pods. It watches for failed pods and will start up
new pods as required to maintain the specified number. new pods as required to maintain the specified number.
For instructions on creating pods with a replication controller, refer to If you don't want a Deployment to monitor your pod (e.g. your pod
[Creating replication controllers](/docs/user-guide/replication-controller/operations/).
If you don't want a replication controller to monitor your pod (e.g. your pod
is writing non-persistent data which won't survive a restart, or your pod is is writing non-persistent data which won't survive a restart, or your pod is
intended to be very short-lived), you can create a pod directly with the intended to be very short-lived), you can create a pod directly with the
`create` command. `create` command.
@ -32,12 +29,12 @@ intended to be very short-lived), you can create a pod directly with the
### Using `create` ### Using `create`
Note: We recommend using a Note: We recommend using a
[replication controller](/docs/user-guide/replication-controller/) [Deployment](/docs/user-guide/deployments/)
to create pods. You should use the instructions below only if you don't want to create pods. You should use the instructions below only if you don't want
to create a replication controller. to create a Deployment.
If your pod will contain more than one container, or if you don't want to If your pod will contain more than one container, or if you don't want to
create a replication controller to manage your pod, use the create a Deployment to manage your pod, use the
`kubectl create` command and pass a pod specification as a JSON- or `kubectl create` command and pass a pod specification as a JSON- or
YAML-formatted configuration file. YAML-formatted configuration file.
@ -75,7 +72,7 @@ Required fields are:
unique within the namespace. unique within the namespace.
* `labels`: Optional. Labels are arbitrary key:value pairs that can be used * `labels`: Optional. Labels are arbitrary key:value pairs that can be used
by by
[replication controllers](/docs/user-guide/replication-controller) [Deployment](/docs/user-guide/deployments/)
and [services](/docs/user-guide/services/) for grouping and targeting and [services](/docs/user-guide/services/) for grouping and targeting
pods. pods.
* `generateName`: Required if `name` is not set. A prefix to use to generate * `generateName`: Required if `name` is not set. A prefix to use to generate

View File

@ -9,7 +9,9 @@ to Kubernetes and running your first containers on the cluster.
From this point onwards, it is assumed that `kubectl` is on your path from one of the getting started guides. From this point onwards, it is assumed that `kubectl` is on your path from one of the getting started guides.
The [`kubectl run`](/docs/user-guide/kubectl/kubectl_run) line below will create two [nginx](https://registry.hub.docker.com/_/nginx/) [pods](/docs/user-guide/pods) listening on port 80. It will also create a [replication controller](/docs/user-guide/replication-controller) named `my-nginx` to ensure that there are always two pods running. The [`kubectl run`](/docs/user-guide/kubectl/kubectl_run) line below will create a [`Deployment`](/docs/user-guide/deployments) named `my-nginx`, and
two [nginx](https://registry.hub.docker.com/_/nginx/) [pods](/docs/user-guide/pods) listening on port 80. The `Deployment` will ensure that there are
always exactly two pod running as specified in its spec.
```shell ```shell
kubectl run my-nginx --image=nginx --replicas=2 --port=80 kubectl run my-nginx --image=nginx --replicas=2 --port=80
@ -21,16 +23,16 @@ Once the pods are created, you can list them to see what is up and running:
kubectl get pods kubectl get pods
``` ```
You can also see the replication controller that was created: You can also see the Deployment that was created:
```shell ```shell
kubectl get rc kubectl get deployments
``` ```
To stop the two replicated containers, delete the replication controller: To stop the two replicated containers, delete the Deployment:
```shell ```shell
kubectl delete rc my-nginx kubectl delete deployment my-nginx
``` ```
### Exposing your pods to the internet. ### Exposing your pods to the internet.
@ -39,7 +41,7 @@ On some platforms (for example Google Compute Engine) the kubectl command can in
to do this run: to do this run:
```shell ```shell
kubectl expose rc my-nginx --port=80 --type=LoadBalancer kubectl expose deployment my-nginx --port=80 --type=LoadBalancer
``` ```
This should print the service that has been created, and map an external IP address to the service. Where to find this external IP address will depend on the environment you run in. For instance, for Google Compute Engine the external IP address is listed as part of the newly created service and can be retrieved by running This should print the service that has been created, and map an external IP address to the service. Where to find this external IP address will depend on the environment you run in. For instance, for Google Compute Engine the external IP address is listed as part of the newly created service and can be retrieved by running
@ -53,4 +55,4 @@ In order to access your nginx landing page, you also have to make sure that traf
### Next: Configuration files ### Next: Configuration files
Most people will eventually want to use declarative configuration files for creating/modifying their applications. A [simplified introduction](/docs/user-guide/deploying-applications/) Most people will eventually want to use declarative configuration files for creating/modifying their applications. A [simplified introduction](/docs/user-guide/deploying-applications/)
is given in a different document. is given in a different document.