Slide 1

Slide 1 text

Ray Tsang and Matt Raible Choose Your Own Adventure with JHipster & K8s @saturnism | @mraible

Slide 2

Slide 2 text

Are you a Java developer?

Slide 3

Slide 3 text

Are you a Web developer?

Slide 4

Slide 4 text

Do you like web frameworks?

Slide 5

Slide 5 text

Hello, JHipster! https://jhipster.tech Application Generator Development Platform Popular Open Source Project Monoliths, Microservices, and Gateways

Slide 6

Slide 6 text

Who is Ray Tsang? Developer Advocate at Google Cloud Kubernetes Enthusiast JHipster Committer Backpacker, snowboarder, photographer @saturnism on Twitter

Slide 7

Slide 7 text

Who is Matt Raible? Developer Advocate at Okta Web Framework Enthusiast JHipster Committer Skier, rafter, classic VW fan @mraible on Twitter

Slide 8

Slide 8 text

JHipster Gives You Lots of Options Spring Boot Spring Security SQL or NoSQL Maven or Gradle Bootstrap Angular, React, or Vue End-to-End Tests Performance Tests 26,000+ options https://arxiv.org/abs/1710.07980

Slide 9

Slide 9 text

Choose Your Own Adventure

Slide 10

Slide 10 text

Spring Boot

Slide 11

Slide 11 text

Google Trends for Spring Boot

Slide 12

Slide 12 text

The Rest of the Java Pack

Slide 13

Slide 13 text

Docker

Slide 14

Slide 14 text

Kubernetes

Slide 15

Slide 15 text

Monolith vs. Microservice Architecture Monolith Microservices Pro Single app to manage Single CI/CD pipeline Low latency between calls Low coupling Faster build / deploy cycle per service Easier to scale out individual services Con Slow build / deploy cycle High coupling Harder to scale out Multiple apps to manage Multiple CI/CD pipeline Multiple EVERYTHING! High latency and issues between calls Proper service boundary

Slide 16

Slide 16 text

Monolith Legacy forever! At least only one pile of...

Slide 17

Slide 17 text

Microservices So you like the difficult stuff?

Slide 18

Slide 18 text

Unpopular Opinion "Monoliths are the future because the problem people are trying to solve with microservices doesn’t really line up with reality." https://changelog.com/posts/monoliths-are-the-future

Slide 19

Slide 19 text

Maven or Gradle?

Slide 20

Slide 20 text

Java, Kotlin, .NET, or Node? jhipster/jhipster-kotlin jhipster/jhipster-dotnetcore jhipster/generator-jhipster-nodejs

Slide 21

Slide 21 text

The End

Slide 22

Slide 22 text

FYI... Micronaut & Quarkus Support is in development https://github.com/jhipster/generator-jhipster-micronaut npm install -g generator-jhipster-micronaut mhipster https://github.com/jhipster/jhipster-quarkus npm install -g generator-jhipster-quarkus jhipster -d --blueprint quarkus

Slide 23

Slide 23 text

Which Authentication Type?

Slide 24

Slide 24 text

Authentication: Session, JWT, or OAuth 2.0? Because friends don't let friends write authentication!

Slide 25

Slide 25 text

MySQL, PostgreSQL, or MongoDB?

Slide 26

Slide 26 text

Spring MVC or Spring WebFlux?

Slide 27

Slide 27 text

CRUD with WebFlux? https://github.com/jhipster/generator-jhipster/issues/7608

Slide 28

Slide 28 text

What do you want to build? Monoliths 21 Points Health Blog Bug Tracker Microservices Online Store Blog + Store https://github.com/jhipster/jdl-samples

Slide 29

Slide 29 text

Angular, React, or Vue.js?

Slide 30

Slide 30 text

Comparing Angular, React, and Vue.js

Slide 31

Slide 31 text

Google Trends for Angular, React, and Vue.js

Slide 32

Slide 32 text

PWA or Mobile?

Slide 33

Slide 33 text

The End

Slide 34

Slide 34 text

Yes to PWA! if ('serviceWorker' in navigator) { window.addEventListener('load', function() { navigator.serviceWorker.register('/service-worker.js') .then(function () { console.log('Service Worker Registered'); }); }); } src/main/webapp/index.html

Slide 35

Slide 35 text

PWA Requires HTTPS @EnableWebSecurity public class SecurityConfiguration extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http.requiresChannel() .requestMatchers(r -> r.getHeader("X-Forwarded-Proto") != null) .requiresSecure(); } } SecurityConfiguration.java https://developer.okta.com/blog/2018/07/30/10-ways-to-secure-spring-boot

Slide 36

Slide 36 text

Want Ionic? Use Ionic4J!

Slide 37

Slide 37 text

Want React Native? Use Ignite JHipster!

Slide 38

Slide 38 text

Let's Get Started! start.jhipster.tech

Slide 39

Slide 39 text

High Code Quality and Performance by Default https://github.com/mraible/healthy-hipster

Slide 40

Slide 40 text

Where to deploy to?

Slide 41

Slide 41 text

Kubernetes Created by Google in 2014 Based on learnings from Google's internal orchestration tool Manages deployment of containers across a cluster of machines Currently managed by Cloud Native Foundation Single deployment target, multiple cloud/on-prem environments

Slide 42

Slide 42 text

Kubernetes You've chosen the path to become a YAML developer... Everything will be YAML from here on! Don't fear. JHipster will generate all the YAMLs for you!

Slide 43

Slide 43 text

With Istio or Without? • Kubernetes manages deployment of applications • Istio manages the services to service communication • Retries • Traces • Monitoring • L7 Routing • L7 Load Balancing (internal and external) • mTLS • Out of the box Observability with Jaeger, Kiali, Prometheus, Grafana

Slide 44

Slide 44 text

Kubernetes to the Cloud! Run Kubernetes sub-generator Deploy to GKE on GCP Have a look at K9s Who let the pods out?!? https://github.com/derailed/k9s

Slide 45

Slide 45 text

Additional Configuration for OAuth 2.0 JHipster uses Keycloak by default Configuration is not auto-generated for Kubernetes Remember to configure Issuer, Client ID, and Client Secret

Slide 46

Slide 46 text

Load Balancer, NodePort, or Ingress... JHipster Gateway has 2 functionalities • The frontend code • Routing ("/service/blog/api" → Blog Service) • Has Retries • But 1 extra hop Kubernetes has built-in URL mapping via Ingress • No retries

Slide 47

Slide 47 text

The End You survived today's encounter with YAML, and the paradox of choice. Take the JHipster adventure, and good luck! Congratulations!

Slide 48

Slide 48 text

Coming Soon: JHipster 7! https://github.com/jhipster/generator-jhipster/issues/10958

Slide 49

Slide 49 text

Questions? 49 Keep in Touch! @mraible / [email protected] @saturnism / [email protected] Presentation speakerdeck.com/mraible Code github.com/mraible