Is there a way to have a feature switch on a kubernetes ingress?

9/14/2020

I must be able to disable a Kubernetes ingress at any point, and put it back on as easily. Is there a way to have a kind of "feature switch" to enable/disable an ingress at any moment, to stop forwarding traffic to the backend it's pointing to, and let us turn it on again?

-- David Gourde
kubernetes
kubernetes-ingress

1 Answer

9/14/2020

I believe that what you are trying to achieve can be solved with Istio (I'm not familiar with other Service Mesh, but I think you can do the same with them as well).

If you take a look at this example, they deploy an app which has 3 different product review pages, and then using Traffic Management - Routing Rules they specify how the traffic will be handled in this product review page.

In the doc they go through some cases like round robin, percentage and user. So you could use the percentage to be your switch.

Lets say that you have backend v1 and v2, you could use traffic management to direct 100% of your requests to v1, change it to v2, and then change to v1 again, as much as you like.

You could also do something like 85% - 15%, and test your new backend just with a small percentage of your requests, evaluate and make the decision to move on, or roll back afterwards.

-- Juliano Costa
Source: StackOverflow