root@myang-node:~/ingress-nginx# kubectl create deploy backend-api --image=registry.cbeijing.aliyuncs.com/dotbalo/nginx:backend-api -n study-ingress deployment.apps/backend-api created root@myang-node:~/ingress-nginx# kubectl expose deploy backend-api --port 80 -n study-ingress service/backend-api exposed root@myang-node:~/ingress-nginx# kubectl get svc -n study-ingress NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE backend-api ClusterIP 10.102.145.167 <none> 80/TCP 14s nginx ClusterIP 10.106.69.175 <none> 80/TCP 4h15m
建一个与deploy同名的clusterip类型的service
标签:kubectl,ingress,service,nginx,api,k8s,backend From: https://www.cnblogs.com/xiangyu5945/p/17376034.html