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

Brazil Quarkus Club - From 0 to Production-Grade with Kubernetes Native Quarkus

Brazil Quarkus Club - From 0 to Production-Grade with Kubernetes Native Quarkus

I hear you thinking, “is this yet another session about doing cloud native development?”. Well.. yes, sort of, but we promise it’s going to be a good one - or so we think :). In this session we’re going to talk (and demo!) about what it means to be a good Cloud Citizen - which is more than merely putting an application in a container and deploying it. To optimize your Java application's performance and resilience in the cloud, it is essential to consider factors such as providing real-time health status through fine-grained metrics. You’ll also need to ensure fast startup, and avoid excessive resource consumption within the cluster. Being a good Cloud Citizen also involves streamlining configuration, deployment and upgrade processes. By integrating these tasks seamlessly, the application can facilitate smooth deployments and upgrades, which will lead to more efficiency and ease of management. Join us in this session and embark on a journey to develop a perfect(ish) Cloud Native Java App

Recording: https://www.youtube.com/live/5fk2QNkFAnE?si=pOul0M4qhBIZ0S6I

Kevin Dubois

March 28, 2024
Tweet

More Decks by Kevin Dubois

Other Decks in Programming

Transcript

  1. @kevindubois From 0 to Production with Kubernetes Native Quarkus Kevin

    Dubois Principal Developer Advocate, Red Hat @kevindubois
  2. @kevindubois Kevin Dubois 🤘 Principal Developer Advocate at Red Hat

    🤘 Java Champion 🤘 Based in Belgium 󰎐 🤘 Speak English, Dutch, French, Italian 🤘 Open Source Contributor (Quarkus, Camel, Knative, ..) 🤘 Open Source Community Member (Belgian JUG, Belgian CNCF chapter) @[email protected] youtube.com/@thekevindubois github.com/kdubois
  3. @kevindubois “Traditional” • Throughput at the expense of footprint •

    Long running at expense of startup speed • Rich, dynamic behaviour for mutable systems Kube Native • Throughput solved by scaling • Ephemeral, immutable systems • Footprint and startup speed matter
  4. @kevindubois Quarkus + Native (via GraalVM) 12 MB Quarkus +

    JVM (via OpenJDK) 73 MB Traditional Cloud-Native Stack 136 MB Quarkus + Native (via GraalVM) 0.016 Seconds Quarkus + JVM (via OpenJDK) 0.943 Seconds Traditional Cloud-Native Stack 4.3 Seconds Supersonic. Subatomic. Java
  5. @kevindubois Build Time Runtime Packaging (maven, etc) Load config file

    from file system Parse it Classpath scanning to find annotated classes Attempt to load class to enable/disable features Build its model of the world. Start the management (thread, pool…) @ @ </> How Does “Traditional Java” Start?
  6. @kevindubois After 2.6s (Kafka, DB, Caching) App is ready to

    receive traffic Container Running Sends traffic App not ready Ready??
  7. @kevindubois containers: - name: nginx-container image: nginx:latest ports: - containerPort:

    80 volumes: - name: secret-volume secret: secretName: your-secret-name Kubernetes Secrets
  8. @kevindubois resources: requests: memory: "300Mi" cpu: "250m" # 1/4 core

    limits: memory: "400Mi" cpu: "1000m" # 1 core Resource Limits
  9. @kevindubois https://learn.microsoft.com/en-us/azure/developer/java/containers/overview resources: requests: memory: "4000Mi" cpu: "2000m" limits: memory:

    "4000Mi" cpu: "2000m" - env: - name: JDK_JAVA_OPTIONS value: "-XX:+UseParallelGC -XX:MaxRAMPercentage=75" Sensible Initial VAlues ( JVM )
  10. @kevindubois spec: affinity: podAffinity: requiredDuringSchedulingIgnoredDuringExecution: - labelSelector: matchExpressions: - key:

    "app" operator: In values: - my-app topologyKey: "kubernetes.io/hostname" containers: Pod Affinity = lower latency
  11. @kevindubois Push to give energy windmill Kafka Topic 2.Sends the

    interaction Dashboard: Green Energy Nickname Team Push/Tap to generate energy Cars that need energy Two teams competing (top 5 players) First team wins @kevindubois @alexsotob
  12. @kevindubois Architecture 3: Generate power (REST) Game Dashboard 1: Assign

    player Name & Team (REST) 6: Update dashboard (SSE) 2: Increment player cluster counter 4: Send power event 5: Receive power events
  13. @kevindubois Treat everything as code Git Commands Infrastructure as Code

    Operations through Git workflows Git Repository Git is the single source of truth @kevindubois @alexsotob What is GitOps?
  14. @kevindubois Pull Request Source Git Repository Image Registry Config Git

    Repository Kubernetes Deploy Monitor Detect drift CD Take action GitOps Application Delivery Model
  15. @kevindubois Start exploring in the OpenShift Sandbox. Learn containers, Kubernetes,

    and OpenShift in your browser. developers.redhat.com/developer-sandbox Try Red Hat's products and technologies without setup or configuration.