Merge pull request #22054 from soltysh/kubectl_run_updates

Update kubectl run from docs where necessary
This commit is contained in:
Kubernetes Prow Robot
2020-06-26 14:30:14 -07:00
committed by GitHub
6 changed files with 13 additions and 22 deletions
@@ -103,7 +103,7 @@ The caching semantics of the underlying image provider make even `imagePullPolic
- Use label selectors for `get` and `delete` operations instead of specific object names. See the sections on [label selectors](/docs/concepts/overview/working-with-objects/labels/#label-selectors) and [using labels effectively](/docs/concepts/cluster-administration/manage-deployment/#using-labels-effectively). - Use label selectors for `get` and `delete` operations instead of specific object names. See the sections on [label selectors](/docs/concepts/overview/working-with-objects/labels/#label-selectors) and [using labels effectively](/docs/concepts/cluster-administration/manage-deployment/#using-labels-effectively).
- Use `kubectl run` and `kubectl expose` to quickly create single-container Deployments and Services. See [Use a Service to Access an Application in a Cluster](/docs/tasks/access-application-cluster/service-access-application-cluster/) for an example. - Use `kubectl create deployment` and `kubectl expose` to quickly create single-container Deployments and Services. See [Use a Service to Access an Application in a Cluster](/docs/tasks/access-application-cluster/service-access-application-cluster/) for an example.
@@ -40,12 +40,6 @@ objects, it provides no history of previous configurations.
Run an instance of the nginx container by creating a Deployment object: Run an instance of the nginx container by creating a Deployment object:
```sh
kubectl run nginx --image nginx
```
Do the same thing using a different syntax:
```sh ```sh
kubectl create deployment nginx --image nginx kubectl create deployment nginx --image nginx
``` ```
@@ -23,7 +23,7 @@ Modification not using HostAliases is not suggested because the file is managed
Start an Nginx Pod which is assigned a Pod IP: Start an Nginx Pod which is assigned a Pod IP:
```shell ```shell
kubectl run nginx --image nginx --generator=run-pod/v1 kubectl run nginx --image nginx
``` ```
``` ```
@@ -121,7 +121,7 @@ document, use the backtick (`` ` ``).
{{< table caption = "Do and Don't - Use code style for inline code and commands" >}} {{< table caption = "Do and Don't - Use code style for inline code and commands" >}}
Do | Don't Do | Don't
:--| :----- :--| :-----
The `kubectl run`command creates a Deployment. | The "kubectl run" command creates a Deployment. The `kubectl run`command creates a Pod. | The "kubectl run" command creates a Pod.
For declarative management, use `kubectl apply`. | For declarative management, use "kubectl apply". For declarative management, use `kubectl apply`. | For declarative management, use "kubectl apply".
Enclose code samples with triple backticks. (\`\`\`)| Enclose code samples with any other syntax. Enclose code samples with triple backticks. (\`\`\`)| Enclose code samples with any other syntax.
Use single backticks to enclose inline code. For example, `var example = true`. | Use two asterisks (`**`) or an underscore (`_`) to enclose inline code. For example, **var example = true**. Use single backticks to enclose inline code. For example, `var example = true`. | Use two asterisks (`**`) or an underscore (`_`) to enclose inline code. For example, **var example = true**.
@@ -73,9 +73,6 @@ kubectl run [-i] [--tty] --attach <name> --image=<image>
Unlike `docker run ...`, if you specify `--attach`, then you attach `stdin`, `stdout` and `stderr`. You cannot control which streams are attached (`docker -a ...`). Unlike `docker run ...`, if you specify `--attach`, then you attach `stdin`, `stdout` and `stderr`. You cannot control which streams are attached (`docker -a ...`).
To detach from the container, you can type the escape sequence Ctrl+P followed by Ctrl+Q. To detach from the container, you can type the escape sequence Ctrl+P followed by Ctrl+Q.
Because the kubectl run command starts a Deployment for the container, the Deployment restarts if you terminate the attached process by using Ctrl+C, unlike `docker run -it`.
To destroy the Deployment and its pods you need to run `kubectl delete deployment <name>`.
## docker ps ## docker ps
To list what is currently running, see [kubectl get](/docs/reference/generated/kubectl/kubectl-commands/#get). To list what is currently running, see [kubectl get](/docs/reference/generated/kubectl/kubectl-commands/#get).
@@ -40,7 +40,7 @@ weight: 10
</ul> </ul>
</div> </div>
<div class="content__box content__box_fill"> <div class="content__box content__box_fill">
<p><i> You can create from the start a Deployment with multiple instances using the --replicas parameter for the kubectl run command </i></p> <p><i> You can create from the start a Deployment with multiple instances using the --replicas parameter for the kubectl create deployment command </i></p>
</div> </div>
</div> </div>
</div> </div>