The example for the VirtualService doc shows this: (There is more the to example, that I removed for brevity.)
route: - destination: host: reviews # interpreted as reviews.foo.svc.cluster.local subset: v2 - route: - destination: host: reviews # interpreted as reviews.foo.svc.cluster.local subset: v1
Basically, the VirtualService, combined with the DestinationRule, can route traffic to v1 or v2 pods based on the URL prefix.
But I can’t figure out how to get v1 and v2 pods deployed at the same time!
I thought I could do it by creating a Kubernetes deployment that has
matchLabels selector use v1 for initial deployment, then update the deployment with
matchLabels set v2 (so that the v1 pods are not cleaned up).
But Kubernetes (via Helm) blocks this! It says
matchLabels is immutable. (Probably so I don’t orphan pods like I would be doing.)
But clearly different concurrent pods for a given service is a thing. Or it would not be in the example.
How do I get my Kubernetes deployment to not clean up the old pods when I move from v1 to v2?