Slide 1

Slide 1 text

NOMAD Mans Matulewicz

Slide 2

Slide 2 text

Infra Engineer @ Ordina @ ING Twitter: @Mans_M Github: @MansM mans@mansm.io

Slide 3

Slide 3 text

What is Nomad? § Distributed § Optimistically concurrent § Scheduler

Slide 4

Slide 4 text

Nomad setup

Slide 5

Slide 5 text

What is a scheduler? In short: A scheduler maps sets of work to a set of resources

Slide 6

Slide 6 text

Schedulers around us

Slide 7

Slide 7 text

Why do you want a scheduler? § Higher resource utilization − Bin packing − Over-subscription − Job queueing

Slide 8

Slide 8 text

Scheduling § You decide what to run § Nomad decides where and how to run − But you can force Nomad’s hands by using constraints (examples coming up)

Slide 9

Slide 9 text

Workloads Nomad can schedule § Docker containers § Rkt containers § Java § Isolated exec (chroot) § Raw exec § Qemu VM’s

Slide 10

Slide 10 text

Job types § Service § Batch § System

Slide 11

Slide 11 text

Evaluation enqueue

Slide 12

Slide 12 text

Evaluation dequeue

Slide 13

Slide 13 text

Plan generation

Slide 14

Slide 14 text

Plan execution

Slide 15

Slide 15 text

Nomad scheduling

Slide 16

Slide 16 text

Jobs § nomad run jobfile.nomad job “name” { group “name” { task “name” { driver resources } } }

Slide 17

Slide 17 text

Jobs Note: for a single task, you don’t need to create a taskgroup, as the group is created implicitly.

Slide 18

Slide 18 text

Jobs - Constraints § Force Nomad’s hand on a scheduling location § Can be on job, taskgroup and/or task level § Hostname, kernel.version, os.name, os.version, platform.aws.ami-id, platform.aws.instance-type, arch, driver.docker.version, etc

Slide 19

Slide 19 text

Jobs - Service Discovery • Consul needs to be installed on client machines • No need for in-container Consul agents • Nomad will register and deregister nodes/services

Slide 20

Slide 20 text

Service Discovery § Container provides a service § Container runs service on unknown port § Consul-template queries Consul server for values and reloads nginx with new config file

Slide 21

Slide 21 text

Jobs - Restart container

Slide 22

Slide 22 text

Jobs - Restarts § Sorry Bryan § Note: batch jobs have slightly different defaults!

Slide 23

Slide 23 text

Jobs - Scaling

Slide 24

Slide 24 text

Jobs - Updates

Slide 25

Slide 25 text

Jobs - Periodic

Slide 26

Slide 26 text

Local development § Make sure docker env vars are set if you want docker driver active § Fingerprinter of Mac instead of Docker host

Slide 27

Slide 27 text

Resources (Docker) § CPU − Based on shares − Will only kick in when Nomad client machine is under load § Memory − Based on total virtual memory, no swapping − Hard limit, app can crash or terminate when using more than specified! § Diskspace − Amount of GB’s that is required (including logs) § IO (Network planned for later releases)

Slide 28

Slide 28 text

How to install Nomad § Install Nomad servers § Connect the Nomad servers to each other § Install the Nomad clients and connect them to the servers § Run the workloads!

Slide 29

Slide 29 text

Unofficial roadmap § 0.4 − Persistent volumes − Multiple network cards − Enhancements to logging (Source: 0.3.0 release notes (current)) − ACL’s (Source: GitHub issue #589) § 0.5 − Vault (Source: Jim Benson ( Hashicorp solution eng @ Hashicorp meetup AMS March) § Hashicorp has not released an official roadmap

Slide 30

Slide 30 text

What I don’t like about Nomad § No UI

Slide 31

Slide 31 text

Demo setup

Slide 32

Slide 32 text

Demo

Slide 33

Slide 33 text

Questions § I might even have some answers § (and otherwise the guys after me)