Uncategorized

This Month in Spring – April 2021

Hi, Spring fans! Welcome to another installment of This Month in Spring! How've you been? I've been busy!

I've been working a lot on Kubernetes and Spring application development. Paul Czarkowski (@pczarkowski) captures the experience perfectly:

 

But I love Kubernetes. It's got abstractions for every kind of workload. You can build fantastic things on it. And for the 80% case, you can use primitives like Buildpacks, and integration pipelines, and platforms like Cloud Foundry that sit on top of Kubernetes, to smooth the path to production. It's awesome. One opportunity is that you can use the official Kubernetes Java client, which has a very nice Spring Boot autoconfiguration, to control the platform. Naturally, the good Dr. Dave Syer has already blazed that trail. I took his example. The good Doctor even got it working with GraalVM by hand crafting a reams of required .json reflection configuration. I took that inspiring work and built some Spring Native hints that you can use by adding it to the dependencies for the spring-aot Maven plugin, as demonstrated here. You can clone that example and then run mvn clean package spring-boot:build-image. Run that controller against Minkube or Docker Desktop, as demonstrated here. Deploy something, and you should see it pop up in the console. The result is a controller that starts up in milliseconds (~30ms on my machine) and takes substantially less RAM than a typical Java application, while retaining all the power of Spring. Pretty cool, no?

Obviously, this is just the beginning of the possibilities. Kubernetes and Spring a dynamic duo, and you can do some amazing things if you use Spring to expand on Kubernetes programmability. This is the core conceit of the upcoming SpringOne Tour installment, starting May 12th, 2021. It's free, of course, and it's going to be awesome! Join us for day one, where we'll explore some of the incredible opportunities that Spring and Kubernetes extend, and stick around for a chance to do a hands on workshop lead by Spring team members on day two. I'll be there, and I look forward to seeing you, too!

Anyway, we've got a ton to get to, so let's get right into it!