无法确定在集群上安装的Kubernetes服务的类型

时间:2019-06-06 02:59:00

标签: kubernetes ibm-cloud kubernetes-helm ibm-cloud-private messagesight

我正在尝试为IBM Cloud Private(ICP)上已安装的MessageSight服务设置TLS

已经安装了ICP和MessageSight,我试图查看MessageSight如何作为服务公开(是NodePort,LoadBalancer还是Externalname)

$kubectl get services 
NAME                              TYPE        CLUSTER-IP     EXTERNAL-IP     PORT(S)                       AGE
messagesight-messagesight-svc     ClusterIP   10.0.241.72    168.xx.xx.xxx   9089/TCP,1883/TCP,16102/TCP   9d
messagesight-messagesightui-svc   ClusterIP   10.0.139.199   168.xx.xx.xxx   9087/TCP                      9d

该类型指出它是一个ClusterIP,但是它具有一个外部IP。我一直认为,如果服务类型为ClusterIP,则外部IP将会为空。如果是LoadBalancer,我希望看到外部IP。

描述服务不提供任何其他信息

kubectl describe svc messagesight-messagesight-svc 
Name:              messagesight-messagesight-svc
Labels:            app=messagesight
                   chart=messagesight
                   heritage=Tiller
                   release=messagesight
Annotations:       <none>
Selector:          app=messagesight,release=messagesight
Type:              ClusterIP
IP:                10.0.241.72
External IPs:      168.xx.xx.xxx
Port:              adminport  9089/TCP
TargetPort:        9089/TCP
Endpoints:         10.1.66.1:9089
Port:              messaging-1883  1883/TCP
TargetPort:        1883/TCP
Endpoints:         10.1.66.1:1883
Port:              messaging-16102  16102/TCP
TargetPort:        16102/TCP
Endpoints:         10.1.66.1:16102
Session Affinity:  None
Events:            <none>

我能够通过外部IP和端口访问该服务,并且对它的工作方式感到困惑。

我安装了Jenkins设置进行观察,输出看起来不错,对我来说很有意义

$kubectl get services 
NAME                       TYPE       CLUSTER-IP     EXTERNAL-IP   PORT(S)                          AGE
jenkins-ibm-jenki   NodePort   10.0.241.156   <none>        8080:31058/TCP,50000:31155/TCP   1d

我可以看到类型是NodePort,它没有对应的externalIP。

对该服务的描述还使我清楚地了解到该服务属于NodePort类型

$kubectl describe svc jenkins-ibm-jenki 
Name:                     jenkins-ibm-jenki
Labels:                   app=jenkins-ibm-jenki
                          chart=ibm-jenkins-dev-1.0.2
                          component=jenkins-jenkins-master
                          heritage=Tiller
                          release=jenkins
Annotations:              helm.sh/created=1559696400
Selector:                 app=jenkins-ibm-jenki,component=jenkins-jenkins-master
Type:                     NodePort
IP:                       10.0.241.156
Port:                     http  8080/TCP
TargetPort:               8080/TCP
NodePort:                 http  31058/TCP
Endpoints:                10.1.66.89:8080
Port:                     slavelistener  50000/TCP
TargetPort:               50000/TCP
NodePort:                 slavelistener  31155/TCP
Endpoints:                10.1.66.89:50000
Session Affinity:         None
External Traffic Policy:  Cluster
Events:                   <none>

1 个答案:

答案 0 :(得分:3)

documentation中所述:

<div id="wrapper1" class="col s5 input-field"> <input type="date" id="start1" class="datepicker-start" /> <label for="start1">Start Date</label> </div> <div id="wrapper2" class="col s5 input-field"> <input type="date" id="end1" class="datepicker-end" /> <label for="end1">End Date</label> </div>