16 Serverless, GraalVM, and Knative

 

This chapter covers

  • Producing native images with Spring Native and GraalVM
  • Building serverless applications with Spring Cloud Function
  • Deploying serverless applications with Knative and Kubernetes

In the previous chapter, you completed a long journey from development to production. You’ve built cloud native applications using Spring and deployed them on a Kubernetes cluster in a public cloud. This final chapter aims to provide you with some additional tools to get even more out of your cloud native applications.

One significant benefit of cloud infrastructures is that you can increase or reduce resources on demand and pay only for what you use. Java applications have traditionally been very resource-intensive, resulting in higher CPU and memory consumption than other stacks like Go. Not anymore. Using GraalVM and Spring Native, you can compile your Spring Boot applications to native executables, which are more performant and efficient than their JVM counterparts. The first part of this chapter will guide you through taking advantage of this new technology.

16.1 Native images with Spring Native and GraalVM

16.1.1 Understanding GraalVM and native images

16.1.2 Introducing GraalVM support for Spring Boot with Spring Native

16.1.3 Compiling Spring Boot applications as native images

16.2 Serverless applications with Spring Cloud Function

16.2.1 Building serverless applications with Spring Cloud Function

16.2.2 Deployment pipeline: Build and publish

16.2.3 Deploying serverless applications on the cloud

16.3 Deploying serverless applications with Knative

16.3.1 Setting up a local Knative platform

16.3.2 Deploying applications with the Knative CLI

16.3.3 Deploying applications with the Knative manifests

Summary