Path setting for the istio ingress controller


How can I configure the istio ingress controller? The answer is Regular expression.  Not mentioned on the document.

However, it is.

If you have a nginx container with these files with directories.

/index.html
/login.html
/logout.html
/auth/login.html
/auth/logout.html
/web/index.html


If you have a nginx container with these files with directories.

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: webservice-ingress
  annotations:
    kubernetes.io/ingress.class: istio
spec:
  rules:
  - http:
      paths:
      - path: /web/.*
        backend:
          serviceName: web-service
          servicePort: 80
      - path: /auth/.*
        backend:
          serviceName: web-service
          servicePort: 80



You can see the test code for the ingress.

It says

 {"/api/v1/", false},
 {"/api/v1/.*", true},
 {"/api/.*/resource", true},
 {"/api/v[1-9]/resource", true},
 {"/api/.*/.*", true},

Enjoy istio.


Comments (0)

Skip to main content