Unleashing Agility: Exploring Serverless with Knative

Xavier Baude
ADEO Tech Blog
Published in
3 min readMar 14, 2024

Serverless is becoming the next cloud compute default service. Offering developers a faster, more efficient way to build and deploy their applications. Choosing the right platform can be daunting: should I use a cloud solution or build one? This article unveils the magic of Knative, a powerful open-source framework that simplifies serverless development with its Serving and Eventing capabilities. We chose this technology at ADEO for simple reasons : cloud agnosticisme, most mature framework and open-source.

Knative Serving: Kiss Scaling Goodbye

Serverless help developers deploying code without worrying about servers, scaling, or infrastructure. Knative Serving makes this possible. It manages serverless workloads within Kubernetes, handling the complexities of running your application code while you focus on the core logic.

Here’s what makes Knative Serving:

  • Simplicity: Define your services using Kubernetes Custom Resource Definitions (CRDs).
  • Automatic Scaling: Applications scale down to zero during idle periods and up “instantly” when triggered, saving costs and resources.
  • Progressive Rollouts: Deploy new code versions seamlessly without downtime, ensuring a smooth user experience. Thanks to Knative revision management.
  • Flexibility: Use container images based on any programming language, giving you ultimate freedom. And of course it can be the image you are already using in K8s.
  • KPA: For Knative pod autoscaler, it allows you to change replicas number regarding either the request per second or concurrent connection (link).

Knative Eventing: Playing to the Data Flow

Event-driven architectures offer exciting potential, but building them from scratch can be boring. Knative Eventing manages the complexity for you:

  • Connect services & applications: Trigger jobs based on events without worrying about direct communication between components.
  • Simplified development: Focus on event handling logic, leaving the routing and delivery to Knative.
  • Standardized format: Leverage CloudEvents, a vendor-neutral format, for interoperability and future-proof applications. Many other sources can be natively managed.
  • Decoupled architecture: Build resilient and scalable systems with loosely coupled components, each reacting to events.

The Duo: Serving & Eventing Together

By combining Knative Serving and Eventing, you unlock a whole new level of agility and innovation:

  • React to any change: Deploy serverless microservices triggered by events, creating highly responsive and dynamic applications.
  • Build event-driven workflows: Connect various applications and services seamlessly, eliminating the need for complex integrations.
  • Reduce complexity: Simplify architecture with decoupled components that communicate through events.

Embrace the Future with Knative

Whether you’re a developer or just starting with serverless, Knative offers a complete experience. Its Serving and Eventing capabilities combined with its open-source nature and Kubernetes integration make it an ideal choice for building modern, scalable, and agile applications. So, dive into the world of serverless with Knative and experience the joy of development unleashed!

Limitation

There are some known limitations with this technology (here Serving). Because your application scale to 0 you must take into account startup time of your pod when it wakes up. So avoid large image, and language that requires a lot of start time (java). We discourage also synchronous process, prefer asynchronous. To do so, you client must handle this kind of operations (HTTP code 201, 202, etc). Then, take into account that there is a scale to 0 meaning that your pod will be scaled down even if there is a process! You should take care of tuning.

We are not ready yet for Knative eventing in production. The product seems to us less mature than serving. The integration with third-parties seems to move too fast (triggermesh post about possible EOL, Knative-GCP EOL). I think it is too early for production usage.

Do not hesitate to ask for more information, details, configuration. If you are interested I’ll created another post on this topic!

Additional Resources:

--

--

Xavier Baude
ADEO Tech Blog

Tech Lead at ADEO. I've loved Kubernetes since it was minion 😻.