run
Using run command
Create and run a particular image in a pod. Pods are the smallest deployable units of computing that you can create and manage in Kubernetes.
Important
run
command is deprecated
Command
$ kubectl run NAME --image=image [--env="key=value"] [--port=port] [--dry-run=server|client] [--overrides=inline-json] [--command] -- [COMMAND] [args...]
Example
Command
kubectl run nginx --image=nginx
Output
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
nginx-6db489d4b7-tsfhq 1/1 Running 0 28s
$ kubectl get deployment
NAME READY UP-TO-DATE AVAILABLE AGE
nginx 1/1 1 1 44s
当前内容版权归 kubernetes官网 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 kubernetes官网 .