diff --git a/content/en/docs/reference/kubectl/docker-cli-to-kubectl.md b/content/en/docs/reference/kubectl/docker-cli-to-kubectl.md index 9cda6064aa..790ceea4df 100644 --- a/content/en/docs/reference/kubectl/docker-cli-to-kubectl.md +++ b/content/en/docs/reference/kubectl/docker-cli-to-kubectl.md @@ -13,7 +13,7 @@ You can use the Kubernetes command line tool kubectl to interact with the API Se ## docker run -To run an nginx Deployment and expose the Deployment, see [kubectl run](/docs/reference/generated/kubectl/kubectl-commands/#run). +To run an nginx Deployment and expose the Deployment, see [kubectl create deployment](/docs/reference/generated/kubectl/kubectl-commands#-em-deployment-em-). docker: @@ -36,10 +36,18 @@ kubectl: ```shell # start the pod running nginx -kubectl run --image=nginx nginx-app --port=80 --env="DOMAIN=cluster" +kubectl create deployment --image=nginx nginx-app ``` ``` -deployment "nginx-app" created +deployment.apps/nginx-app created +``` + +``` +# add env to nginx-app +kubectl set env deployment/nginx-app DOMAIN=cluster +``` +``` +deployment.apps/nginx-app env updated ``` {{< note >}} @@ -56,7 +64,7 @@ service "nginx-http" exposed By using kubectl, you can create a [Deployment](/docs/concepts/workloads/controllers/deployment/) to ensure that N pods are running nginx, where N is the number of replicas stated in the spec and defaults to 1. 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). -By default images run in the background, similar to `docker run -d ...`. To run things in the foreground, use: +By default images run in the background, similar to `docker run -d ...`. To run things in the foreground, use [`kubectl run`](/docs/reference/generated/kubectl/kubectl-commands/#run) to create pod: ```shell kubectl run [-i] [--tty] --attach --image=