Judging by the name of this section, you might be wondering why we start with serverless deployments. We’re starting with serverless simply because that’s what we used in the previous chapter. So, we’ll start with what we have right now, at least for those who are running Jenkins X in GKE.

Another question you might be asking is why we cover serverless with Knative given that we already discussed it in the previous chapter. The answer to that question lies in completeness. Serverless deployments are one of the essential options we have when choosing the strategy, and this chapter would not be complete without it. If you did go through the previous chapter, consider this one a refresher with the potential to learn something new. If nothing else, you’ll get a better understanding of the flow of events with Knative and to see a few diagrams. In any case, the rest of the strategies will build on top of this one. On the other hand, you might be impatient and bored with repetition. If that’s the case, feel free to skip this section altogether.

⚠️ At the time of this writing (September 2019), serverless deployments with Knative work out-of-the-box only in GKE (issue 4668). That does not mean that Knative does not work in other Kubernetes flavors, but rather that the Jenkins X installation of Knative works only in GKE. I encourage you to set up Knative yourself and follow along in your Kubernetes flavor. If you cannot run Knative, I still suggest you stick around even if you cannot run the examples. I’ll do my best to be brief and make the examples clear even for those not running them.

Instead of discussing the pros and cons first, we’ll start each strategy with an example. We’ll observe the results and, comment on their advantages and disadvantages as well as the scenarios when they might be a good fit. In that spirit, let’s create a serverless deployment and see what we get.

Checking the ksvc.yaml file

Let’s go into the project directory and take a quick look at the definition that makes the application serverless.

Get hands-on with 1400+ tech skills courses.