SlideShare a Scribd company logo
1 of 19
DISCOVER/REGISTER
EVERYTHING IN CONSUL
EVERYTHING DISCOVERD USING CONSUL-TEMPLATE AND CONSUL.
AGENDA
• Service Discovery introduction
• Benefits
• Consul service Discovery – Registration checks/services
• Consul templates
• Haproxy, Bind9 and iptables auto-Discovery
• Demo
INTRODUCTION
The basic idea behind
service discovery is for each
new instance of a service (or
an application) to be able to
identify its current
environment and store that
information. For example, if
you spawn a service that
service must provide
information to populate other
service like spawn services
to populate load
balancer,DNS,firewall and
others services.
SERVICE DISCOVERY - BENEFITS
• Centralized information for services
• One or more information can be used for many services
• Distribuited services can process information at the same time making
faster workflow/pipeline
• Simple implemention and standardized architecture for all services
• Easy way to rollback or continue workflow
CONSUL – REGISTERING CHECKS/SERVICES
Registering checks to add health checks in our services, that prevent using services that are
unhealthy.In our case we are going to create a unique check localhost avoiding creating a lot checks for
each node.
** You can choose many checks like http,tcp,checks and TTL.
CONSUL – REGISTERING SERVICES
Registering service associating with the checks/health checks, you can add more node just modifying
the ID and Address
REGISTERING/DEREGISTERING WAYS
• Nomad has fully integration with consul and you can set the registration in job config file.
• Consul agent can register services/checks/ using simple json config file.
• Registrator can be used to listen docker events to register on consul.
• Systemd can be used with ExecStartPre, ExecStop to send registration/deregistration API.
• We can send API directly from services/applications.
CONSUL-TEMPLATE
Consul Template queries a Consul servers and updates any number of config
templates/ files and could reload the configuration (it´s like confd service does from
CoreOS).It uses “go template” to rendering config file.
CONSUL TEMPLATE FOR API-INTEGRATION
Some services/products don´t use much config file but Most of the time
it has a good API suport. So If tha´t is the case, you can still use consul
template to get information from consul and convert to a json format
directly.Like consul-f5 Project does. It populate a json file from consul
about your instances and send API to f5 to create VS and pool. You can
create servisse like this for any product which supports API.
DEMO - CONSUL TEMPLATE
• Auto-discover nodes for Load Balancer (Haproxy (tcp e http)
• Auto-Discovery DNS records (Bind dns records)
• Auto-Discovery iptables RULES (allow external access DNAT )
Consul Template uses go template to rendering config file and supports send notifications
and exec commands after some changes (new registration/deregistration).It can be
adapted for almost any case but we are going to show some basics in our case showing
how powerfull is it. Following methods we are going to show:
SERVICE DISCOVERY - HAPROXY
• We are going to register 4 tags associated with the services : Port, external
ip address, dns records + domain, protocol.
• If a service register a “http service”, consul template is going to populate
acl´s inside same frontend to send to correct backend in haproxy config file.
(we setup it to use same ip address for many domains)
• If a service register a “tcp service” , consul template is going to populate a
new frontend with the backend associated.
TESTING CONSUL-TEMPLATE HAPROXY
IN Out
As you can see we have different configs for tcp and http services. It was populated based
on Tags by Consul-template.
TESTING - SERVICE DISCOVERY - BIND
TESTING - SERVICE DISCOVERY - IPTABLES
IN Out
TESTING ALL TOGETHER I -
Checking if everything is clean
TESTING ALL TOGETHER II -
TESTING ALL TOGETHER III – HAPROXY
CONFIG FILE POPULATED
TESTING ALL TOGETHER III –
BIND/IPTABLES CONFIG FILE POPULATED
THANK YOU!
Questions?
More Information:
Linkedin:
https://www.linkedin.com/in/leandro-totino-pereira
Facebook:
www.facebook.com/leandro.totinopereira

More Related Content

What's hot

What's hot (19)

Welcome Azure Functions 2. 0
Welcome Azure Functions 2. 0Welcome Azure Functions 2. 0
Welcome Azure Functions 2. 0
 
Building Thick Clients with Tower in Rust
Building Thick Clients with Tower in RustBuilding Thick Clients with Tower in Rust
Building Thick Clients with Tower in Rust
 
The burden of a successful feature: Scaling our real time logging platform
The burden of a successful feature: Scaling our real time logging platformThe burden of a successful feature: Scaling our real time logging platform
The burden of a successful feature: Scaling our real time logging platform
 
Projects
ProjectsProjects
Projects
 
Composer intro
Composer introComposer intro
Composer intro
 
Compute @ edge
Compute @ edgeCompute @ edge
Compute @ edge
 
Postman tests in jenkins
Postman tests in jenkinsPostman tests in jenkins
Postman tests in jenkins
 
ONAP SDC - Model driven design
ONAP SDC - Model driven designONAP SDC - Model driven design
ONAP SDC - Model driven design
 
Driving Service Reliability Through Autoscaling Workloads on OpenShift
Driving Service Reliability Through Autoscaling Workloads on OpenShiftDriving Service Reliability Through Autoscaling Workloads on OpenShift
Driving Service Reliability Through Autoscaling Workloads on OpenShift
 
Readme
ReadmeReadme
Readme
 
Stuff we noticed while building "Asterisk in the cloud"
Stuff we noticed while building "Asterisk in the cloud"Stuff we noticed while building "Asterisk in the cloud"
Stuff we noticed while building "Asterisk in the cloud"
 
Version Control ThinkVitamin
Version Control ThinkVitaminVersion Control ThinkVitamin
Version Control ThinkVitamin
 
Pie on AWS
Pie on AWSPie on AWS
Pie on AWS
 
KFServing and Kubeflow Pipelines
KFServing and Kubeflow PipelinesKFServing and Kubeflow Pipelines
KFServing and Kubeflow Pipelines
 
The Simply Complex Task of Implementing Kubernetes Ingress - Velocity NYC
The Simply Complex Task of Implementing Kubernetes Ingress - Velocity NYCThe Simply Complex Task of Implementing Kubernetes Ingress - Velocity NYC
The Simply Complex Task of Implementing Kubernetes Ingress - Velocity NYC
 
Creating the application
Creating the applicationCreating the application
Creating the application
 
AWS December 2015 Webinar Series - Continuous Delivery to Amazon EC2 Containe...
AWS December 2015 Webinar Series - Continuous Delivery to Amazon EC2 Containe...AWS December 2015 Webinar Series - Continuous Delivery to Amazon EC2 Containe...
AWS December 2015 Webinar Series - Continuous Delivery to Amazon EC2 Containe...
 
Navigate Data Service using AWS
Navigate Data Service using AWSNavigate Data Service using AWS
Navigate Data Service using AWS
 
Intro to.net core 20170111
Intro to.net core   20170111Intro to.net core   20170111
Intro to.net core 20170111
 

Similar to Discover/Register Everything in consul

Similar to Discover/Register Everything in consul (20)

Kubernetes101 - Pune Kubernetes Meetup 6
Kubernetes101 - Pune Kubernetes Meetup 6Kubernetes101 - Pune Kubernetes Meetup 6
Kubernetes101 - Pune Kubernetes Meetup 6
 
Scaling on EC2 in a fast-paced environment (LISA'11 - Full Paper)
Scaling on EC2 in a fast-paced environment (LISA'11 - Full Paper)Scaling on EC2 in a fast-paced environment (LISA'11 - Full Paper)
Scaling on EC2 in a fast-paced environment (LISA'11 - Full Paper)
 
Service Discovery and Registration in a Microservices Architecture
Service Discovery and Registration in a Microservices ArchitectureService Discovery and Registration in a Microservices Architecture
Service Discovery and Registration in a Microservices Architecture
 
Introducing Gridiron Security and Compliance Management Platform and Enclave ...
Introducing Gridiron Security and Compliance Management Platform and Enclave ...Introducing Gridiron Security and Compliance Management Platform and Enclave ...
Introducing Gridiron Security and Compliance Management Platform and Enclave ...
 
services order
services orderservices order
services order
 
Practical solutions for connections administrators
Practical solutions for connections administratorsPractical solutions for connections administrators
Practical solutions for connections administrators
 
FOSDEM19 MySQL Component Infrastructure
FOSDEM19 MySQL Component InfrastructureFOSDEM19 MySQL Component Infrastructure
FOSDEM19 MySQL Component Infrastructure
 
Bluemix DevOps Services
Bluemix DevOps Services Bluemix DevOps Services
Bluemix DevOps Services
 
Integrating Infrastructure as Code into a Continuous Delivery Pipeline | AWS ...
Integrating Infrastructure as Code into a Continuous Delivery Pipeline | AWS ...Integrating Infrastructure as Code into a Continuous Delivery Pipeline | AWS ...
Integrating Infrastructure as Code into a Continuous Delivery Pipeline | AWS ...
 
autumo ifaceX - Product Presentation
autumo ifaceX - Product Presentationautumo ifaceX - Product Presentation
autumo ifaceX - Product Presentation
 
Introduction To Apache Camel
Introduction To Apache CamelIntroduction To Apache Camel
Introduction To Apache Camel
 
Hia 1691-using iib-to_support_api_economy
Hia 1691-using iib-to_support_api_economyHia 1691-using iib-to_support_api_economy
Hia 1691-using iib-to_support_api_economy
 
Service Discovery in MicroServices
Service Discovery in MicroServicesService Discovery in MicroServices
Service Discovery in MicroServices
 
locize tech stack
locize tech stacklocize tech stack
locize tech stack
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 
HL7 Survival Guide - Chapter 10 – Process and Workflow
HL7 Survival Guide - Chapter 10 – Process and WorkflowHL7 Survival Guide - Chapter 10 – Process and Workflow
HL7 Survival Guide - Chapter 10 – Process and Workflow
 
DevOps Fest 2020. immutable infrastructure as code. True story.
DevOps Fest 2020. immutable infrastructure as code. True story.DevOps Fest 2020. immutable infrastructure as code. True story.
DevOps Fest 2020. immutable infrastructure as code. True story.
 
How to – wrap soap web service around a database
How to – wrap soap web service around a databaseHow to – wrap soap web service around a database
How to – wrap soap web service around a database
 
analytic engine - a common big data computation service on the aws
analytic engine - a common big data computation service on the awsanalytic engine - a common big data computation service on the aws
analytic engine - a common big data computation service on the aws
 
Customer Sharing: Trend Micro - Analytic Engine - A common Big Data computati...
Customer Sharing: Trend Micro - Analytic Engine - A common Big Data computati...Customer Sharing: Trend Micro - Analytic Engine - A common Big Data computati...
Customer Sharing: Trend Micro - Analytic Engine - A common Big Data computati...
 

More from Leandro Totino Pereira

More from Leandro Totino Pereira (9)

Backup multi-cloud solution based on named pipes
Backup multi-cloud solution based on named pipesBackup multi-cloud solution based on named pipes
Backup multi-cloud solution based on named pipes
 
Zabbix at scale with Elasticsearch
Zabbix at scale with ElasticsearchZabbix at scale with Elasticsearch
Zabbix at scale with Elasticsearch
 
Monitoring at scale - Sensu Kafka Kafka-connect Cassandra PrestoDB
Monitoring at scale - Sensu Kafka Kafka-connect Cassandra PrestoDBMonitoring at scale - Sensu Kafka Kafka-connect Cassandra PrestoDB
Monitoring at scale - Sensu Kafka Kafka-connect Cassandra PrestoDB
 
Automate schedule
Automate scheduleAutomate schedule
Automate schedule
 
Real time analytics
Real time analyticsReal time analytics
Real time analytics
 
Gocd – Kubernetes/Nomad Continuous Deployment
Gocd – Kubernetes/Nomad Continuous DeploymentGocd – Kubernetes/Nomad Continuous Deployment
Gocd – Kubernetes/Nomad Continuous Deployment
 
Linkerd – Service mesh with service Discovery backend
Linkerd – Service mesh with service Discovery backendLinkerd – Service mesh with service Discovery backend
Linkerd – Service mesh with service Discovery backend
 
DynomiteDB - No spof High-availability Redis cluster solution
DynomiteDB -  No spof High-availability Redis cluster solutionDynomiteDB -  No spof High-availability Redis cluster solution
DynomiteDB - No spof High-availability Redis cluster solution
 
DalmatinerDB and cockroachDB monitoring plataform
DalmatinerDB and cockroachDB monitoring plataformDalmatinerDB and cockroachDB monitoring plataform
DalmatinerDB and cockroachDB monitoring plataform
 

Recently uploaded

School management system project report.pdf
School management system project report.pdfSchool management system project report.pdf
School management system project report.pdf
Kamal Acharya
 
Paint shop management system project report.pdf
Paint shop management system project report.pdfPaint shop management system project report.pdf
Paint shop management system project report.pdf
Kamal Acharya
 
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdfONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
Kamal Acharya
 

Recently uploaded (20)

ChatGPT Prompt Engineering for project managers.pdf
ChatGPT Prompt Engineering for project managers.pdfChatGPT Prompt Engineering for project managers.pdf
ChatGPT Prompt Engineering for project managers.pdf
 
Research Methodolgy & Intellectual Property Rights Series 2
Research Methodolgy & Intellectual Property Rights Series 2Research Methodolgy & Intellectual Property Rights Series 2
Research Methodolgy & Intellectual Property Rights Series 2
 
Dairy management system project report..pdf
Dairy management system project report..pdfDairy management system project report..pdf
Dairy management system project report..pdf
 
School management system project report.pdf
School management system project report.pdfSchool management system project report.pdf
School management system project report.pdf
 
Paint shop management system project report.pdf
Paint shop management system project report.pdfPaint shop management system project report.pdf
Paint shop management system project report.pdf
 
Arduino based vehicle speed tracker project
Arduino based vehicle speed tracker projectArduino based vehicle speed tracker project
Arduino based vehicle speed tracker project
 
Lect_Z_Transform_Main_digital_image_processing.pptx
Lect_Z_Transform_Main_digital_image_processing.pptxLect_Z_Transform_Main_digital_image_processing.pptx
Lect_Z_Transform_Main_digital_image_processing.pptx
 
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.pdf
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.pdfRESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.pdf
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.pdf
 
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdfONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
 
Electrostatic field in a coaxial transmission line
Electrostatic field in a coaxial transmission lineElectrostatic field in a coaxial transmission line
Electrostatic field in a coaxial transmission line
 
Filters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility ApplicationsFilters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility Applications
 
"United Nations Park" Site Visit Report.
"United Nations Park" Site  Visit Report."United Nations Park" Site  Visit Report.
"United Nations Park" Site Visit Report.
 
BURGER ORDERING SYSYTEM PROJECT REPORT..pdf
BURGER ORDERING SYSYTEM PROJECT REPORT..pdfBURGER ORDERING SYSYTEM PROJECT REPORT..pdf
BURGER ORDERING SYSYTEM PROJECT REPORT..pdf
 
Diploma Engineering Drawing Qp-2024 Ece .pdf
Diploma Engineering Drawing Qp-2024 Ece .pdfDiploma Engineering Drawing Qp-2024 Ece .pdf
Diploma Engineering Drawing Qp-2024 Ece .pdf
 
How to Design and spec harmonic filter.pdf
How to Design and spec harmonic filter.pdfHow to Design and spec harmonic filter.pdf
How to Design and spec harmonic filter.pdf
 
Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1
 
2024 DevOps Pro Europe - Growing at the edge
2024 DevOps Pro Europe - Growing at the edge2024 DevOps Pro Europe - Growing at the edge
2024 DevOps Pro Europe - Growing at the edge
 
solid state electronics ktu module 5 slides
solid state electronics ktu module 5 slidessolid state electronics ktu module 5 slides
solid state electronics ktu module 5 slides
 
Intelligent Agents, A discovery on How A Rational Agent Acts
Intelligent Agents, A discovery on How A Rational Agent ActsIntelligent Agents, A discovery on How A Rational Agent Acts
Intelligent Agents, A discovery on How A Rational Agent Acts
 
BRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWING
BRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWINGBRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWING
BRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWING
 

Discover/Register Everything in consul

  • 1. DISCOVER/REGISTER EVERYTHING IN CONSUL EVERYTHING DISCOVERD USING CONSUL-TEMPLATE AND CONSUL.
  • 2. AGENDA • Service Discovery introduction • Benefits • Consul service Discovery – Registration checks/services • Consul templates • Haproxy, Bind9 and iptables auto-Discovery • Demo
  • 3. INTRODUCTION The basic idea behind service discovery is for each new instance of a service (or an application) to be able to identify its current environment and store that information. For example, if you spawn a service that service must provide information to populate other service like spawn services to populate load balancer,DNS,firewall and others services.
  • 4. SERVICE DISCOVERY - BENEFITS • Centralized information for services • One or more information can be used for many services • Distribuited services can process information at the same time making faster workflow/pipeline • Simple implemention and standardized architecture for all services • Easy way to rollback or continue workflow
  • 5. CONSUL – REGISTERING CHECKS/SERVICES Registering checks to add health checks in our services, that prevent using services that are unhealthy.In our case we are going to create a unique check localhost avoiding creating a lot checks for each node. ** You can choose many checks like http,tcp,checks and TTL.
  • 6. CONSUL – REGISTERING SERVICES Registering service associating with the checks/health checks, you can add more node just modifying the ID and Address
  • 7. REGISTERING/DEREGISTERING WAYS • Nomad has fully integration with consul and you can set the registration in job config file. • Consul agent can register services/checks/ using simple json config file. • Registrator can be used to listen docker events to register on consul. • Systemd can be used with ExecStartPre, ExecStop to send registration/deregistration API. • We can send API directly from services/applications.
  • 8. CONSUL-TEMPLATE Consul Template queries a Consul servers and updates any number of config templates/ files and could reload the configuration (it´s like confd service does from CoreOS).It uses “go template” to rendering config file.
  • 9. CONSUL TEMPLATE FOR API-INTEGRATION Some services/products don´t use much config file but Most of the time it has a good API suport. So If tha´t is the case, you can still use consul template to get information from consul and convert to a json format directly.Like consul-f5 Project does. It populate a json file from consul about your instances and send API to f5 to create VS and pool. You can create servisse like this for any product which supports API.
  • 10. DEMO - CONSUL TEMPLATE • Auto-discover nodes for Load Balancer (Haproxy (tcp e http) • Auto-Discovery DNS records (Bind dns records) • Auto-Discovery iptables RULES (allow external access DNAT ) Consul Template uses go template to rendering config file and supports send notifications and exec commands after some changes (new registration/deregistration).It can be adapted for almost any case but we are going to show some basics in our case showing how powerfull is it. Following methods we are going to show:
  • 11. SERVICE DISCOVERY - HAPROXY • We are going to register 4 tags associated with the services : Port, external ip address, dns records + domain, protocol. • If a service register a “http service”, consul template is going to populate acl´s inside same frontend to send to correct backend in haproxy config file. (we setup it to use same ip address for many domains) • If a service register a “tcp service” , consul template is going to populate a new frontend with the backend associated.
  • 12. TESTING CONSUL-TEMPLATE HAPROXY IN Out As you can see we have different configs for tcp and http services. It was populated based on Tags by Consul-template.
  • 13. TESTING - SERVICE DISCOVERY - BIND
  • 14. TESTING - SERVICE DISCOVERY - IPTABLES IN Out
  • 15. TESTING ALL TOGETHER I - Checking if everything is clean
  • 17. TESTING ALL TOGETHER III – HAPROXY CONFIG FILE POPULATED
  • 18. TESTING ALL TOGETHER III – BIND/IPTABLES CONFIG FILE POPULATED