1

I can set weight or filter by headers on a virtual service. So, I access using a ingress/gateway and I have success using weight and header filters. But I would like to set this conditions on a service level, to access inside the cluster. I am using ISTIO.

Anyone know anything about that?

theduck
  • 2,589
  • 13
  • 17
  • 23
Danilo
  • 123
  • 7
  • The [Traffic Shifting](https://istio.io/docs/tasks/traffic-management/traffic-shifting/) page in the Istio documentation describes weight-based routing on a VirtualService. At least browsing the "Tasks" section in the documentation is pretty informative about what sorts of things it's straightforward to do with Istio. – David Maze Oct 11 '19 at 00:30
  • Did you try the solution described in [Istio](https://istio.io/docs/tasks/traffic-management/traffic-shifting/) and provided by [David Maze](https://stackoverflow.com/questions/58330500/is-there-a-way-to-set-canary-or-weighted-deployments-on-kubernetes-service-level#)? – Mark Oct 14 '19 at 08:47
  • Did you see that the example uses as ingress to access the application? I would like to have canary deployments or weighted deployments without use ingress. I would like to have these features inside the cluster without external access, like a service requesting info for another service. – Danilo Oct 14 '19 at 11:42

1 Answers1

0

No, there is no way to do that. You can check kubernetes' services documentation to assure it documentation. In summary, kubernetes uses IP tables to do the load balancing and a forced statistical round robin policy (check this link).

However it is not that hard to actually solve it in kubernetes using other technologies. Using a proxy in between with a weighted upstream would solve the problem inmediately. Something like this:



upstream dynamic {
    server pod-proxy-1      weight=2;
    server pod-proxy-2      weight=4;
}

server {
    location / {
        proxy_pass http://dynamic;
    }
}

Rodrigo Loza
  • 1,200
  • 7
  • 14