Skip to content
This repository has been archived by the owner on Feb 26, 2023. It is now read-only.

ThomasVitale/spring-boot-kubernetes-j4k-2021

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cloud Native with Spring Boot and Kubernetes (J4K 2021)

Source code of the examples shown at the conference.

Demonstration of:

  • Cloud native development with Spring Boot and Reactive Spring
  • Containerization with Cloud Native Buildpacks
  • Kubernetes deployment manifests, graceful shutdown, and health probes
  • Spring Boot configuration through ConfigMaps
  • Native executables with Spring Native and GraalVM
  • Serverless applications on Knative

Prerequisites

To run all the examples, you need to install the following tools:

Recommended tools:

Usage

Both Spring Boot applications can be run locally with this command:

$ ./gradlew bootRun

You can containerize them via Buildpacks. Demo Service will be containerized as a JVM image, whereas Demo Native will be containerized as a Native image.

$ ./gradlew bootBuildImage

Deployment on a local Kubernetes cluster

You can spin up a Kubernetes cluster as follows:

$ ./kind/create-cluster.sh

Then, deploy Demo Service with kubectl:

$ kubectl apply demo-service/k8s

When you're done, you can destroy the cluster as follows:

$ ./kind/destroy-cluster.sh

Deployment on a local Kubernetes cluster with Knative

You can spin up a Kubernetes cluster with Knative as follows:

$ ./kind/install-knative.sh

Then, deploy Demo Native with kubectl:

$ kubectl apply demo-service/knative

When you're done, you can uninstall the cluster as follows:

$ ./kind/uninstall-knative.sh

Other

If you're looking for an open-source Kubernetes-based platform, you might want to try [https://tanzucommunityedition.io](VMware Tanzu Community Edition), which is the one I used for the presentation.