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

Boston JUG - From 0 to Production-Grade with Ku...

Avatar for Kevin Dubois Kevin Dubois
May 19, 2025
33

Boston JUG - From 0 to Production-Grade with Kubernetes-Native Java

Avatar for Kevin Dubois

Kevin Dubois

May 19, 2025
Tweet

Transcript

  1. Kubernetes: From 0 to Production-Grade with Java Kevin Dubois Senior

    Principal Developer Advocate Red Hat @kevindubois.com
  2. Kevin Dubois ★ Sr. Principal Developer Advocate at Red Hat

    ★ Java Champion ★ From Belgium 󰎐 ★ Professional Software Engineer for ~20 years ★ Working with Java and Cloud Native for ~10 years ★ 🗣 Speak English, Dutch, French, Italian youtube.com/@thekevindubois linkedin.com/in/kevindubois github.com/kdubois @kevindubois.com
  3. “Traditional” Java • Throughput at the expense of footprint •

    Long running at expense of startup speed • Rich, dynamic behaviour for mutable systems “Kube Native” Java • Throughput solved by scaling • Footprint and startup speed matter • Ephemeral, immutable systems
  4. 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. 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
  6. apiVersion: v1 kind: Service metadata: name: kubenative spec: ports: -

    name: http port: 80 protocol: TCP targetPort: 8080 selector: app.kubernetes.io/name : kubenative apiVersion: apps/v1 kind: Deployment metadata: name: kubenative spec: replicas: 1 selector: matchLabels: app.kubernetes.io/name : kubenative template: spec: containers: - image: quay.io/kevindubois/demo name: kubenative ports: - containerPort: 8080 name: http protocol: TCP
  7. After 2.6s (Kafka, DB, Caching) App is ready to receive

    traffic Container Running Sends traffic App not ready Ready??
  8. readinessProbe: failureThreshold: 3 httpGet: path: /q/health/ready port: 8080 scheme: HTTP

    initialDelaySeconds: 5 livenessProbe: failureThreshold: 3 httpGet: path: /q/health/live port: 8080 scheme: HTTP initialDelaySeconds: 5 Ready!
  9. containers: - name: nginx-container image: nginx:latest ports: - containerPort: 80

    volumes: - name: secret-volume secret: secretName: your-secret-name Kubernetes Secrets & ConfigMaps
  10. resources: requests: memory: "300Mi" cpu: "250m" # 1/4 core limits:

    memory: "400Mi" cpu: "1000m" # 1 core Resource Limits
  11. 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 )
  12. Push to give energy windmill Kafka Topic 2.Sends the interaction

    Dashboard: Green Energy Nickname Team SHAKE! to generate energy Cars that need energy Two teams competing (top 5 players) First team wins @kevindubois @alexsotob
  13. 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. Pull Request Source Git Repository Image Registry Config Git Repository

    Kubernetes Deploy Monitor Detect drift CD Take action GitOps Application Delivery Model
  15. 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.