$30 off During Our Annual Pro Sale. View Details »

Microservices with Istio, JHipster and Kubernetes

Microservices with Istio, JHipster and Kubernetes

My presentation for Geekle Java Summit

Istio service-mesh is one of the coolest kid on the block. Istio moves the responsibility of service discovery, load balancing, circuit breaking, monitoring, etc from the application to the platform(Kubernetes) thus letting the developers focus on the business code. But setting it up could be a daunting task for beginners and pros alike, this is where JHipster steps in and makes everything a cakewalk. As a bonus learn how Istio works in the process. JHipster is a widely-used OSS application development platform for creating web applications and microservices in minutes You will learn how to create a production-grade java microservice architecture with Spring Boot, Istio, Docker, Kubernetes & JHipster and deploy it to cloud under 30 minutes.

Deepu K Sasidharan

March 30, 2021

More Decks by Deepu K Sasidharan

Other Decks in Programming


  1. Microservices with Istio, JHipster and Kubernetes Deepu K Sasidharan @deepu105

    | deepu.tech
  2. https://deepu.tech @deepu105 About me Deepu K Sasidharan JHipster co-lead developer

    Developer Advocate @ Adyen OSS aficionado, author, speaker @deepu105 deepu.tech deepu105
  3. https://deepu.tech @deepu105 Cloud Native Microservices with Istio service mesh

  4. https://deepu.tech @deepu105 What does Istio do? • Service discovery  •

    Automatic load balancing  • Routing, circuit breaking, retries, fail-overs, fault injection • Policy enforcement for access control, rate limiting, A/B testing, traffic splits, and quotas • Automatic Metrics, logs, and traces  • Secure service-to-service communication
  5. https://deepu.tech @deepu105 Istio architecture

  6. https://deepu.tech @deepu105 Let’s build Blog post available at bit.ly/istio-k8s

  7. https://deepu.tech @deepu105 Prerequisite - Cluster Create GCP Project : $

    gcloud projects create jhipster-demo - Enable billing $ gcloud config set project jhipster-demo $ gcloud services enable container.googleapis.com Create GKE Cluster : $ gcloud container clusters create hello-hipster \ --num-nodes 4 \ --machine-type n1-standard-2 \ --cluster-version latest Set Credentials: $ gcloud container clusters get-credentials hello-hipster
  8. https://deepu.tech @deepu105 GKE Cluster

  9. https://deepu.tech @deepu105 Prerequisite - Istio Install Istio : $ cd

    ~/ $ export ISTIO_VERSION=1.8.2 $ curl -L https://istio.io/downloadIstio | sh - $ ln -sf istio-$ISTIO_VERSION istio $ export PATH=~/istio/bin:$PATH
  10. https://deepu.tech @deepu105 Prerequisite - Istio Install Istio in GKE cluster

    : $ istioctl install --set profile=demo -y Get Ingress Gateway IP: $ kubectl get svc istio-ingressgateway -n istio-system
  11. https://deepu.tech @deepu105 Prerequisite - Addons Install Istio Addons in GKE

    cluster : $ cd ~/istio $ kubectl apply -f samples/addons/grafana.yaml $ kubectl apply -f samples/addons/prometheus.yaml $ kubectl apply -f samples/addons/kiali.yaml $ kubectl apply -f samples/addons/extras/zipkin.yaml
  12. https://deepu.tech @deepu105 Istio pods

  13. https://deepu.tech @deepu105 Microservice with Istio on Kubernetes

  14. https://deepu.tech @deepu105 How can we bootstrap this quickly?

  15. https://deepu.tech @deepu105 JHipster in the wild Most popular Rapid Application

    Development platform for Java web applications and microservices ▪ 18k+ stars, 40k projects and 600+ contributors on GitHub ▪ 2M+ installations & 20k+ app generations per month ▪ 300k+ overall users ▪ 300+ companies using JHipster ▪ 140+ plugins
  16. https://deepu.tech @deepu105 What can you do with JHipster?

  17. https://deepu.tech @deepu105 • Fix your plumbing • Order Pizza for

    you • World peace!
  18. https://deepu.tech @deepu105 What can you actually do with JHipster? ▪

    Generate simple monolith web applications ▪ Generate complete microservice architectures ▪ Generate domain model (entities) ▪ Generate CI/CD pipelines ▪ Deploy to the cloud or containers ▪ And lot more
  19. https://deepu.tech @deepu105 Code quality & developer experience ▪ Developer experience

    oriented ▪ Production grade code quality (Look at our sonar scores) − ▪ Best practices on any combinations selected ▪ Fully working CRUD apps out of the box ▪ Production grade security ▪ You would only have to do business logic code and UX design
  20. https://deepu.tech @deepu105 JDL JHipster Domain Language JDL : http://bit.ly/istio-jdl Reference

    : https://www.jhipster.tech/jdl/ Studio : https://start.jhipster.tech/jdl-studio/ Samples : https://github.com/jhipster/jdl-samples $ jhipster download <raw url> Note we are using JHipster v7.0.0-beta.1 as there is a bug related to reactive gateways and istio in v7.0.0
  21. https://deepu.tech @deepu105 JDL Application

  22. https://deepu.tech @deepu105 JDL Entity & Relationship

  23. https://deepu.tech @deepu105 JDL Deployment for Kubernetes with Istio

  24. https://deepu.tech @deepu105 JHipster magic $ jhipster jdl jhipster-istio.jdl --fork

  25. https://deepu.tech @deepu105 Build & Push images $ ./gradlew bootJar -Pprod

    jib -Djib.to.image=deepu105/store $ ./gradlew bootJar -Pprod jib -Djib.to.image=deepu105/invoice $ ./gradlew bootJar -Pprod jib -Djib.to.image=deepu105/product $ ./gradlew bootJar -Pprod jib -Djib.to.image=deepu105/notification
  26. https://deepu.tech @deepu105 Deploy to GKE $ cd kubernetes $ ./kubectl-apply.sh

    -f $ watch kubectl get pods -n jhipster
  27. https://deepu.tech @deepu105 Gateway

  28. https://deepu.tech @deepu105 Telemetry

  29. https://deepu.tech @deepu105 Monitoring dashboards Tunnel into dashboards: $ istioctl dashboard

  30. https://deepu.tech @deepu105 Grafana dashboard

  31. https://deepu.tech @deepu105 Zipkin tracing

  32. https://deepu.tech @deepu105 Kiali

  33. https://deepu.tech @deepu105 Is it worth the hype? + Kubernetes Native

    microservices + Reduced responsibilities for dev(Service discovery, security, telemetry, etc) + No need to write/maintain any code for some of the complex parts of a microservice architecture. + A/B testing, canary releases, and lot more - New compared to other stable options - Slightly higher resource usage (CPU, Memory) - Higher running costs - Business logic related policies might be trickier
  34. https://deepu.tech @deepu105 What can Istio do? • Service discovery  •

    Automatic load balancing  • Routing, circuit breaking, retries, fail-overs, fault injection • Policy enforcement for access control, rate limiting, A/B testing, traffic splits, and quotas • Metrics, logs, and traces  • Secure service-to-service communication • And more...
  35. https://deepu.tech @deepu105 Thank you

  36. https://deepu.tech @deepu105 Main website https://jhipster.tech JHipster online https://start.jhipster.tech GitHub https://github.com/jhipster/generator-jhipster

    Twitter https://twitter.com/java_hipster Stack Overflow https://stackoverflow.com/questions/tagged/jhipster?sort=newest More information on JHipster