
A while ago, we (Viktor Farcic and Darin Pope) thought it would be a good idea to add an out-of-the-box option to use canary deployments in Jenkins X. We should have finished it by now, and yet we did not even start working on it. Instead of just adding it to Jenkins X, we spent considerable time exploring the subject.
We quickly realized that it should be done through a service mesh. Given that Istio is the most commonly used one, we picked it to be the first (LinkerD and others might come later). That led us towards exploring Istio Gateway, VirtualServices, DestinationRules, and a few other resources. They provide the building blocks, but without automation required by continuous delivery processes. So, we expanded the scope to include Flagger. For it to work correctly and to make the right decisions, we need to feed it with formulas that would query metrics from somewhere. That led us to yet another choice that had to be made. It was an easy one. Prometheus is the obvious de-facto standard for storing and querying metrics in Kubernetes.
Further on, Flagger itself turned out not to be enough, so we had to write some custom code (a script) that would tie it all together in a form suitable for any CD tool (Jenkins X included).
Only after all that, we felt comfortable to start working on the implementation of canary deployments in Jenkins X. However, we thought all that work before adding the implementation would be wasted if we would not share it. So, we decided to postpone adding it to Jenkins X and, instead, to create a course on Udemy. It’s called Canary Deployments To Kubernetes Using Istio and Friends. Instead of focusing on a specific tool and explore it in detail (as Viktor did in his books), the course focuses on a process (canary deployments) and guides us through the decisions and the tools we might employ. The goal is not only to have fully automated canary deployments that can be plugged into any continuous delivery tool but to understand it in depth.
You might be inclined towards using canary deployments through a tool that will perform the whole process without you understanding what’s behind it. That would be magic. That would also be wrong. Even if it might be unrealistic for everyone in your company to spend time learning all the technology behind canary deployments, someone must know what’s under the hood. Otherwise, you’d be in for a surprise. Something will go wrong, and employing "magic" means that we don’t know what’s the cause and the effect. We would not be able to debug issues. Instead of resorting to magic, we (humanity as a whole) prefer science. We have an innate need to understand how something works before using it. Without understanding service mesh, Istio, Flagger, Prometheus, and quite a few other tools, canary deployments are bound to cause problems that are likely going to outweigh the benefits.
With all that in mind, we created a course that tries to demystify the process and the technology behind one possible implementation of the canary deployment process.
What are canary deployments? How do they differ from other deployment strategies? Why do we need service mesh for canary deployments? Why should we choose Istio as the service mesh implementation of choice? Why does Istio inject proxy containers inside Pods, and how does that injection work? How do we enable external and internal access to our applications? How do Istio VirtualServices and DestinationRules fit into the picture? Why are metrics the most critical piece of the puzzle, and where do we get them from? Which tool can we use to automate the process of canary deployments? How can we make the process agnostic so that it can be plugged into any continuous delivery tool?
Those are only a few questions we tried to answer in the Canary Deployments To Kubernetes Using Istio and Friends course. It is a practical hands-on tutorial on how to implement canary deployments, without going insane during the process.
Try it out and let us know how it went. First ten readers can use the free coupon valid until January 26, 2020.
Don’t forget to rate the course!