mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-08 12:41:58 +00:00
Support setting env vars in kubectl run
This commit is contained in:
@@ -58,7 +58,7 @@ How do I run an nginx container and expose it to the world? Checkout [kubectl ru
|
||||
With docker:
|
||||
|
||||
```console
|
||||
$ docker run -d --restart=always --name nginx-app -p 80:80 nginx
|
||||
$ docker run -d --restart=always -e DOMAIN=cluster --name nginx-app -p 80:80 nginx
|
||||
a9ec34d9878748d2f33dc20cb25c714ff21da8d40558b45bfaec9955859075d0
|
||||
$ docker ps
|
||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
@@ -69,7 +69,7 @@ With kubectl:
|
||||
|
||||
```console
|
||||
# start the pod running nginx
|
||||
$ kubectl run --image=nginx nginx-app
|
||||
$ kubectl run --image=nginx nginx-app --port=80 --env="DOMAIN=local"
|
||||
CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS
|
||||
nginx-app nginx-app nginx run=nginx-app 1
|
||||
# expose a port through with a service
|
||||
|
Reference in New Issue
Block a user