PortNameIsNotUnderNamingConvention
| 消息名称 | PortNameIsNotUnderNamingConvention |
| 消息代码 | IST0118 |
| 描述 | Port name is not under naming convention. Protocol detection is applied to the port. |
| 等级 | Info |
当端口不遵循 Istio 服务端口命名约定或端口未命名时,会出现此消息。
示例
您将收到这条消息:
Info [IST0118] (Service httpbin.default) Port name foo-http (port: 80, targetPort: 80) doesn't follow the naming convention of Istio port.
当您的集群有以下 service 时:
apiVersion: v1kind: Servicemetadata:name: httpbinlabels:app: httpbinspec:ports:- name: foo-httpport: 8000targetPort: 80selector:app: httpbin
在这个示例中,端口 foo-http 并未遵循这个语法:name: <protocol>[-<suffix>]。
如何修复
- 如果您知道 service 端口的协议,将端口重命名为
<protocol>[-<suffix>]格式就行; - 如果您不知道 service 端口的协议,您需要从 Prometheus 查询指标
- 查询
istio_requests_total{reporter="destination",destination_service_name="SERVICE_NAME",response_code="200"}[TIME_RANGE]。如果您使用 Mixer v2 版本, 也可以查询istio_requests_total{reporter="destination",destination_service_name="SERVICE_NAME",response_code="200",destination_port="TARGET_PORT"}[TIME_RANGE]。 - 如果有输出,您可以从记录中找到
request_protocol。例如,如果request_protocol是http,则将端口重命名为http-foo; - 如果没有输出,您可以将端口保持原样。
- 查询