Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Cloud Native with Spring Boot and Kubernetes

Thomas Vitale
February 10, 2021
190

Cloud Native with Spring Boot and Kubernetes

Principles and patterns for building cloud native application using Spring Boot, containerizing them with Cloud Native Buildpacks, and deploying them on a Kubernetes cluster through a GitOps workflow.

Thomas Vitale

February 10, 2021
Tweet

Transcript

  1. Thomas Vitale @vitalethomas thomasvitale.com Cloud Native With Spring Boot and

    Kubernetes Systematic - 10/02/2021 systematic.com
  2. 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
  3. 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
  4. 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
  5. @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
  6. 1 Don’t use fat JARs 2 Optimize build/runtime performance 3

    Don’t run as root or include secrets @SystematicGroup @vitalethomas
  7. 1 Define a Namespace manifest 2 Define a Deployment manifest

    3 Define a Service manifest @SystematicGroup @vitalethomas
  8. 1 2 3 Fast start-up, graceful shutdown Liveness and readiness

    probes Stateless and horizontally scalable @SystematicGroup @vitalethomas
  9. Liveness and Readiness Probes Application ALIVE? READY? NO NO Restart

    might help Restart won’t help @SystematicGroup @vitalethomas
  10. 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
  11. 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
  12. 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
  13. 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
  14. 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
  15. Thomas Vitale @vitalethomas thomasvitale.com Cloud Native With Spring Boot and

    Kubernetes Systematic - 10/02/2021 systematic.com