This Month in Spring - April 2021

April 29, 2021 Josh Long

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!

About the Author

Josh Long (@starbuxman) is a Spring Developer Advocate at VMware. Josh is a Java Champion, a Google Developer Expert for Kotlin, author of six books (including O'Reilly's "Cloud Native Java: Designing Resilient Systems with Spring Boot, Spring Cloud, and Cloud Foundry") and the just released "Reactive Spring" (ReactiveSpring.io), six best-selling Livelessons video trainings (including "Building Microservices with Spring Boot Livelessons" with Phil Webb and "Spring Security Livelessons" with Rob Winch, and "Cloud Foundry Livelessons" with Josh McKenty), and an open-source contributor (Spring Boot, Spring Integration, Spring Cloud, Activiti and Vaadin). Josh also has a podcast, "A Bootiful Podcast," and does a series of screencasts, "Spring Tips", on YouTube (bit.ly/spring-tips-playlist). Josh routinely blogs on the Spring blog (spring.io/blog)

Follow on Twitter Visit Website More Content by Josh Long
Previous
This Month in Spring - May 2021
This Month in Spring - May 2021

Next
This Month in Spring - March 2021
This Month in Spring - March 2021