<p>If I have two deployments running within the same namespace, and one service exposing deployment A, how can I make Deploymet B use the same service to only expose the 20 % of the PODS running on that deployment? How can I make the Service to Load Balance the deployment in such way that the Deploy A that have 5 replicas running already all exposed through that service, and make deployment B to use the service only for the 20% of the PODS running on it</p>

user9356263
<p>For canary deployments, you will have two deployments and one service (as you have already).</p>
<p>Let say, Your first deployment is 'stable' and the other one is 'canary'. <strong>Both have the same match labels</strong> matching with service, so that service can load-balance to both deployments.
Based on your example the 'stable' deployment has 5 replicas, in that case, you should deploy your 'canary' deployment with 1 replica (20 % of total replicas needed) and deploy it. I think that's what you are looking for.</p>
<p><a href="https://i.stack.imgur.com/L75kz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L75kz.png" alt="enter image description here" /></a></p>
