From the course: Automating Kubernetes with GitOps

Unlock this course with a free trial

Join today to access over 24,700 courses taught by industry experts.

Service-based canary deployments

Service-based canary deployments - Kubernetes Tutorial

From the course: Automating Kubernetes with GitOps

Service-based canary deployments

- In the previous lesson, we have seen ingress-based Canary deployments and ingress-based Canary deployments are based on annotations that are added to the metadata section of the ingress resource. As ingress works for HTTP and HTTPS applications only, you can't always use it and that's how service-based Canary deployments can be useful. They use a selector label. The label used as the service selector must be set on the old as well as the new versions of the application. And the service will address all pods that match the selector label. Use Replicas to determine how much traffic goes to which version of the application. And once complete, you can use kubectl scale to scale the old application down to zero replicas and a new application to the desired number of replicas. So let's check out how this is working. It's nice if we start with a clean configuration. So kubectl get svc, deploy, ing is showing all of this for i in $kubectl get svc,deploy,ing | awk '{ print $1 }'; do kubectl…

Contents