Builder … Je suis... Bastien Cadiot (@bcadiot) www.wescale.fr | @YesWeScale HashiCorp User : Terraform, Consul, Vagrant Et … utilisateur de Nomad depuis la version 0.1.0 Nomad, l’orchestration made in Hashicorp 2
cluster Nomad • Instanciation de 3 VM serveurs • Installation de Consul et Nomad Server • Instanciation de 3 VM clients • Installation de Consul Client, Nomad Client, et Docker Etape 2 : Création d’une appli Nomad • Création du fichier job • Enregistrement du job sur le cluster Nomad • Vérification du lancement de l’application Nomad, l’orchestration made in Hashicorp 13 Init & Run Besoin : Déployer une application sur une infra de conteneurs
run # nomad run -address=http://104.199.99.190:4646 app.nomad ==> Monitoring evaluation "db7e8098" Evaluation triggered by job "pcd2017" Allocation "16dc6ad2" created: node "e53bb5ae", group "webs" Allocation "b606c351" created: node "f3e16921", group "database" Allocation "f8c7662f" created: node "f3e16921", group "webs" Evaluation status changed: "pending" -> "complete" ==> Evaluation "db7e8098" finished with status "complete" 18 Nomad, l’orchestration made in Hashicorp
status nomad status -address=http://104.199.99.190:4646 pcd2017 ID = pcd2017 Name = pcd2017 Type = service Priority = 50 Datacenters = gce-west1 Status = running Periodic = false Parameterized = false Summary Task Group Queued Starting Running Failed Complete Lost database 0 0 1 0 0 0 webs 0 0 2 0 0 0 Allocations ID Eval ID Node ID Task Group Desired Status Created At 16dc6ad2 db7e8098 e53bb5ae webs run running 06/12/17 23:25:05 CEST b606c351 db7e8098 f3e16921 database run running 06/12/17 23:25:05 CEST f8c7662f db7e8098 f3e16921 webs run running 06/12/17 23:25:05 CEST 19 Nomad, l’orchestration made in Hashicorp
datacenter France • Création d’un datacenter chez un cloud provider Français (OVH) • Instanciation de 3 VM serveurs • Installation de Consul Server • Jonction avec les serveurs Europe • Instanciation de 1 VM client • Installation de Consul Client, Nomad Besoin : Mise à jour pour un besoin client Etape 4 : Mise à jour d’une appli Nomad • Modification du fichier job pour ajouter les contraintes • Mise à jour du job sur le cluster Nomad • Vérification de l’application Extend & Update 20 Nomad, l’orchestration made in Hashicorp
# consul members -wan Node Address Status Type Build Protocol DC server-europe-1.gce-west1 104.199.99.190:8302 alive server 0.8.3 2 gce-west1 server-europe-2.gce-west1 104.199.75.126:8302 alive server 0.8.3 2 gce-west1 server-europe-3.gce-west1 146.148.13.182:8302 alive server 0.8.3 2 gce-west1 server-ovh-france-1.localdomain.france 217.182.82.249:8302 alive server 0.8.3 2 france server-ovh-france-2.localdomain.france 217.182.82.247:8302 alive server 0.8.3 2 france server-ovh-france-3.localdomain.france 217.182.82.243:8302 alive server 0.8.3 2 france 22 Nomad, l’orchestration made in Hashicorp
# nomad node-status ID DC Name Class Drain Status e9a30fd3 france client-ovh-france-1.localdomain data false ready 47e449e7 gce-west1 client-europe-3 <none> false ready e53bb5ae gce-west1 client-europe-1 <none> false ready f3e16921 gce-west1 client-europe-2 <none> false ready 23 Nomad, l’orchestration made in Hashicorp
run # nomad run -address=http://104.199.99.190:4646 app.nomad ==> Monitoring evaluation "22cc22e9" Evaluation triggered by job "pcd2017" Allocation "f8c7662f" modified: node "f3e16921", group "webs" Allocation "689de99d" created: node "e9a30fd3", group "database" Allocation "16dc6ad2" modified: node "e53bb5ae", group "webs" Evaluation status changed: "pending" -> "complete" ==> Evaluation "22cc22e9" finished with status "complete" 25 Nomad, l’orchestration made in Hashicorp
status nomad status -address=http://104.199.99.190:4646 pcd2017 ID = pcd2017 Name = pcd2017 Type = service Priority = 50 Datacenters = gce-west1,france Status = running Periodic = false Parameterized = false Summary Task Group Queued Starting Running Failed Complete Lost database 0 0 1 0 1 0 webs 0 0 2 0 0 0 Allocations ID Eval ID Node ID Task Group Desired Status Created At 689de99d 22cc22e9 e9a30fd3 database run running 06/12/17 23:32:32 CEST 16dc6ad2 22cc22e9 e53bb5ae webs run running 06/12/17 23:25:05 CEST b606c351 db7e8098 f3e16921 database stop complete 06/12/17 23:25:05 CEST f8c7662f 22cc22e9 f3e16921 webs run running 06/12/17 23:25:05 CEST 26 Nomad, l’orchestration made in Hashicorp
région Nomad située aux USA et liaison des deux régions • Création d’un VPC chez un cloud provider Américain (AWS) • Instanciation de 3 VM serveurs • Installation de Consul Server, et Nomad Server • Jonction de la nouvelle région avec la région Europe • Instanciation de 3 VM clients • Installation de Consul Client, Nomad Client, et Docker Besoin : Accompagner la montée en puissance Scaling 27 Nomad, l’orchestration made in Hashicorp
# consul members -wan Node Address Status Type Build Protocol DC ip-10-59-1-10.aws-west2 54.218.254.37:8302 alive server 0.8.3 2 aws-west2 ip-10-59-1-201.aws-west2 54.191.239.249:8302 alive server 0.8.3 2 aws-west2 ip-10-59-1-217.aws-west2 54.202.180.132:8302 alive server 0.8.3 2 aws-west2 server-europe-1.gce-west1 104.199.99.190:8302 alive server 0.8.3 2 gce-west1 server-europe-2.gce-west1 104.199.75.126:8302 alive server 0.8.3 2 gce-west1 server-europe-3.gce-west1 146.148.13.182:8302 alive server 0.8.3 2 gce-west1 server-ovh-france-1.localdomain.france 217.182.82.249:8302 alive server 0.8.3 2 france server-ovh-france-2.localdomain.france 217.182.82.247:8302 alive server 0.8.3 2 france server-ovh-france-3.localdomain.france 217.182.82.243:8302 alive server 0.8.3 2 france 29 Nomad, l’orchestration made in Hashicorp