Slide 1

Slide 1 text

Thomas Vitale @vitalethomas thomasvitale.com Cloud Native With Spring Boot and Kubernetes Systematic - 10/02/2021 systematic.com

Slide 2

Slide 2 text

Thomas Vitale • Senior Software Engineer at Systematic, Denmark. • Spring, Cloud Native, DevOps, Application Security. • Author of “Cloud Native Spring in Action - With Spring Boot and Kubernetes” (Manning). About Me

Slide 3

Slide 3 text

Why Cloud Native? @SystematicGroup @vitalethomas

Slide 4

Slide 4 text

The Three P’s of Cloud Native Applications Place Private Cloud Public Cloud Hybrid Cloud Properties Scalability Loose Coupling Resilience Manageability Observability Security Practices Automation Continuous Delivery DevOps @SystematicGroup @vitalethomas

Slide 5

Slide 5 text

The Goals Speed Faster and fl exible delivery Cost Ef fi ciency and cost optimisation Scale Elasticity and dynamic scaling Resilience Availability and stability @SystematicGroup @vitalethomas

Slide 6

Slide 6 text

1. Application Server @SystematicGroup @vitalethomas

Slide 7

Slide 7 text

2 Embedded server 3 Imperative vs. Reactive @SystematicGroup @vitalethomas 1 “Make JAR, not WAR” (Josh Long)

Slide 8

Slide 8 text

@SystematicGroup @vitalethomas Embedded Server + JAR Packaging Embedded Server Blocking + Servlet API (Tomcat, Undertow, Jetty) Spring Web Embedded Server Non-Blocking + Project Reactor (Netty) Spring WebFlux Serverless Functions (AWS, Azure, GCP, Knative) Spring Cloud Functions

Slide 9

Slide 9 text

Demo Embedded Server + JAR Packaging https://github.com/ThomasVitale/cloud-native-spring-webinar-feb-2021 @SystematicGroup @vitalethomas

Slide 10

Slide 10 text

2. Containerization @SystematicGroup @vitalethomas

Slide 11

Slide 11 text

1 Don’t use fat JARs 2 Optimize build/runtime performance 3 Don’t run as root or include secrets @SystematicGroup @vitalethomas

Slide 12

Slide 12 text

Containerize Spring Boot Applications @SystematicGroup @vitalethomas Docker fi les Cloud Native Buildpacks Jib

Slide 13

Slide 13 text

Demo Containerizing Spring Boot https://github.com/ThomasVitale/cloud-native-spring-webinar-feb-2021 @SystematicGroup @vitalethomas

Slide 14

Slide 14 text

3. Kubernetes Deployment @SystematicGroup @vitalethomas

Slide 15

Slide 15 text

1 Define a Namespace manifest 2 Define a Deployment manifest 3 Define a Service manifest @SystematicGroup @vitalethomas

Slide 16

Slide 16 text

Demo Kubernetes Deployment https://github.com/ThomasVitale/cloud-native-spring-webinar-feb-2021 @SystematicGroup @vitalethomas

Slide 17

Slide 17 text

4. Application Lifecycle @SystematicGroup @vitalethomas

Slide 18

Slide 18 text

1 2 3 Fast start-up, graceful shutdown Liveness and readiness probes Stateless and horizontally scalable @SystematicGroup @vitalethomas

Slide 19

Slide 19 text

Liveness and Readiness Probes Application ALIVE? READY? NO NO Restart might help Restart won’t help @SystematicGroup @vitalethomas

Slide 20

Slide 20 text

Demo Application Lifecycle https://github.com/ThomasVitale/cloud-native-spring-webinar-feb-2021 @SystematicGroup @vitalethomas

Slide 21

Slide 21 text

5. Configuration @SystematicGroup @vitalethomas

Slide 22

Slide 22 text

Code, Configuration, Credentials Code Con fi guration Deploy Credentials @SystematicGroup @vitalethomas

Slide 23

Slide 23 text

Configuration Strategies Spring Boot Properties Property fi les Command line arguments Environment variables Con fi guration Services Spring Cloud Con fi g Server Spring Cloud Consul Con fi g Spring Cloud Vault Spring Cloud Zookeeper Con fi g Cloud Platform Services Spring Cloud Alibaba Spring Cloud AWS Spring Cloud Azure Spring Cloud GCP Kubernetes Platform Con fi gMaps Secrets Environment Variables @SystematicGroup @vitalethomas

Slide 24

Slide 24 text

Demo Con fi guration https://github.com/ThomasVitale/cloud-native-spring-webinar-feb-2021 @SystematicGroup @vitalethomas

Slide 25

Slide 25 text

Bonus: GitOps @SystematicGroup @vitalethomas

Slide 26

Slide 26 text

GitOps - Cloud Native Operations https://www.weave.works/technologies/gitops/

Slide 27

Slide 27 text

Demo GitOps https://github.com/ThomasVitale/cloud-native-spring-webinar-feb-2021 @SystematicGroup @vitalethomas

Slide 28

Slide 28 text

GitOps - Configuration helm upgrade -i flux fluxcd/flux \ --set git.user=$GITHUB_USER \ --set [email protected] \ --set [email protected]:$GITHUB_USER/cloud-native-spring- webinar-feb-2021 \ --set git.path="deployment" \ --set git.branch="main" \ --namespace flux @SystematicGroup @vitalethomas

Slide 29

Slide 29 text

What’s next? @SystematicGroup @vitalethomas

Slide 30

Slide 30 text

II. Dependency management I. One codebase, one application III. Con fi guration, credentials, and code V. Design, build, release, run IV. Backing services VI. Stateless processes VIII. Concurrency VII. Port binding IX. Disposability XI. Logs X. Environment parity XII. Administrative processes XIV. Telemetry XIII. API fi rst XV. Authentication and authorization Beyond 12-Factors

Slide 31

Slide 31 text

More Spring and Kubernetes Resilience Resilience4J Spring Cloud Circuit Breaker Distributed systems Spring Cloud Gateway Spring Cloud Stream Spring Security OAuth Reactive Spring WebFlux R2DBC Project Reactor Kubernetes Spring Boot Spring Cloud Kubernetes Skaffold @SystematicGroup @vitalethomas

Slide 32

Slide 32 text

With Spring Boot and Kubernetes • 35% discount code, valid for all products in all format • mtpsystematic21 • mng.bz/8N5D Cloud Native Spring in Action www.thomasvitale.com @vitalethomas

Slide 33

Slide 33 text

Thomas Vitale @vitalethomas thomasvitale.com Cloud Native With Spring Boot and Kubernetes Systematic - 10/02/2021 systematic.com