DestinationRule is not applied on ServiceEntry

12/2/2020

When I specify host in ServiceEntry and DestinationRule as httpbin, DestinationRule doesn't work. But it works, if I added suffix, i.e. httpbin.se.

Example:

apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
  name: httpbin
  namespace: default
spec:
  hosts:
    - httpbin # don't work
#    - httpbin.se # work
  ports:
    - number: 443
      name: http-443
      protocol: HTTP
    - number: 80
      name: http-80
      protocol: HTTP
  location: MESH_EXTERNAL
  resolution: STATIC
  addresses:
    - "34.235.36.14"
  endpoints:
    - address: "34.235.36.14"
      ports:
        http-443: 443
        http-80: 80
---
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: httpbin
  namespace: default
spec:
  host: httpbin # don't work.
# host: httpbin.se # work
  trafficPolicy:
    portLevelSettings:
      - port:
          number: 443
        tls:
          mode: SIMPLE

Maybe I missed some documentation, can't be sure.

-- Belenot
istio
kubernetes

0 Answers