k8s service
程序员文章站
2022-03-12 11:50:31
...
kubectl create service clusterip wfq-svc-cp --tcp=80:8080
kubectl create service nodeport wfq-svc-np --tcp=1234:80
kubectl create service clusterip wfq-svc-headless --clusterip="None"
[email protected]:~# kubectl create service clusterip wfq-svc-cp --tcp=80:8080
service "wfq-svc-cp" created
[email protected]:~#
[email protected]:~#
[email protected]:~# kubectl create service nodeport wfq-svc-np --tcp=1234:80
service "wfq-svc-np" created
[email protected]:~#
[email protected]:~#
[email protected]:~# kubectl create service clusterip wfq-svc-headless --clusterip="None"
service "wfq-svc-headless" created
[email protected]:~#
[email protected]:~#
[email protected]:~# kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.68.0.1 <none> 443/TCP 226d
kubernetes-bootcamp NodePort 10.68.70.33 <none> 80:34824/TCP 226d
my-nginx ClusterIP 10.68.4.181 <none> 8090/TCP 22h
my-srv-cp ClusterIP 10.68.45.143 <none> 80/TCP 23h
my-svc-headless ClusterIP None <none> <none> 23h
my-svc-np NodePort 10.68.210.209 <none> 1234:24209/TCP 23h
nginx-service NodePort 10.68.121.152 <none> 8080:20000/TCP 226d
wfq-svc-cp ClusterIP 10.68.56.155 <none> 80/TCP 1m
wfq-svc-headless ClusterIP None <none> <none> 11s
wfq-svc-np NodePort 10.68.108.6 <none> 1234:21388/TCP 40s
[email protected]:~#
[email protected]:~#
[email protected]:~# kubectl describe service wfq-svc-cp
Name: wfq-svc-cp
Namespace: default
Labels: app=wfq-svc-cp
Annotations: <none>
Selector: app=wfq-svc-cp
Type: ClusterIP
IP: 10.68.56.155
Port: 80-8080 80/TCP
TargetPort: 8080/TCP
Endpoints: <none>
Session Affinity: None
Events: <none>
[email protected]:~#
[email protected]:~# kubectl describe service wfq-svc-np
Name: wfq-svc-np
Namespace: default
Labels: app=wfq-svc-np
Annotations: <none>
Selector: app=wfq-svc-np
Type: NodePort
IP: 10.68.108.6
Port: 1234-80 1234/TCP
TargetPort: 80/TCP
NodePort: 1234-80 21388/TCP
Endpoints: <none>
Session Affinity: None
External Traffic Policy: Cluster
Events: <none>
[email protected]:~#
[email protected]:~# kubectl describe service wfq-svc-headless
Name: wfq-svc-headless
Namespace: default
Labels: app=wfq-svc-headless
Annotations: <none>
Selector: app=wfq-svc-headless
Type: ClusterIP
IP: None
Session Affinity: None
Events: <none>
上一篇: 手把手教你在小程序中实现内容搜索功能
下一篇: 读懂Python的异常机制
推荐阅读
-
Windows中通过命令行启动打开Service 管理工具
-
ASP.NET通过Remoting service上传文件
-
Android中Service实时向Activity传递数据实例分析
-
service pack3下载怎么安装(service pack3安装教程)
-
Android中Service的全面总结
-
service pack3下载怎么安装(service pack3安装教程)
-
Android应用程序四大组件之使用AIDL如何实现跨进程调用Service
-
安装程序在正在设置 reporting service 和 share point 排除路径期间遇到错误的解决方
-
Activity与Service之间交互并播放歌曲的实现代码
-
Android实现Service获取当前位置(GPS+基站)的方法