Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Bridging Past, Present, and Future infrastructure with Consul

Bridging Past, Present, and Future infrastructure with Consul

Today’s data centers aren’t the same anymore. We are constantly moving from one set of technologies to the other. We often find it hard to connect newly deployed applications to rest of our infrastructure. See how to use Consul to help connect applications across your infrastructure. Consul is an open source tool for service discovery, monitoring, and globally distributed key-value store. In this talk we will cover how Consul can help bridge the gap between various types of applications that might exist in a datacenter at any given time. As we move towards micro service oriented architectures we find ourselves using cluster schedulers like Kubernetes and Nomad. We will discuss how Consul’s service discovery features help connect applications running in such environments. We will also explore how we can connect applications that are running in traditional environments to ones running in these cluster schedulers using Consul’s API and built in DNS support. We will do a live demo of connecting two applications running in separate environments using Consul and showcase important features of Consul.

Anubhav Mishra

April 11, 2018
Tweet

More Decks by Anubhav Mishra

Other Decks in Technology

Transcript

  1. PROVISION, SECURE AND RUN ANY INFRASTRUCTURE Nomad Consul Vault Vagrant

    Packer Terraform Consul Enterprise Terraform Enterprise Vault Enterprise PRODUCT SUITE OSS TOOL SUITE RUN Applications SECURE Application Infrastructure PROVISION Infrastructure FOR INDIVIDUALS FOR TEAMS Nomad Enterprise
  2. Copyright © 2017 HashiCorp @anubhavm  History !8 1995-2000 Physical

    Machines, Static Provisioning 2017-2018 Virtual Machines, Dynamic Provisioning
  3. Copyright © 2017 HashiCorp @anubhavm  -/+ Change !17 Abstractions

    Datacenters Physical/Virtual machines Servers IP addresses, DNS Monolithic applications
  4. Copyright © 2017 HashiCorp @anubhavm  -/+ Change !18 Abstractions

    Datacenters Physical/Virtual machines Servers IP addresses, DNS Monolithic applications
  5. Copyright © 2017 HashiCorp @anubhavm  -/+ Change !19 Abstractions

    Datacenters Physical/Virtual machines Servers IP addresses, DNS Monolithic applications Platform Containers Services Service discovery Microservices
  6. Copyright © 2017 HashiCorp @anubhavm  -/+ Change !21 Overview

    Cloud/Infrastructure Providers Network Protocols
  7. Copyright © 2017 HashiCorp @anubhavm  -/+ Change !22 Overview

    Cloud/Infrastructure Providers Network Protocols Runtime, Platform, CI/CD, Configuration Management, Developer Tools…..
  8. Copyright © 2017 HashiCorp @anubhavm  -/+ Change !23 Overview

    Cloud/Infrastructure Providers Network Protocols “Stuff” You Need to Make Software Work
  9. Copyright © 2017 HashiCorp @anubhavm  • Service Discovery •

    DNS or HTTP Interface • Health Checks • Dynamic Configuration via Consistent Key-Value Store Consul !31
  10. Copyright © 2017 HashiCorp @anubhavm  • Service Discovery •

    DNS or HTTP Interface • Health Checks • Dynamic Configuration via Consistent Key-Value Store Consul !32
  11. Copyright © 2017 HashiCorp @anubhavm  Consul Cluster !34 CLIENT

    CLIENT CLIENT CLIENT CLIENT CLIENT SERVER SERVER SERVER REPLICATION REPLICATION RPC RPC LAN GOSSIP SERVER SERVER SERVER REPLICATION REPLICATION WAN GOSSIP
  12. Copyright © 2017 HashiCorp Terminal !45 Via DNS Discovery $

    dig backend.service.consul # ... ;; QUESTION SECTION: ;backend.service.consul. IN A ;; ANSWER SECTION: backend.service.consul.0 IN A 10.0.5.69 backend.service.consul.0 IN A 10.0.5.34 backend.service.consul.0 IN A 10.0.5.138
  13. Copyright © 2017 HashiCorp Terminal !46 Via DNS Load Balancing

    $ dig backend.service.consul # ... ;; QUESTION SECTION: ;backend.service.consul. IN A ;; ANSWER SECTION: backend.service.consul.0 IN A 10.0.5.69 backend.service.consul.0 IN A 10.0.5.34 backend.service.consul.0 IN A 10.0.5.138
  14. Copyright © 2017 HashiCorp Terminal !47 Via DNS Load Balancing

    $ dig backend.service.consul # ... ;; QUESTION SECTION: ;backend.service.consul. IN A ;; ANSWER SECTION: backend.service.consul.0 IN A 10.0.5.69 backend.service.consul.0 IN A 10.0.5.138 backend.service.consul.0 IN A 10.0.5.34
  15. Copyright © 2017 HashiCorp Terminal !48 Via HTTP Discovery $

    curl http://localhost:8500/v1/health/service/backend [ { "Node": { "ID": "071d5055-6afa-c457-1194-1a070d15e35f", "Node": "abd28dac", "Address": "10.0.5.52", "Datacenter": "dc1", }, "Service": { "ID": "backend-01", "Service": "backend", "Port": 80, }, # ... } ]
  16. Copyright © 2017 HashiCorp Terminal !50 Via CLI Key-Value Store

    $ consul kv put hello world Success! Data written to: hello
  17. Copyright © 2017 HashiCorp Terminal !53 Via HTTP Key-Value Store

    $ curl http://localhost:8500/v1/kv/hello [ { "LockIndex": 0, "Key": "hello", "Flags": 0, "Value": "d29ybGQ=", "CreateIndex": 7, "ModifyIndex": 7 } ]
  18. Copyright © 2017 HashiCorp Terminal !54 Via HTTP Key-Value Store

    $ curl -s http://localhost:8500/v1/kv/hello | jq -r .[].Value | base64 --decode world