ddobrin / modern-spring-on-kubernetes

Modern Spring Based Microservices on Kubernetes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

modern-spring-on-kubernetes

Modern Spring Based Microservices on Kubernetes

Example applications show to use Spring Boot on Kubernetes. There are multiple types of sample applications in this repo. Samples showing various approaches for containerizing Spring applications in the containerize folder. Samples showing features for running Spring applications on Kubernetes in run folder. Samples showing features for AOT in the aot folder. Each sample application has a README.md that explains how to run the sample and points out interesting things to look at.

Software Prerequisites

Java development tooling

Containerization tools

Kubernetes Cluster

You will need a Kubernetes cluster to test the sample apps. The apps have with a docker desktop based Kubernetes. Other local desktop Kubernetes solutions such as minikube or kind will work but there might be slight differences in exposing network ports. Whatever choice of k8s you bring to the workshop we assume you are comfortable driving that k8s distribution. If you are new to Kubernetes and want the paved documented path install docker desktop and use the k8s that is built into it.

Pick your favourite laptop based k8s solution

Kubernetes tooling

  • Kubernetes sample tested with Docker Desktop K8s. If you have a different k8s install you must know how to expose the app in k8s to your machine machine if you don't just use docker desktop k8s to run these demos.
  • kubectl
  • k9s text gui for k8s
  • carvel super useful set of clis for working kubernetes and containers

Save the workshop wifi network

There is a lot of stuff that will be downloaded during the workshop, the hotel wifi network will likely be too so. You can save yourself a lot of time by doing the following steps at home:

  1. install the all the required software above, you don't want to be downloading and installing all the above softawre during the workshop, it will take too long and you will fall behind.
  2. Checkout the code of this repo
  3. run ./mvnw clean package from the root of the repo to download all maven dependencies
  4. Open the root of the repo in your IDE, the repo is a multi-module maven project so all the samples will be imported.
  5. cd into containerize/buildpack and run the command ./mvnw spring-boot:build-image -Dspring-boot.build-image.imageName=boot-buildpack:1 this will download a bunch of required base images that are quite big almost a 1GB in size.
  6. from the repo root run the command docker compose -f observability/tracing/docker-compose-all.yaml pull to pull the required images for the observability demos

Outline

Since 2014 Spring has been the leading framework for building microservices in the Java ecosystem. A lot has changed over the past 8 years in both the Spring ecosystem and wider cloud ecosystem. Kubernetes has matured and become widely available on public and private clouds, giving us an industry standard foundation for managing microservices. GraphQL and gRPC offer new possibilities for exposing API endpoints. Service Meshes, Serverless functions give us many more options for implementing and architecting microservices.

Unfortunately the internet is full of old blog posts and stackoverflow answers recommending out of date approaches to building microservices in Spring. This hands-on workshop is an up-to-date look at how to build microservice based applications using the latest generation of Spring projects running on Kubernetes.

The workshop consists of a series of sample applications which implement modern microservice architecture patterns in Spring using various approaches so you can select the approach that works best for your situation.

Technologies covered in the workshop

  • Declarative clients (New feature in Spring 6)
  • GraphQL (New feature in Spring 6)
  • Spring Authorization Server (Customizable OIDC server)
  • Spring Cloud Gateway
  • Spring Cloud Sleuth
  • Spring Cloud Function
  • Observability with Micrometre 2 and Spring Framework 6
  • How to effectively containerize Spring Boot apps
  • How to effectively run Spring Boot apps on Kubernetes
  • Understand Ahead-of-Time(AOT) and Native Images in Spring Boot 3.0

Architectural topics that we will discuss

  • Service discovery
  • Traffic routing
  • API Gateways vs. Service Mesh
  • Workload identity vs. User Identity
  • Securing microservices
  • Kubernetes native service discovery vs. Netflix Eureka
  • Kubernetes native configuration vs. Spring Cloud Config
  • GraphQL vs. REST
  • Serverless Functions vs. Long Running Processes

Come learn how to use new capabilities introduced in Spring Framework 6, Spring Boot 3, and Spring Cloud 2022, running on Kubernetes, to design and implement modern microservices.

These projects are due to GA in the Nov / Dec 2022 timeframe, so we will be using the latest milestones or release candidates available.

About

Modern Spring Based Microservices on Kubernetes


Languages

Language:Java 85.3%Language:HTML 8.1%Language:Dockerfile 3.3%Language:Shell 3.3%