5

I cant seem to find/understand how to change the default error landing pages for the Istio loadbalancer in kubernetes.

For example the 503 "No healthy upstream" page.

Is it possible to change these in Istio? If so how would I go about doing it?

Thanks in advance!

Staffan.S
  • 51
  • 1
  • 4

2 Answers2

2

2020 Update

Envoy has now added this functionality. Here's an example config to use your own error string for a HTTP 503 response:

mappers:
- filter:
    status_code_filter:
      comparison:
        op: EQ
        value:
          default_value: 503
          runtime_key: key_b
  status_code: 503
  body:
    inline_string: "Custom 503 page content can go here"

For more details on how this can be customized, check out the docs at - https://github.com/envoyproxy/envoy/blob/master/docs/root/configuration/http/http_conn_man/local_reply.rst

Sodman
  • 659
  • 5
  • 21
1

For a "native" way on Istio to do what you want you will have to wait. Envoy team added custom error responses as a 1.9.0 release milestone. Hopefully, they will include it on the release and we will get it by the end of the year. So we will be able to use it on Istio. https://github.com/envoyproxy/envoy/issues/1178

About custom approaches, you could use you can put a nginx (In the same pod) serving those custom error pages in front of any user facing app. You won't be able to change some errors like 503 or 404 given by Envoy proxy itself though.

(not working yet, see below) Another approach if you need to customize errors given by Envoy as well, would be using nginx-ingress-controller, which can serve the custom error pages, together with Istio. If you want to try, have a look at this issue and the one they reference on the first comment, it can be helpful. https://github.com/kubernetes/ingress-nginx/issues/2126

Update 21st Nov 2018

For this approach to work, you're going to have to wait as well. (probably more than with envoy) I tested it myself and I was facing an issue that nginx has to solve in order to get this working. When you define a default backend, nginx get the endpoints (ip:port) from the kubernetes service directly and then tries to access to those IPs on the cluster. Instead of accessing through the name and letting Istio route that connection, that it is how is meant to work.

Have a look at this https://github.com/kubernetes/ingress-nginx/issues/2318

zale
  • 33
  • 8