Slide 1

Slide 1 text

BOOTIFUL WORKLOAD ORCHESTRATION WITH BOOTIFUL WORKLOAD ORCHESTRATION WITH HASHICORP NOMAD HASHICORP NOMAD Martin Ahrer 1

Slide 2

Slide 2 text

MARTIN AHRER MARTIN AHRER Co-founder and head of Freelance software architect / developer / clean-code coach Offering services in the Java and DevOps space    Enterprise Java User Group Austria [email protected] @kodepreacher https://www.martinahrer.at Martin Ahrer 2

Slide 3

Slide 3 text

CONTENT CONTENT Spring Boot deployment options Comparing Nomad and Kubernetes Nomad deployment descriptor Demo: Container workload (Spring Boot App) Demo: Native workload (Spring Boot App) Demo: Java workload (Spring Boot App) Martin Ahrer 3

Slide 4

Slide 4 text

SPRING BOOT DEPLOYMENT OPTIONS SPRING BOOT DEPLOYMENT OPTIONS Martin Ahrer 4 . 1

Slide 5

Slide 5 text

Java Archive Martin Ahrer 4 . 2

Slide 6

Slide 6 text

Container Martin Ahrer 4 . 3

Slide 7

Slide 7 text

Container Martin Ahrer 4 . 4

Slide 8

Slide 8 text

Java Archive Native Image Container Martin Ahrer 4 . 5

Slide 9

Slide 9 text

WHAT IS NOMAD? WHAT IS NOMAD? And how does it compare with Kubernetes? Martin Ahrer 5 . 1

Slide 10

Slide 10 text

WHAT IS NOMAD? WHAT IS NOMAD? — https://developer.hashicorp.com/nomad A simple and flexible scheduler and orchestrator to deploy and manage containers and non-containerized applications across on-prem and clouds at scale Martin Ahrer 5 . 2

Slide 11

Slide 11 text

WHAT IS NOMAD? WHAT IS NOMAD? Martin Ahrer 5 . 3

Slide 12

Slide 12 text

NOMAD VERSUS KUBERNETES NOMAD VERSUS KUBERNETES Components Martin Ahrer 5 . 4

Slide 13

Slide 13 text

NOMAD VERSUS KUBERNETES NOMAD VERSUS KUBERNETES Martin Ahrer 5 . 5

Slide 14

Slide 14 text

NOMAD REFERENCE ARCHITECTURE NOMAD REFERENCE ARCHITECTURE Martin Ahrer 5 . 6

Slide 15

Slide 15 text

DEPLOYING NOMAD AGENTS DEPLOYING NOMAD AGENTS # Run this as a OS service bootiful@server-0$ nomad agent -server -name "server-0" -config=server.hcl # Run this as a OS service bootiful@client-0$ nomad agent -client -name "client-0" -config=client.hcl # Run this on your local machine in development mode bootiful@dev$ nomad agent -dev -config=development.hcl Martin Ahrer 5 . 7

Slide 16

Slide 16 text

THE 2 MILLION CONTAINER CHALLENGE THE 2 MILLION CONTAINER CHALLENGE Martin Ahrer 5 . 8

Slide 17

Slide 17 text

THE 2 MILLION CONTAINER CHALLENGE THE 2 MILLION CONTAINER CHALLENGE Kubernetes supports clusters up to 5,000 nodes and 300,000 total containers. Martin Ahrer 5 . 8

Slide 18

Slide 18 text

THE 2 MILLION CONTAINER CHALLENGE THE 2 MILLION CONTAINER CHALLENGE Kubernetes supports clusters up to 5,000 nodes and 300,000 total containers. https://kubernetes.io/docs/setup/best- practices/cluster-large/ Martin Ahrer 5 . 8

Slide 19

Slide 19 text

THE 2 MILLION CONTAINER CHALLENGE THE 2 MILLION CONTAINER CHALLENGE Kubernetes supports clusters up to 5,000 nodes and 300,000 total containers. Nomad can scale to cluster sizes exceeding 10,000 nodes. https://kubernetes.io/docs/setup/best- practices/cluster-large/ Martin Ahrer 5 . 8

Slide 20

Slide 20 text

THE 2 MILLION CONTAINER CHALLENGE THE 2 MILLION CONTAINER CHALLENGE Kubernetes supports clusters up to 5,000 nodes and 300,000 total containers. Nomad can scale to cluster sizes exceeding 10,000 nodes. In 2020 HashiCorp Nomad scheduled 2,000,000 Docker containers on 6,100 hosts in 10 AWS regions in 22 minutes. https://kubernetes.io/docs/setup/best- practices/cluster-large/ Martin Ahrer 5 . 8

Slide 21

Slide 21 text

THE 2 MILLION CONTAINER CHALLENGE THE 2 MILLION CONTAINER CHALLENGE Kubernetes supports clusters up to 5,000 nodes and 300,000 total containers. Nomad can scale to cluster sizes exceeding 10,000 nodes. In 2020 HashiCorp Nomad scheduled 2,000,000 Docker containers on 6,100 hosts in 10 AWS regions in 22 minutes. https://kubernetes.io/docs/setup/best- practices/cluster-large/ https://www.hashicorp.com/c2m Martin Ahrer 5 . 8

Slide 22

Slide 22 text

WHY WOULD YOU WANT TO USE NOMAD? WHY WOULD YOU WANT TO USE NOMAD? Martin Ahrer 6 . 1

Slide 23

Slide 23 text

https://developer.hashicorp.com/nomad/docs/nomad-vs- kubernetes/supplement Martin Ahrer 6 . 2

Slide 24

Slide 24 text

DEMO DEMO Running Java, container, native workload side-by-side Martin Ahrer 7 . 1

Slide 25

Slide 25 text

DEMO: WORKLOAD DEMO: WORKLOAD namespace "traefik" namespace "bootiful-java" namespace "bootiful-native" namespace "bootiful-container" NOMAD CLIENT-0 NOMAD CLIENT-1 NOMAD CLIENT-2 Martin Ahrer 7 . 2

Slide 26

Slide 26 text

DEMO: CONTAINER WORKLOAD DEMO: CONTAINER WORKLOAD Spring Boot 3, JDK17, Spring Data REST, postgresql Executable Boot JAR packaged as Container Startup time ~ 12 sec https://github.com/MartinAhrer/continuousdelivery Martin Ahrer 7 . 3

Slide 27

Slide 27 text

DEMO: NATIVE WORKLOAD DEMO: NATIVE WORKLOAD Spring Boot 3, GraalVM 22.3.r17, Spring Data REST, postgresql Packaged as AOT compiled native Linux binary Startup time ~ 0.5 sec https://github.com/MartinAhrer/continuousdelivery Martin Ahrer 7 . 4

Slide 28

Slide 28 text

LEARN HOW TO BUILD NATIVE WORKLOAD LEARN HOW TO BUILD NATIVE WORKLOAD To learn about how to build Spring Boot native apps, join Alina Yurenko’s session in the Auditorium 12:00-12:50 Going Native: Fast and Lightweight Spring Boot Applications with GraalVM Martin Ahrer 7 . 5

Slide 29

Slide 29 text

DEMO: JAVA WORKLOAD DEMO: JAVA WORKLOAD Spring Boot 3, JDK 17 Spring Data REST, postgresql Packaged as Executable Boot JAR Startup time ~ 12 sec https://github.com/MartinAhrer/continuousdelivery Martin Ahrer 7 . 6

Slide 30

Slide 30 text

NOMAD DEPLOYMENT DESCRIPTOR NOMAD DEPLOYMENT DESCRIPTOR Let’s see some real code now! Martin Ahrer 7 . 7

Slide 31

Slide 31 text

RESOURCES RESOURCES https://speakerdeck.com/martinahrer https://github.com/martinahrer/continuousdelivery https://www.martinahrer.at Martin Ahrer 7 . 8

Slide 32

Slide 32 text

QUESTIONS QUESTIONS Martin Ahrer 8

Slide 33

Slide 33 text

THANK YOU THANK YOU Martin Ahrer 9  Martin Ahrer  

Slide 34

Slide 34 text

No content