18 Deploying Spring

 

This chapter covers

  • Building Spring applications as either WAR or
    JAR files
  • Building Spring applications as container images
  • Deploying Spring applications in Kubernetes

Think of your favorite action movie. Now imagine going to see that movie in the theater and being taken on a thrilling audiovisual ride with high-speed chases, explosions, and battles, only to have it come to a sudden halt before the good guys take down the bad guys. Instead of seeing the movie’s conflict resolved, when the theater lights come on, everyone is ushered out the door. Although the lead-up was exciting, it’s the climax of the movie that’s important. Without it, it’s action for action’s sake.

Now imagine developing applications and putting a lot of effort and creativity into solving the business problem, but then never deploying the application for others to use and enjoy. Sure, most applications we write don’t involve car chases or explosions (at least I hope not), but there’s a certain rush you get along the way. Not every line of code you write is destined for production, but it’d be a big letdown if none of it ever was deployed.

Up to this point, we’ve focused on using the features of Spring Boot that help us develop an application. There have been some exciting steps along the way, but it’s all for nothing if you don’t cross the finish line and deploy the application.

18.1 Weighing deployment options

18.2 Building executable JAR files

18.3 Building container images

18.3.1 Deploying to Kubernetes

18.3.2 Enabling graceful shutdown

18.3.3 Working with application liveness and readiness

18.4 Building and deploying WAR files

18.5 The end is where we begin

Summary