Share
Embed
はじめての英語プレゼン #6 LT - My first step of HashiCorp Nomad
はじめてのHashiCorp Nomad
Takaaki FURUKAWA
January 18, 2018
Transcript
16 slides
-
My first step of HashiCorp Nomad はじめての英語プレゼン #6 LT January
18, 2018 Takaaki Furukawa -
About me • Takaaki Furukawa • Technical Account Manager •
Chef Instructor • @tkak (twitter/github) -
HashiConf 17 • September 18-20, 2017, Austin, Texas • Main
Topics • Terraform Enterprise, Terraform Module Registry • Vault k8s support • Nomad Enterprise, Nomad 0.7 (Web UI, ACL) • Consul 1.0 • Sentinel (Policy as Code) -
Nomad • Simple and lightweight application scheduler • Long lived
services and short lived batch processing • Distributed system and Highly-Available • Multiple workload, not Docker optimistic • UNIX philosophy • Blue-green deployment / Canary deployment -
Trial environment • Nomad + consul • 3 servers +
3 clients • CentOS 7 • Managed by Terraform + Chef Nomad Client Fabio App Nomad Server Nomad Client Fabio App Nomad Client Fabio App Nomad Server Nomad Server Load Balancer -
Deployment flow 1. Deploy fabio which is a simple HTTP
proxy with consul 2. Deploy an example Go application, echoapp v1.0.0 3. Periodically access to “/version” API endpoint for checking 4. Deploy 1 echoapp v1.1.0 task as canary 5. Upgrade all echoapp tasks -
{"version":"1.0.0"} {"version":"1.0.0"} {"version":"1.0.0"} {"version":"1.1.0"} {"version":"1.0.0"} $ while true; do \
curl -H 'Host: echoapp.foobar.co.jp' \ http://nomad-client0.foobar.jp.local:9999/version; \ sleep 1; \ done Canary deployment successfully! -
Future works • Investigation • Nomad enterprise (multi tenancy, resource
isolation, sentinel) • Service mesh (istio, traefik, envoy, haproxy, nginx) • OpenFaaS + nomad -
References • 12-Factor Apps and the HashiStack • Keylsey Hightower
• https://www.youtube.com/watch?v=Nosa5-xcATw • hashicorp/terraform-google-nomad • https://github.com/hashicorp/terraform-google-nomad • Fabio - Consul Load-Balancing made simple • https://github.com/fabiolb/fabio • Chef cookbook for nomad • https://github.com/tkak/nomad-agent-cookbook • An example application on nomad • https://github.com/tkak/echoapp -
+ Job: "fabio" + Task Group: "fabio" (3 create) +
Task: "fabio" (forces create) Scheduler dry-run: - All tasks successfully allocated. Job Modify Index: 0 To submit the job with version verification run: nomad run -check-index 0 fabio.nomad When running the job with the check-index flag, the job will only be run if the server side version matches the job modify index returned. If the index has changed, another user has modified the job and the plan's results are potentially invalid. $ nomad plan fabio.nomad -
==> Monitoring evaluation "c6af39dd" Evaluation triggered by job "fabio" Allocation
"21235cf3" created: node "e783830f", group "fabio" Allocation "2a03fa54" created: node "4bc3d8af", group "fabio" Allocation "6eefa6e6" created: node "093a8a6a", group "fabio" Evaluation status changed: "pending" -> "complete" ==> Evaluation "c6af39dd" finished with status "complete" $ nomad run fabio.nomad -
$ nomad status fabio ID = fabio Name = fabio
Submit Date = 12/14/17 21:41:38 JST Type = system Priority = 50 Datacenters = dc1 Status = running Periodic = false Parameterized = false Summary Task Group Queued Starting Running Failed Complete Lost fabio 0 0 3 0 0 0 Allocations ID Node ID Task Group Version Desired Status Created At 21235cf3 e783830f fabio 0 run running 12/14/17 21:41:38 JST 2a03fa54 4bc3d8af fabio 0 run running 12/14/17 21:41:38 JST 6eefa6e6 093a8a6a fabio 0 run running 12/14/17 21:41:38 JST