Name: abcxyz5
Namespace: diyclientapps
Labels: <none>
Annotations: kubectl.kubernetes.io/last-applied-configuration={"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"name":"abcxyz5","namespace":"diyclientapps"},"spec":{"ports":[{"port":8080,"protocol"...
Selector: app=abcxyz5
Type: NodePort
IP: 10.97.214.209
Port: <unset> 8080/TCP
NodePort: <unset> 30097/TCP
Endpoints: <none>
Session Affinity: None
Events: <none>
这是我的服务定义:
apiVersion: v1
kind: Service
spec:
selector:
app: abcxyz5
ports:
- port: 8080
targetPort: 8123
protocol: TCP
type: NodePort
metadata:
name: abcxyz5
为什么不使用8123的targetPort值?尽管如此,我无法访问此服务:
telnet 192.168.99.100 30097
Trying 192.168.99.100...
telnet: Unable to connect to remote host: Connection refused
我引用了退回的IP:minikube ip
:192.168.99.100
。
答案 0 :(得分:0)
选择器与任何端点都不匹配。
我修改了它,现在describe service命令显示了这个: Ñ
ame: abcxyz7
Namespace: diyclientapps
Labels: <none>
Annotations: <none>
Selector: appId=abcxyz7
Type: NodePort
IP: 10.99.201.118
Port: http 8080/TCP
NodePort: http 30385/TCP
Endpoints: 172.17.0.11:8080
Session Affinity: None
Events: <none>