$30 off During Our Annual Pro Sale. View Details »

Hashistack : orchestrer des applications Cloud Native avec simplicité

Hashistack : orchestrer des applications Cloud Native avec simplicité

Lorsqu'on parle d'orchestration de conteneurs, d'exécution d'applications Cloud Native, tout le monde se tourne vers kubernetes. Et pourtant, d'autres solutions existent. L'une d'elle est particulièrement efficace et se base sur une suite d'outils libres développés par Hashicorp : Consul et Nomad en sont les briques principales.

Voyons ensemble et en démos comment mettre en oeuvre une telle stack et pourquoi pas vous faire changer d'avis sur l'orchestration de vos applications.

Yves Brissaud

January 24, 2019
Tweet

More Decks by Yves Brissaud

Other Decks in Technology

Transcript

  1. Hashistack
    Orchestrer des applications
    Cloud Native avec simplicité
    Yves Brissaud
     @_crev_

    View Slide

  2. Cloud Native ?

    View Slide

  3. microservices
    conteneurs /
    docker
    kubernetes

    View Slide

  4. exploiter les possibilités du cloud
    écrite pour le cloud
    http://pzf.fremantle.org/2010/05/cloud-native.html

    View Slide


  5. https://whvn.cc/56532

    View Slide

  6. https://whvn.cc/56532

    View Slide



  7.   
    elasticité

    View Slide

  8. https://gotocph.com/2018/sessions/612

    View Slide

  9. Yves Brissaud
     @_crev_
     eunomie
    [email protected]
    Tech Lead
    Build Infrastructures and
    Deploy Cloud Native Applications
    Seamlessly | Automatically | Instantly
     @sqscale
     squarescale.com

    View Slide

  10. Full Remote | |

    View Slide

  11. https://wallpaperscraft.com/download/rings_rubber_background_heap_80332/3821x2560

    View Slide


  12.    

    View Slide

  13. idempotence
    application
    infrastructure

    View Slide

  14. https://whvn.cc/569648

    View Slide

  15. View Slide

  16. Packaging
    Immutabilité
    Idempotence

    View Slide

  17. https://www.nomadproject.io/

    View Slide

  18. Orchestrateur
    Lifecycle
    Rolling deploys
    Blue green
    Service, batch, system

    View Slide

  19. Drivers
    Docker, rkt
    JVM
    qemu
    plugins nomad >= 0.9

    View Slide

  20. Facile à déployer
    1 binaire
    linux / windows / mac
    autopilot

    View Slide

  21. job "hello" {
    type = "service"
    datacenters = ["dc1"]
    group "world" {
    count = 3
    task "hello-api" {
    driver = "docker"
    config {
    image = "hashicorp/http-echo"
    args = ["-text=Hello!"]
    port_map {

    View Slide

  22. job "run-hook" {
    datacenters = ["dc1"]
    type = "batch"
    periodic {
    cron = "@hourly"
    prohibit_overlap = true
    }
    group "run-hook" {
    count = 1
    task "curl" {
    driver = "exec"

    View Slide

  23. job "notify-event" {
    type = "batch"
    parameterized {
    payload = "required"
    meta_required = ["email"]
    }
    group "notify" {
    task "notify" {
    driver = "docker"
    dispatch_payload {
    file = "config.json"

    View Slide

  24. View Slide

  25. View Slide

  26. https://www.consul.io/

    View Slide

  27. Service Discovery
    Service Con guration
    Service Segmentation

    View Slide

  28. Enregistre chaque service
    Health Checks (http, tcp, grpc, script)
    Découverte API / DNS (SRV)
    Service
    Discovery

    View Slide

  29. # dig srv web.service.consul
    ;; ANSWER SECTION:
    web.service.consul. 0 IN SRV 1 1 3000 2310.addr.dc1.consul.
    web.service.consul. 0 IN SRV 1 1 3000 2600.addr.dc1.consul.
    web.service.consul. 0 IN SRV 1 1 3000 2010.addr.dc1.consul.
    ;; ADDITIONAL SECTION:
    2310.addr.dc1.consul. 0 IN A 10.2.49.9
    ip-10-0-6-93.node.dc1.consul. 0 IN TXT "cluster=app"
    ip-10-0-6-93.node.dc1.consul. 0 IN TXT "group=worker"
    2600.addr.dc1.consul. 0 IN A 10.2.96.3
    ip-10-0-22-143.node.dc1.consul. 0 IN TXT "group=worker"
    ip-10-0-22-143.node.dc1.consul. 0 IN TXT "consul-network-se

    View Slide

  30. intégration load balancers
    Trae k
    Fabio
    Envoy
    Service
    Discovery

    View Slide

  31. Distributed KV Store
    Watches
    Distributed Locks
    Service
    Con guration

    View Slide

  32. Service Access Graph
    Intentions
    Auto TLS
    encrypted communications
    authorization
    Service
    Segmentation

    View Slide

  33. Facile à
    déployer
    1 binaire
    linux / windows / mac
    autopilot

    View Slide

  34. View Slide

  35. View Slide


  36.    

    View Slide

  37. Déployer Consul & Nomad
    Con gurer (docker, dns, etc)
    Répétable

    View Slide

  38. https://www.packer.io/

    View Slide

  39. Construction d'images
    machine
    Installation /
    con guration

    View Slide

  40. AWS, Azure, GCP,
    DigitalOcean,
    OpenStack
    VirtualBox, VMware
    Docker, LXC
    ...

    View Slide

  41. {
    "builders": [{
    "type": "amazon-ebs",
    "region": "eu-west-1",
    "instance_type": "t3.small",
    "source_ami_filter": {
    "filters": {
    "virtualization-type": "hvm",
    "name": "CoreOS-stable-*",
    "root-device-type": "ebs"
    },
    "owners": ["595879546273"],
    "most_recent": true

    View Slide

  42. Infrastructure
    Services externes

    View Slide

  43. https://www.terraform.io/

    View Slide

  44. Infrastructure as Code

    View Slide

  45. Prévisualisation avant
    changement
    Gestion d'état

    View Slide

  46. Multi environments
    Modules
    Multi-providers

    View Slide

  47.  J'adore quand un plan se
    déroule sans accroc.
    - Hannibal

    View Slide

  48. 1. Construction de
    l'image système

    View Slide

  49. 2 Construction de
    l'infrastructure

    View Slide

  50. 3. Consul

    View Slide

  51. 4. Nomad

    View Slide

  52. 5. Docker
    Votre application

    View Slide

  53. Demo

    View Slide

  54. Deploying and Scaling Microservices with Docker and Kubernetes
    https://container.training/kube-selfpaced.yml.html

    View Slide

  55. +
    1 outil, 1 rôle
    ~ Consul
    Suite cohérente
    Documentation
    Facile à déployer

    View Slide

  56. +
    Développement actif
    Consul 1.4
    Nomad ~0.9
    Terraform ~0.12

    View Slide

  57. -
    kubernetes

    View Slide

  58. Hashistack
    Packer, Terraform, Consul, Nomad
    Orchestrer des applications Cloud Native avec simplicité
    Yves Brissaud
     @_crev_

    View Slide