k8s- Application Quick Start (ma)

[root@k8s-master ~]# kubectl run nginx-deploy --image=nginx:1.14-alpine --port=80 --replicas=1
deployment "nginx-deploy" created

[root@k8s-master ~]# kubectl expose deployment nginx-deploy --name nginx --port=80 --target-port=80 --protocol=TCP  ###target-port等于上图pod_port,--port等于service_port
service "nginx" exposed   

[root @ k8s-master ~] # kubectl run busybox-client --image = busybox --replicas = 1 -it --restart = Never ### starts a busybox pod, as a client
If you do not see a command prompt, pressing the Enter the try.
/ #

 

Guess you like

Origin www.cnblogs.com/shanhua-fu/p/10981283.html