ServiceEntryAddressesRequired

消息名称ServiceEntryAddressesRequired
消息代码IST0134
描述Virtual IP addresses are required for ports serving TCP (or unset) protocol
等级Warning

当 ServiceEntry 的 protocol 字段未设置、设置为 TCP 或未定义 addresses 时,会出现此消息。

示例

您将收到以下消息:

  1. Warning [IST0134] (ServiceEntry service-entry.default serviceentry.yaml:13) ServiceEntry addresses are required for this protocol.

当集群的 ServiceEntry 未设置 protocol 且缺少 addresses 时:

  1. apiVersion: networking.istio.io/v1alpha3
  2. kind: ServiceEntry
  3. metadata:
  4. name: service-entry
  5. namespace: default
  6. spec:
  7. hosts:
  8. - 'istio.io'
  9. exportTo:
  10. - "."
  11. ports:
  12. - number: 443
  13. name: https
  14. location: MESH_EXTERNAL
  15. resolution: DNS

这种分析器的另一个例子是 ServiceEntry 设置了 protocol: TCP 但缺少 addresses 时:

  1. apiVersion: networking.istio.io/v1alpha3
  2. kind: ServiceEntry
  3. metadata:
  4. name: service-entry
  5. namespace: default
  6. spec:
  7. hosts:
  8. - 'istio.io'
  9. exportTo:
  10. - "."
  11. ports:
  12. - number: 443
  13. name: https
  14. protocol: TCP
  15. location: MESH_EXTERNAL
  16. resolution: DNS

解决方案

请确保在 protocol 未设置或设置为 TCP 时,在 ServiceEntry 中设置 addresses。 如果未设置 addresses,则将匹配 ServiceEntry 所定义的端口上的所有流量,与主机无关。