Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Service Discovery with Consul - Arunvel Arunachalam

237 views

Published on

Service Discovery with Consul - Arunvel Arunachalam as a part of Kubernetes & Cloud Native Online meetup
https://www.meetup.com/k8s-cloudnative-online/events/269930039/

Published in: Software
  • Be the first to comment

  • Be the first to like this

Service Discovery with Consul - Arunvel Arunachalam

  1. 1. Consul By Arun
  2. 2. Consul Demo By Arun
  3. 3. Service Discovery with Consul By Arun
  4. 4. $kubectl get speaker • Arunvel Arunachalam • Senior Infrastructure Developer (CTS Pune) • 7+ years of experience • Soccer • Author by Passion • https://medium.com/@csemanit2015
  5. 5. Layout • TLDR • Deep Dive • Hands-on
  6. 6. Disclaimer • Rapid Change is the new normal csemanit2015@gmail.com arunvel.wordpress.com https://medium.com/@csemanit2015 Arunvel Arunachalam [Linkedin] Mob - 9028825645
  7. 7. Consul • Hashicorp 2012 • March 2020 = Hashicorp Joins CNCF • Packer = Image Builder • Terraform = IAC Tool • Vault = Securely Accessing Secrets • Consul(2014) = (Service Discovery – Service Configuration – Service Segmentation)
  8. 8. • Google = Stubby • Twitter = Finagle • Netflix OSS = 2012 (Java Developers) • Hystrix = Circuit Breaking • Ribbon = Client side Load Balancing • Eureka = Service Registration & Discovery • Zuul = Dynamic Edge Proxy (API Gateway)
  9. 9. Consul • Each node = Consul Agent • Consul Agent (Client, Server) • Client - Manages registered services & Health check for that Node - Gossip Protocol (Ping UDP/TCP) - Forwards Client request to Consul Server
  10. 10. Consul Agent - Server • Client + Additional Functions • Storing state of Cluster (K/V). Raft consensus Algo • Forwards client request to Leader Server
  11. 11. Gossip Protocol • GP is based on SWIM (Scalable Weakly-consistent Infection Style Process Group Membership Protocol = Cornell University • UDP = To build membership(ping) • TCP = Use to exchange full details about nodes
  12. 12. LAN Gossip • LAN gossip pool which contains nodes that are all located on the same local area network or datacenter. • Consul is built on top of Serf • SWIM Protocol is implemented via a tool called Serf • Allows Clients to discover Servers automatically • Distributing failure detection across entire cluster • Enabling reliable and fast broadcasting for events (e.g new leader)
  13. 13. Serf • Serf is a tool for cluster membership, failure detection, and orchestration that is decentralized, fault-tolerant and highly available. • It is extremely lightweight: it uses 5 to 10 MB of resident memory
  14. 14. WAN Gossip • WAN gossip pool contains only Consul Agent Servers. • These servers are primarily located in different datacenters and typically communicate over the internet or wide area network • Integrates Failure detection, allowing consul agents to decommission servers
  15. 15. Consul Ports DNS: The DNS server (TCP and UDP) 8600 HTTP: The HTTP API (TCP Only) 8500 HTTPS: The HTTPs API disabled (8501)* gRPC: The gRPC API disabled (8502)* LAN Serf: The Serf LAN port (TCP and UDP) 8301 Wan Serf: The Serf WAN port (TCP and UDP) 8302
  16. 16. • Client Side Load Balancing = give the client the list of possible endpoints and let it decide which to call • Service Discovery = a mechanism for finding the periodically updated list of healthy end points • Circuit Breaking = shedding load for a period of time to a service that misbehaves • Bulk Heading = limits client resource usage with explicit thresholds
  17. 17. • Timeouts = enforcing time limitations on requests • Retries = retrying a failed request • Retry Budget = applying constraints to retries (can only retry 50% of the calls in a 10s window)
  18. 18. Side Car Proxy Run adjacent to the main service Running in the same pod (But as a separate container) Capable of Handling - Ingress - Egress - Service Discovery - Circuit Breaker, Timeouts and Retries - Load Balancing - Fail Over
  19. 19. Coffee with Arun Q1) Consul Connect is used as Service ------------ . Q2) Consul Node Communication between two Data Center is called as ------- Gossip Q3) Consul uses ------------ Protocol to manage membership & broadcast messages to cluster Q4) The DNS Server port number in Consul is ---------- Q5) ------ is a decentralized solution for cluster membership, failure detection, and orchestration

×