Canary rollout between two k8s/gke namespaces by DNS cutover?

12/11/2020

I have two similar services/deployments/ingress running in two GKE/K8S namespaces: ns-A (old), ns-B (new). The ingress of ns-A is like myservice.mycompany.com. All clients are using myservice.mycompany.com to access old services in ns-A.

Now, I need to rollout the traffic from ns-A to ns-B. I need all clients to access the new service in ns-B. I can create a new Ingress for new service in ns-B: myservice-B.mycompany.com and update all service to use this new endpoint.

but I have many clients. it is possible to use other ways to do canaries rollout from ns-A to ns-B. I looked into contour, but contour cannot support two namespaces rollout.

is it possible to use DNS cutover or cluster-internal DNS names to canary rollout? Could you please give more details? Thanks

-- BAE
canary-deployment
dns
google-kubernetes-engine
kube-dns
kubernetes

1 Answer

12/13/2020

You could implement canary on ingress level, rather than DNS one. Say, fresh versions of ingress-nginx support canary deployments out of box.
https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#canary.

Great example here.
https://medium.com/@domi.stoehr/canary-deployments-on-kubernetes-without-service-mesh-425b7e4cc862

Note, that ingress-nginx canary implementation requires your services to be in different namespaces.

-- Olesya Bolobova
Source: StackOverflow