Usage: kubectl run NAME --image=image [--env="key=value"] [--port=port] [--replicas=replicas] [--dry-run=bool] [options]
Man: 通过kubectl创建一个deployment或者Job。name为deployment的名字,image为容器的镜像
port为对容器外暴露的端口,replicas为副本数,dry-run为干运行(不创建pod)
[root@hdss7-21 ~]# kubectl run web-deploy --image=harbor.od.com/public/nginx:latest --replicas=2
[root@hdss7-21 ~]# kubectl get deployment
NAME READY UP-TO-DATE AVAILABLE AGE
web-deploy 2/2 2 2 92s
[root@hdss7-21 ~]# kubectl get pods|grep web-deploy
web-deploy-bc78f6667-5s6rq 1/1 Running 0 119s
web-deploy-bc78f6667-h67zb 1/1 Running 0 119s