Kubernetes 之 headless
headless一旦创建了 headless ,在 k8s 里便是全局的root@spark-worker-dcpmm-statefulset-aep1-2:/# getent hostssparkthrift-headless10.60.218.26sparkthrift-headless.spark-project.svc.cluster.localroot@spark-w...
·
headless
一旦创建了 headless ,在 k8s 里便是全局的
root@spark-worker-dcpmm-statefulset-aep1-2:/# getent hosts sparkthrift-headless
10.60.218.26 sparkthrift-headless.spark-project.svc.cluster.local
root@spark-worker-dcpmm-statefulset-aep1-2:/#
root@spark-worker-dcpmm-statefulset-aep1-2:/#
root@spark-worker-dcpmm-statefulset-aep1-2:/# getent hosts worker-dcpmm-service
10.60.154.147 worker-dcpmm-service.spark-project.svc.cluster.local
10.60.171.234 worker-dcpmm-service.spark-project.svc.cluster.local
10.60.219.144 worker-dcpmm-service.spark-project.svc.cluster.local
10.60.219.147 worker-dcpmm-service.spark-project.svc.cluster.local
10.60.222.181 worker-dcpmm-service.spark-project.svc.cluster.local
10.60.222.182 worker-dcpmm-service.spark-project.svc.cluster.local
非 headless
看下普通service 的 情况
$ oc get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
nginx ClusterIP None <none> 80/TCP 73d
spark-master-dcpmm ClusterIP 10.60.27.191 <none> 7077/TCP,8080/TCP 1d
spark-master-dcpmm-nodeport NodePort 10.60.74.159 <none> 7077:32100/TCP 23h
worker-dcpmm-service ClusterIP None <none> 1888/TCP 20h
getent ,获取的是 CLUSTER-IP
bash-4.4# getent hosts spark-master-dcpmm
10.60.27.191 spark-master-dcpmm.spark-project.svc.cluster.local spark-master-dcpmm.spark-project.svc.cluster.local spark-master-dcpmm
bash-4.4#
bash-4.4# getent hosts spark-master-dcpmm-nodeport
10.60.74.159 spark-master-dcpmm-nodeport.spark-project.svc.cluster.local spark-master-dcpmm-nodeport.spark-project.svc.cluster.local spark-master-dcpmm-nodeport
更多推荐
已为社区贡献6条内容
所有评论(0)