Kubernetes - what does mean in port in a service?

前端 未结 1 648
孤独总比滥情好
孤独总比滥情好 2021-01-17 07:36

I have a service exposed of type=LoadBalancer and when I do a

kubectl describe services servicename,

I get this output :

Name         


        
相关标签:
1条回答
  • 2021-01-17 07:51

    Port unset means: You didn't specify a name in service creation.

    Service Yaml excerpt (note name: grpc):

    spec:
      ports:
      - port: 26257
        targetPort: 26257
        name: grpc
      type: NodePort
    

    kubectl describe services servicename output excerpt:

    Type:                   NodePort
    IP:                     10.101.87.248
    Port:                   grpc    26257/TCP
    NodePort:               grpc    31045/TCP
    Endpoints:              10.20.12.71:26257,10.20.12.73:26257,10.20.8.81:26257
    

    Port is definition of container ports that service will send the traffic on (Actual Endpoint).

    0 讨论(0)
提交回复
热议问题