Is there a way to set canary or weighted deployments on kubernetes service level without using ingress/gateway? Is there a way to set canary or weighted deployments on kubernetes service level without using ingress/gateway? kubernetes kubernetes

Is there a way to set canary or weighted deployments on kubernetes service level without using ingress/gateway?


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;    }}