I try to change http to https using DestinationRule. But my config is not working.
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: vs1
namespace: ns1
spec:
hosts:
- service.myhost.com
gateways:
- my-gateway
http:
- route:
- destination:
host: kubernetes-dashboard.kubernetes-dashboard.svc.cluster.local
port:
number: 443
---
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: kubernetes-dashboard
namespace: ns1
spec:
host: kubernetes-dashboard.kubernetes-dashboard.svc.cluster.local
trafficPolicy:
tls:
mode: SIMPLE
but when DestinationRule’s namespace changed to equal to kubernetes-dashboard’s namespace(kubernetes-dashboard) like below
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: kubernetes-dashboard
namespace: kubernetes-dashboard
spec:
host: kubernetes-dashboard.kubernetes-dashboard.svc.cluster.local
trafficPolicy:
tls:
mode: SIMPLE
It work well.
I tried to other different test. I found that it work well when DestinationRule’s namespace is different to VirtualService’s namespace (like istio-system
)
I expected that using DestinationRule’s host as FQDN is work regardless of any namespace of resource. Is there any misunderstanding about that?