无法确定集群上安装的 Kubernetes 服务的类型
Unable to determine the type of a Kubernetes service that was installed on a Cluster
我正在尝试为已安装在 IBM Cloud Private (ICP) 上的 MessageSight 服务设置 TLS
ICP 和 MessageSight 已经安装,我试图查看 MessageSight 是如何作为服务公开的(是 NodePort、LoadBalancer 还是外部名称)
$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,它没有对应的外部 IP。
服务的描述也让我清楚的知道这个服务是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>
如documentation所述:
In the Service spec, externalIPs can be specified along with any of the ServiceTypes
我正在尝试为已安装在 IBM Cloud Private (ICP) 上的 MessageSight 服务设置 TLS
ICP 和 MessageSight 已经安装,我试图查看 MessageSight 是如何作为服务公开的(是 NodePort、LoadBalancer 还是外部名称)
$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,它没有对应的外部 IP。
服务的描述也让我清楚的知道这个服务是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>
如documentation所述:
In the Service spec, externalIPs can be specified along with any of the ServiceTypes