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 文章分类 运维
©著作权归作者所有:来自51CTO博客作者小小三郎1的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
使用 pipeline 风格发布项目到k8s
使用pipeline发布k8s项目
docker git ks8 pipeline jenkins -
k8s-13-label选择发布nginx
k8s-13-label选择发布nginx
k8s-13-label选择发布ngin -
K8S-K8S基础概念
k8s基础知识
k8s学习