Skip to content

Commit a01ea63

Browse files
author
Weiping Cai
committed
deprecated kubectl run command flag replicas and add note
Signed-off-by: Weiping Cai <[email protected]>
1 parent e990e46 commit a01ea63

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

content/en/docs/reference/kubectl/docker-cli-to-kubectl.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,11 @@ pod/nginx-app created
4343
```
4444

4545
{{< note >}}
46-
`kubectl` commands print the type and name of the resource created or mutated, which can then be used in subsequent commands. You can expose a new Service after a Pod is created.
46+
Pods are considered to be relatively ephemeral (rather than durable) entities,so you should use Deployment instead to make sure that your container are available throughout the cluster,see [kubectl create deployment](/docs/reference/generated/kubectl/kubectl-commands/#-em-deployment-em-),or [assign this pod to Node](/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector).
4747
{{< /note >}}
4848

49+
You can expose a new Service after a Pod is created.
50+
4951
```shell
5052
# expose a port through with a service
5153
kubectl expose pod nginx-app --port=80 --name=nginx-http
@@ -54,7 +56,7 @@ kubectl expose pod nginx-app --port=80 --name=nginx-http
5456
service "nginx-http" exposed
5557
```
5658

57-
By using kubectl, you can create a [Pod](/docs/concepts/workloads/pods/pod/) to ensure that pod are running nginx. You can also create a [service](/docs/concepts/services-networking/service/) with a selector that matches the pod labels. For more information, see [Use a Service to Access an Application in a Cluster](/docs/tasks/access-application-cluster/service-access-application-cluster).
59+
By using kubectl, you can create a [Pod](/docs/concepts/workloads/pods/pod/) that pod are running nginx. You can also create a [service](/docs/concepts/services-networking/service/) with a selector that matches the pod labels. For more information, see [Use a Service to Access an Application in a Cluster](/docs/tasks/access-application-cluster/service-access-application-cluster).
5860

5961
By default images run in the background, similar to `docker run -d ...`. To run things in the foreground, use:
6062

0 commit comments

Comments
 (0)