ServiceEntryAddressesRequired
当 ServiceEntry
的 protocol
字段未设置或设置为 TCP
时,且未定义 addresses
,就会出现此消息。
示例
您将收到此消息
Warning [IST0134] (ServiceEntry service-entry.default serviceentry.yaml:13) ServiceEntry addresses are required for this protocol.
当您的集群具有以下ServiceEntry
,其中protocol
未设置,且addresses
缺失时
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
且addresses
缺失的ServiceEntry
时
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
中定义的端口上的所有流量都将匹配,无论主机如何。