ServiceEntryAddressesRequired

ServiceEntryprotocol 欄位未設定,或設定為 TCP,且未定義 addresses 時,會發生此訊息。

範例

您將收到此訊息

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

當您的叢集有以下未設定 protocol 且缺少 addressesServiceEntry

apiVersion: networking.istio.io/v1
kind: ServiceEntry
metadata:
  name: service-entry
  namespace: default
spec:
  hosts:
    - 'istio.io'
  exportTo:
    - "."
  ports:
    - number: 443
      name: https
  location: MESH_EXTERNAL
  resolution: DNS

此分析器的另一個範例是當您具有 protocol: TCP 且缺少 addressesServiceEntry

apiVersion: networking.istio.io/v1
kind: ServiceEntry
metadata:
  name: service-entry
  namespace: default
spec:
  hosts:
    - 'istio.io'
  exportTo:
    - "."
  ports:
    - number: 443
      name: https
      protocol: TCP
  location: MESH_EXTERNAL
  resolution: DNS

如何解決

protocol 未設定或設定為 TCP 時,請務必在您的 ServiceEntry 中設定 addresses。如果未設定 addresses,則無論主機為何,都會比對 ServiceEntry 中定義的埠上的所有流量。