I have the following:
apiVersion: networking.istio.io/v1alpha3 kind: Gateway metadata: name: vadal-gateway namespace: istio-system spec: selector: istio: ingressgateway # use istio default controller servers: - port: number: 80 name: http protocol: http hosts: - vadal.local --- apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: echo namespace: vadal spec: hosts: - vadal.local gateways: - vadal-gateway.istio-system.svc.cluster.local http: - match: - uri: prefix: /echo/ rewrite: uri: / route: - destination: host: vecho.vadal.svc.cluster.local port: number: 80 --- apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: users namespace: vadal spec: hosts: - vadal.local gateways: - vadal-gateway.istio-system.svc.cluster.local http: - match: - uri: prefix: /users/ rewrite: uri: / route: - destination: host: vusers.vadal.svc.cluster.local port: number: 80
When trying to set authorization no rules apart from empty {} work. They return 503. DR also set like so.
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: vusers-mtls
namespace: vadal
spec:
host: vusers
trafficPolicy:
tls:
mode: ISTIO_MUTUALapiVersion: “networking.istio.io/v1alpha3”
kind: “DestinationRule”
metadata:
name: “default”
namespace: “istio-system”
spec:
host: “*.local”
trafficPolicy:
tls:
mode: ISTIO_MUTUALapiVersion: security.istio.io/v1beta1
kind: AuthorizationPolicy
metadata:
name: vecho-get
namespace: vadal
spec:
selector:
matchLabels:
app: vecho
action: ALLOW
rules:
- {}apiVersion: security.istio.io/v1beta1
kind: AuthorizationPolicy
metadata:
name: vusers-get
namespace: vadal
spec:
selector:
matchLabels:
app: vusers
action: ALLOW
rules:
- to:
- operation:
methods: [“GET”]
curl -i vadal.local/echo/ is fine
curl -i vadal.local/users/ gives 503.