Kubernetes is great, as it is. But with Knative, a new, open source platform spearheaded by Google, Kubernetes can be even better.
If you haven’t yet taken a look at what Knative is or how it can save developers time and headaches, you could be missing out on some powerful features that help you get more out of Kubernetes (and containers in general) with less effort.
Keep reading for an overview of what Knative is and how it can help you double down on microservices and containers.
A (Very) Brief History of Knative
Eyal Manor, vice president, Engineering, at Google Cloud Platform, announced Knative in July 2018 as part of a broader initiative aimed at “bringing the best of serverless” to developers. (The announcement was also kind of framed as a way for Google to assert a leadership position in the world of serverless computing, so it was about market optics as much as technical innovation, but that’s a separate topic.)
Pivotal, IBM, Red Hat and SAP have also contributed to Knative.
Knative remains very much in development; currently, it’s only at version 0.2. But Google reported in December that community contributions to the project are rising rapidly, which appears to reflect just how much interest there is in building add-ons for Kubernetes.
To understand the point of Knative, you have to understand what Kubernetes does, and what it doesn’t do.
Kubernetes is a container orchestrator. It helps you manage containers. For that task, it’s a great tool.
However, there are two related things that Kubernetes doesn’t do in a native way: building containers and bridging the gap between containerized applications and serverless applications.
In the past, if you wanted to use Kubernetes as part of a CI/CD pipeline in which you built and deployed containers automatically from source code, you would typically have had to rely on proprietary release-management tools that integrated with Kubernetes. You also probably would have had to write custom code to manage container builds and expend manual effort troubleshooting things when builds went wrong.
Similarly, using Kubernetes in conjunction with serverless computing was difficult unless you used a cloud-based serverless platform that integrated with Kubernetes.
Knative is designed as a way for you to do both of these things without relying on a proprietary framework or a lot of custom tooling and management.
What Knative does
Knative works by providing several tools that integrate natively with Kubernetes, are fully open source and automate much of the work that you would previously have had to perform manually to build containers or deploy containerized code into a serverless environment within a Kubernetes-based pipeline.
Knative consists of three main components:
Build, which automates the process of pulling source code from a repository, building a container image based on it and then running that image within a Kubernetes cluster.
Serving, which uses Kubernetes and Istio to deploy containers into a serverless environment.
Eventing, a framework for defining events and triggering actions based on them within a cloud-native environment.
The Knative project also includes some subsidiary tools, along with documentation.
Given that Knative’s functionality falls into several distinct categories (container build automation, serverless deployment and event-driven computing), it makes the most sense to think of Knative not as a singular tool but instead as a collection of different tools that broadly extend what you can do within a Kubernetes-based pipeline.
Oh, and in case you’re wondering where you can use Knative, it’s designed to run both in the cloud or on-premises. And no, you don’t have to use Google Cloud; it will work with any modern cloud environment.
Should You Use Knative?
Now, on to the big question: Should you use Knative?
The answer depends first on how much you use Kubernetes and second, on how much you currently struggle to perform the tasks that Knative helps to automate within a Kubernetes-based pipeline.
Astute developers likely will point out that Knative doesn’t really do anything radically new; you could implement all of its functionality yourself if you want to use custom code and processes—and some DevOps shops undoubtedly already have Kubernetes pipelines in place that give them basically the same results as Knative.
That said, Knative can save you a great deal of time by eliminating the need to build and maintain your own Kubernetes extensions. It can also make developers’ lives better, because building custom extensions for Kubernetes is the type of task that is tedious and inglorious. It’s a safe bet that most developers would enjoy outsourcing that work to an open source project so they can focus on doing things that are more fun.
In short, if you rely on Kubernetes, there is a good chance that Knative can benefit you, even if you are currently implementing its functionality in other ways. You may want to wait for Knative to mature a bit more before deploying it for production purposes, but now’s a good time to start exploring how it can improve your delivery pipeline while also making your developers feel better about life.