Traffic Management

Q: How can I view the current route rules I have configured with Istio?

Rules can be viewed using istioctl get routerules -o yaml or kubectl get routerules -o yaml.

Q: Why is creating a weighted route rule to split traffic between two versions of a service not working as expected?

For the current Envoy sidecar implementation, up to 100 requests may be required for the desired distribution to be observed.

Q: How come some of my services are unreachable after creating route rules?

This is an known issue with the current Envoy sidecar implementation. After two seconds of creating the rule, services should become available.

Q: Can I use standard Ingress specification without any route rules?

Simple ingress specifications, with host, TLS, and exact path based matches will work out of the box without the need for route rules. However, note that the path used in the ingress resource should not have any . characters.

For example, the following ingress resource matches requests for the example.com host, with /helloworld as the URL.

cat <<EOF | kubectl create -f -
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: simple-ingress
annotations:
  kubernetes.io/ingress.class: istio
spec:
rules:
- host: example.com
  http:
    paths:
    - path: /helloworld
      backend:
        serviceName: myservice
        servicePort: grpc
EOF

However, the following rules will not work because it uses regular expressions in the path and uses ingress.kubernetes.io annotations:

cat <<EOF | kubectl create -f -
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: this-will-not-work
annotations:
  kubernetes.io/ingress.class: istio
  # Ingress annotations other than ingress class will not be honored
  ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- host: example.com
  http:
    paths:
    - path: /hello(.*?)world/
      backend:
        serviceName: myservice
        servicePort: grpc
EOF

Q: What is the naming convention for port name inside my application deployment file?

Named ports: Service ports must be named.

The port names must be of the form protocol-suffix with http, http2, grpc, mongo, or redis as the protocol in order to take advantage of Istio’s routing features.

For example, name: http2-foo or name: http are valid port names, but name: http2foo is not. If the port name does not begin with a recognized prefix or if the port is unnamed, traffic on the port will be treated as plain TCP traffic (unless the port explicitly uses Protocol: UDP to signify a UDP port).