kubectl   run  nginx  --replicas=3  --image=nginx:1.12  --port  80 
kubectl   expose   deployment    nginx  --port=88     --type=NodePort  --target-port=80   --name=nginx-service
[root@k8s-master daemon]# kubectl  get svc 
NAME            TYPE        CLUSTER-IP    EXTERNAL-IP   PORT(S)        AGE
kubernetes      ClusterIP   10.10.10.1    <none>        443/TCP        12h
nginx-service   NodePort    10.10.10.84   <none>        88:36741/TCP   14m
[root@k8s-master daemon]# kubectl  get svc 
NAME            TYPE        CLUSTER-IP    EXTERNAL-IP   PORT(S)        AGE
kubernetes      ClusterIP   10.10.10.1    <none>        443/TCP        12h
nginx-service   NodePort    10.10.10.84   <none>        88:36741/TCP   14m
[root@k8s-master daemon]# kubectl  describe svc   nginx-service
Name:                     nginx-service
Namespace:                default
Labels:                   run=nginx
Annotations:              <none>
Selector:                 run=nginx
Type:                     NodePort
IP:                       10.10.10.84
Port:                     <unset>  88/TCP
TargetPort:               80/TCP
NodePort:                 <unset>  36741/TCP
Endpoints:                172.17.2.2:80,172.17.96.2:80,172.17.96.3:80
Session Affinity:         None
External Traffic Policy:  Cluster
Events:                   <none>

k8s-10-基础发布nginx_k8s-10-基础发布nginx