SlideShare una empresa de Scribd logo
1 de 29
Descargar para leer sin conexión
© 2020 Cingulara, Inc.
NATS as a Service Mesh
Using the power and simplicity of NATS to create a service mesh
© 2020 Cingulara, Inc.
Table of Contents
■ Define Service Mesh
■ NATS Service Discovery
■ NATS Security
■ NATS Metrics
■ NATS Tracing
■ NATS Load Balancing
■ NATS Routing Control
© 2020 Cingulara, Inc.
Define Service Mesh
What is a Service Mesh, Where would you use it, Why would you use it
© 2020 Cingulara, Inc.
What is a Service Mesh?
❏ Infrastructure Layer for your applications
❏ Helps with interactions between / among services and microservices
❏ Service Discovery (eventual consistency, distributed caching)
❏ Load Balancing (least request, hashing, zone/latency aware)
❏ Communication Resiliency (retries, timeouts, circuit-breaking, rate limiting)
❏ Security (end-to-end encryption, AuthN, AuthZ, ACLs)
❏ Observability (metrics, tracing, alerts, control theory a.k.a. MipsyTipsy)
❏ Routing Control (traffic shifting, mirroring)
❏ API (programmable, K8s CRDs)
❏ Automated Rollouts (canary, blue/green)
❏ Fault Injection (add a timeout or error to test its resiliency)
© 2020 Cingulara, Inc.
Why Use a Service Mesh
❏ Mutual TLS implementation (security both ways)
❏ Put complexity into your framework, not your services
❏ Ephemeral containers moving around a Kubernetes type orchestration system
❏ Hype Engine
❏ “Read it on Twitter”
❏ “Saw it at KubeCon”
IMPORTANT TO NOTE:
❏ Make sure you need it, you can implement it, you can support it
❏ If you are asking “Do I need a service mesh” you may not...
© 2020 Cingulara, Inc.
Where are Service Meshes Used
❏ You see a lot in Kubernetes
❏ Istio (K8s native, Aspen Mesh, Tetrate and Red Hat OpenShift’s)
❏ Linkerd
❏ Kong Kuma
❏ Hashicorp Consul Service Mesh
❏ Used with larger, more complex systems where appropriate
❏ Used to solve those problems as they come up
© 2020 Cingulara, Inc.
NATS Service Discovery
NATS and Service Discovery
© 2020 Cingulara, Inc.
Service Discovery in Service Mesh
❏ Answers the “Hey where are you?”
❏ Think multiple services or microservices
❏ You need to know where each other are
❏ Can call by IP or Name, but you need to
know what that is
❏ Picture to right is from the Istio docs
online
❏ Hint: there is a registry that keeps track
of where the services are
© 2020 Cingulara, Inc.
Service Discovery in NATS
❏ Answers the “Hey where are you?”
❏ Think multiple services or microservices
❏ You do not necessarily need to know
where each other are
❏ What is important is the subject
hierarchy and account/namespace
❏ Crude picture to right is from my article
on medium.com
❏ Hint: we don’t care necessarily WHERE
you are just that you are online
© 2020 Cingulara, Inc.
NATS Security
NATS and Security
© 2020 Cingulara, Inc.
Security in a Service Mesh
❏ End-to-end encryption with mutual TLS
❏ Authentication
❏ Authorization
❏ Access Control
❏ Done in YAML files
❏ Must configure this correctly
❏ Centralized security model
❏ Manages the security certificates for you
© 2020 Cingulara, Inc.
Security in NATS (2.0+)
❏ NKeys
❏ JSON Web Tokens
❏ Operator -- Account -- Users security model
❏ More decentralized
❏ Can run with TLS and certificates -- you must manage
© 2020 Cingulara, Inc.
NATS Metrics
NATS and Tracking Metrics
© 2020 Cingulara, Inc.
Metrics in a Service Mesh
❏ Metrics captured inherently
❏ Success rates, errors,
response times
❏ API to API
❏ Service Mesh components
❏ Kiali
❏ Prometheus and Grafana
© 2020 Cingulara, Inc.
Metrics in NATS
❏ Metrics used with the NATS
Prometheus Exporter
❏ Also starting to show metrics with
2.0+ implementation (Surveyor)
❏ Overall metrics, not per client
❏ Prometheus and Grafana
❏ Personally: recently worked on a
per-client metrics for my application
to show metrics down to the client
level -- up in GH/Cingulara/
© 2020 Cingulara, Inc.
NATS Tracing
NATS and Tracing Messages
© 2020 Cingulara, Inc.
Tracing in a Service Mesh
❏ Tracing calls from API A to B to C and back to see latency and issues
❏ Can use Istio/Envoy to export tracing information, Linkerd to collect and export
❏ Also gives you a topology of your calls
© 2020 Cingulara, Inc.
Tracing in NATS
❏ Reference architecture to use for Tracing
❏ GitHub has not.go and not.java
❏ https://github.com/nats-io/not.go
❏ Setup your Trace structure
❏ Setup your Span structure
❏ Create a binary representation
❏ Put onto the front of your Message.Data
❏ Read it off the Reply/Subscriber on the other end
❏ Keep using your data as required
❏ I have used with C# .NET Core 2.2+ as well
❏ Publish with C#, read subscriber with Golang, still works great
❏ NATS 2.0+ has a monitoring service to show latency
© 2020 Cingulara, Inc.
NATS Load Balancing
NATS and Load Balancing
© 2020 Cingulara, Inc.
Load Balancing in a Service Mesh
❏ 2 or more services are setup as replicas, the mesh can load balance between them
❏ Can do round robin, locality, etc. not just rotate them around
❏ You can weight the routes
© 2020 Cingulara, Inc.
Load Balancing in NATS
❏ Uses Queued Subscriptions, similar to round robin (to me)
❏ Register your client with a queue name, that is the only setup you need
❏ Used with gateways in NATS 2.0 for clusters/superclusters you can have geo-aware
subscriptions
❏ Subscribers “closer” get the information unless there is a network issue (auto-DRP)
❏ Roadmap for NATS to have a weighted load balancer, just not there yet
© 2020 Cingulara, Inc.
NATS Routing Control
NATS and Routing Control
© 2020 Cingulara, Inc.
Routing Control in a Service Mesh
❏ Specifically traffic shifting and mirroring
❏ Mirroring / Shadowing to perform functions on another service/set of services (i.e. testing)
❏ Traffic Shifting is slowly migrating traffic from one to another (think canary)
❏ Typical to service mesh, defined in YAML
© 2020 Cingulara, Inc.
Routing Control in NATS
❏ Mirroring or shadowing can be done
by default based on subscriptions
❏ Subscribe to the subjects or use
wildcards
❏ Permissions, data stores, accounts
have to match
❏ Harder to do with Publishing in a
production environment!
© 2020 Cingulara, Inc.
NATS Service Mesh
Summary
What did we just go over
© 2020 Cingulara, Inc.
NATS Service Mesh Functionality
❏ Inherently has some service mesh functionality
❏ You need to know if you even need a service mesh
❏ You need to test if you need Istio/Linkerd/Kuma/Consul/etc. to solve your issues
© 2020 Cingulara, Inc.
Other Things on NATS Service Mesh
❏ AFAIK…..it can do
❏ Timeouts
❏ Retries
❏ Request/Reply as well as
Pub/Sub
❏ Create a Service Mesh without
Kubernetes as a basis
❏ AFAIK…..it cannot do
❏ Circuit Breaking
© 2020 Cingulara, Inc.
What Else to Read
What else dovetails with this subject
© 2020 Cingulara, Inc.
Other Articles & Areas to Further This
❏ Christian Posta on getting started with a service mesh
https://itnext.io/getting-started-with-a-service-mesh-starts-with-a-gateway-62a470350242
❏ R.I. Pienaar Blog Series on NATS at https://choria.io/blog/post/2020/03/23/nats_patterns_1/
❏ NATS.io blog and online docs
❏ Kevin Hoffman’s blog at
https://medium.com/@KevinHoffman/managing-operator-hierarchies-in-nats-2-0-4977600b699d
❏ Slack https://natsio.slack.com/

Más contenido relacionado

La actualidad más candente

Security and Multi-Tenancy with Apache Pulsar in Yahoo! (Verizon Media) - Pul...
Security and Multi-Tenancy with Apache Pulsar in Yahoo! (Verizon Media) - Pul...Security and Multi-Tenancy with Apache Pulsar in Yahoo! (Verizon Media) - Pul...
Security and Multi-Tenancy with Apache Pulsar in Yahoo! (Verizon Media) - Pul...
StreamNative
 

La actualidad más candente (16)

KubeConEU - NATS Deep Dive
KubeConEU - NATS Deep DiveKubeConEU - NATS Deep Dive
KubeConEU - NATS Deep Dive
 
How Clarifai uses NATS and Kubernetes for Machine Learning
How Clarifai uses NATS and Kubernetes for Machine LearningHow Clarifai uses NATS and Kubernetes for Machine Learning
How Clarifai uses NATS and Kubernetes for Machine Learning
 
NATS for Modern Messaging and Microservices
NATS for Modern Messaging and MicroservicesNATS for Modern Messaging and Microservices
NATS for Modern Messaging and Microservices
 
Simple Solutions for Complex Problems - Boulder Meetup
Simple Solutions for Complex Problems - Boulder MeetupSimple Solutions for Complex Problems - Boulder Meetup
Simple Solutions for Complex Problems - Boulder Meetup
 
NATS: Simple, Secure and Scalable Messaging For the Cloud Native Era
NATS: Simple, Secure and Scalable Messaging For the Cloud Native EraNATS: Simple, Secure and Scalable Messaging For the Cloud Native Era
NATS: Simple, Secure and Scalable Messaging For the Cloud Native Era
 
GopherCon 2017 - Writing Networking Clients in Go: The Design & Implementati...
GopherCon 2017 -  Writing Networking Clients in Go: The Design & Implementati...GopherCon 2017 -  Writing Networking Clients in Go: The Design & Implementati...
GopherCon 2017 - Writing Networking Clients in Go: The Design & Implementati...
 
NATS: Control Flow for Distributed Systems
NATS: Control Flow for Distributed SystemsNATS: Control Flow for Distributed Systems
NATS: Control Flow for Distributed Systems
 
Implementing Microservices with NATS
Implementing Microservices with NATSImplementing Microservices with NATS
Implementing Microservices with NATS
 
Serverless for the Cloud Native Era with Fission
Serverless for the Cloud Native Era with FissionServerless for the Cloud Native Era with Fission
Serverless for the Cloud Native Era with Fission
 
NATS for Rubyists - Tokyo Rubyist Meetup
NATS for Rubyists - Tokyo Rubyist MeetupNATS for Rubyists - Tokyo Rubyist Meetup
NATS for Rubyists - Tokyo Rubyist Meetup
 
NATS: A Central Nervous System for IoT Messaging - Larry McQueary
NATS: A Central Nervous System for IoT Messaging - Larry McQuearyNATS: A Central Nervous System for IoT Messaging - Larry McQueary
NATS: A Central Nervous System for IoT Messaging - Larry McQueary
 
NATS + Docker meetup talk Oct - 2016
NATS + Docker meetup talk Oct - 2016NATS + Docker meetup talk Oct - 2016
NATS + Docker meetup talk Oct - 2016
 
NATS Connector Framework - Boulder Meetup
NATS Connector Framework - Boulder MeetupNATS Connector Framework - Boulder Meetup
NATS Connector Framework - Boulder Meetup
 
How Narvar Uses Pulsar to Power the Post-Purchase Experience - Pulsar Summit ...
How Narvar Uses Pulsar to Power the Post-Purchase Experience - Pulsar Summit ...How Narvar Uses Pulsar to Power the Post-Purchase Experience - Pulsar Summit ...
How Narvar Uses Pulsar to Power the Post-Purchase Experience - Pulsar Summit ...
 
Security and Multi-Tenancy with Apache Pulsar in Yahoo! (Verizon Media) - Pul...
Security and Multi-Tenancy with Apache Pulsar in Yahoo! (Verizon Media) - Pul...Security and Multi-Tenancy with Apache Pulsar in Yahoo! (Verizon Media) - Pul...
Security and Multi-Tenancy with Apache Pulsar in Yahoo! (Verizon Media) - Pul...
 
How Greta uses NATS to revolutionize data distribution on the Internet
How Greta uses NATS to revolutionize data distribution on the InternetHow Greta uses NATS to revolutionize data distribution on the Internet
How Greta uses NATS to revolutionize data distribution on the Internet
 

Similar a NATS Connect Live | NATS as a Service Mesh

Similar a NATS Connect Live | NATS as a Service Mesh (20)

Aspirin as a Service: Using the Cloud to Cure Security Headaches
Aspirin as a Service: Using the Cloud to Cure Security HeadachesAspirin as a Service: Using the Cloud to Cure Security Headaches
Aspirin as a Service: Using the Cloud to Cure Security Headaches
 
Cloud computing intro
Cloud computing introCloud computing intro
Cloud computing intro
 
Pitch Deck Teardown: Netmaker's $2.3M Seed deck
Pitch Deck Teardown: Netmaker's $2.3M Seed deckPitch Deck Teardown: Netmaker's $2.3M Seed deck
Pitch Deck Teardown: Netmaker's $2.3M Seed deck
 
A New Approach to Continuous Monitoring in the Cloud
A New Approach to Continuous Monitoring in the CloudA New Approach to Continuous Monitoring in the Cloud
A New Approach to Continuous Monitoring in the Cloud
 
Live traffic capture and replay in cassandra 4.0
Live traffic capture and replay in cassandra 4.0Live traffic capture and replay in cassandra 4.0
Live traffic capture and replay in cassandra 4.0
 
RethinkConn 2022!
RethinkConn 2022!RethinkConn 2022!
RethinkConn 2022!
 
Istio
IstioIstio
Istio
 
Designing Fault-Tolerant Applications with DataStax Enterprise and Apache Cas...
Designing Fault-Tolerant Applications with DataStax Enterprise and Apache Cas...Designing Fault-Tolerant Applications with DataStax Enterprise and Apache Cas...
Designing Fault-Tolerant Applications with DataStax Enterprise and Apache Cas...
 
Building security from scratch
Building security from scratchBuilding security from scratch
Building security from scratch
 
Cisco + AWS Stronger Security & Greater AWS Adoption
Cisco + AWS Stronger Security & Greater AWS Adoption Cisco + AWS Stronger Security & Greater AWS Adoption
Cisco + AWS Stronger Security & Greater AWS Adoption
 
Distributed Solar Systems at EDF Renewables and AWS IoT: A Natural Fit (PUT30...
Distributed Solar Systems at EDF Renewables and AWS IoT: A Natural Fit (PUT30...Distributed Solar Systems at EDF Renewables and AWS IoT: A Natural Fit (PUT30...
Distributed Solar Systems at EDF Renewables and AWS IoT: A Natural Fit (PUT30...
 
Istio Service Mesh
Istio Service MeshIstio Service Mesh
Istio Service Mesh
 
GDG Cloud Southlake #9 Secure Cloud Networking - Beyond Cloud Boundaries
GDG Cloud Southlake #9 Secure Cloud Networking - Beyond Cloud BoundariesGDG Cloud Southlake #9 Secure Cloud Networking - Beyond Cloud Boundaries
GDG Cloud Southlake #9 Secure Cloud Networking - Beyond Cloud Boundaries
 
JAX London 2019 "Cloud Native Communication: Using an API Gateway and Service...
JAX London 2019 "Cloud Native Communication: Using an API Gateway and Service...JAX London 2019 "Cloud Native Communication: Using an API Gateway and Service...
JAX London 2019 "Cloud Native Communication: Using an API Gateway and Service...
 
Big Data Day LA 2015 - Always-on Ingestion for Data at Scale by Arvind Prabha...
Big Data Day LA 2015 - Always-on Ingestion for Data at Scale by Arvind Prabha...Big Data Day LA 2015 - Always-on Ingestion for Data at Scale by Arvind Prabha...
Big Data Day LA 2015 - Always-on Ingestion for Data at Scale by Arvind Prabha...
 
Infosys Ltd: Performance Tuning - A Key to Successful Cassandra Migration
Infosys Ltd: Performance Tuning - A Key to Successful Cassandra MigrationInfosys Ltd: Performance Tuning - A Key to Successful Cassandra Migration
Infosys Ltd: Performance Tuning - A Key to Successful Cassandra Migration
 
Overcoming the Challenges of Architecting for the Cloud
Overcoming the Challenges of Architecting for the CloudOvercoming the Challenges of Architecting for the Cloud
Overcoming the Challenges of Architecting for the Cloud
 
Webinar: Overcoming the Top Challenges of Recovery to the Cloud
Webinar: Overcoming the Top Challenges of Recovery to the CloudWebinar: Overcoming the Top Challenges of Recovery to the Cloud
Webinar: Overcoming the Top Challenges of Recovery to the Cloud
 
SAS Institute on Changing All Four Tires While Driving an AdTech Engine at Fu...
SAS Institute on Changing All Four Tires While Driving an AdTech Engine at Fu...SAS Institute on Changing All Four Tires While Driving an AdTech Engine at Fu...
SAS Institute on Changing All Four Tires While Driving an AdTech Engine at Fu...
 
Introduction openstack-meetup-nov-28
Introduction openstack-meetup-nov-28Introduction openstack-meetup-nov-28
Introduction openstack-meetup-nov-28
 

Más de NATS

Más de NATS (20)

NATS Connect Live | Serverless on Kubernetes with OpenFaaS & NATS
NATS Connect Live | Serverless on Kubernetes with OpenFaaS & NATSNATS Connect Live | Serverless on Kubernetes with OpenFaaS & NATS
NATS Connect Live | Serverless on Kubernetes with OpenFaaS & NATS
 
NATS Connect Live | SwimOS & NATS
NATS Connect Live | SwimOS & NATSNATS Connect Live | SwimOS & NATS
NATS Connect Live | SwimOS & NATS
 
NATS Connect Live | Pub/Sub on the Power Grid
NATS Connect Live | Pub/Sub on the Power GridNATS Connect Live | Pub/Sub on the Power Grid
NATS Connect Live | Pub/Sub on the Power Grid
 
NATS Connect Live | Distributed Identity & Authorization
NATS Connect Live | Distributed Identity & AuthorizationNATS Connect Live | Distributed Identity & Authorization
NATS Connect Live | Distributed Identity & Authorization
 
NATS Connect Live | Resgate
NATS Connect Live | ResgateNATS Connect Live | Resgate
NATS Connect Live | Resgate
 
NATS Connect Live | NATS & Augmented Reality
NATS Connect Live | NATS & Augmented RealityNATS Connect Live | NATS & Augmented Reality
NATS Connect Live | NATS & Augmented Reality
 
KubeCon NA 2019 Keynote | NATS - Past, Present, and the Future
KubeCon NA 2019 Keynote | NATS - Past, Present, and the FutureKubeCon NA 2019 Keynote | NATS - Past, Present, and the Future
KubeCon NA 2019 Keynote | NATS - Past, Present, and the Future
 
OSCON 2019 | Time to Think Different
OSCON 2019 | Time to Think DifferentOSCON 2019 | Time to Think Different
OSCON 2019 | Time to Think Different
 
Simple, Secure, Scalable Messaging for the Cloud Native Era - AllThingsOpen 2...
Simple, Secure, Scalable Messaging for the Cloud Native Era - AllThingsOpen 2...Simple, Secure, Scalable Messaging for the Cloud Native Era - AllThingsOpen 2...
Simple, Secure, Scalable Messaging for the Cloud Native Era - AllThingsOpen 2...
 
Writing Networking Clients in Go - GopherCon 2017 talk
Writing Networking Clients in Go - GopherCon 2017 talkWriting Networking Clients in Go - GopherCon 2017 talk
Writing Networking Clients in Go - GopherCon 2017 talk
 
NATS vs HTTP for Interservice Communication
NATS vs HTTP for Interservice CommunicationNATS vs HTTP for Interservice Communication
NATS vs HTTP for Interservice Communication
 
Using NATS for Control Flow in Distributed Systems
Using NATS for Control Flow in Distributed SystemsUsing NATS for Control Flow in Distributed Systems
Using NATS for Control Flow in Distributed Systems
 
Integration Patterns for Microservices Architectures
Integration Patterns for Microservices ArchitecturesIntegration Patterns for Microservices Architectures
Integration Patterns for Microservices Architectures
 
Simple Solutions for Complex Problems - Boulder Meetup
Simple Solutions for Complex Problems - Boulder Meetup Simple Solutions for Complex Problems - Boulder Meetup
Simple Solutions for Complex Problems - Boulder Meetup
 
Actor Patterns and NATS - Boulder Meetup
Actor Patterns and NATS - Boulder MeetupActor Patterns and NATS - Boulder Meetup
Actor Patterns and NATS - Boulder Meetup
 
NATS for Modern Messaging and Microservices
NATS for Modern Messaging and Microservices NATS for Modern Messaging and Microservices
NATS for Modern Messaging and Microservices
 
Implementing Microservices with NATS
Implementing Microservices with NATSImplementing Microservices with NATS
Implementing Microservices with NATS
 
Simple and Scalable Microservices: Using NATS with Docker Compose and Swarm
Simple and Scalable Microservices: Using NATS with Docker Compose and Swarm Simple and Scalable Microservices: Using NATS with Docker Compose and Swarm
Simple and Scalable Microservices: Using NATS with Docker Compose and Swarm
 
The Zen of High Performance Messaging with NATS
The Zen of High Performance Messaging with NATS The Zen of High Performance Messaging with NATS
The Zen of High Performance Messaging with NATS
 
How Greta uses NATS to revolutionize data distribution on the Internet
How Greta uses NATS to revolutionize data distribution on the Internet How Greta uses NATS to revolutionize data distribution on the Internet
How Greta uses NATS to revolutionize data distribution on the Internet
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

NATS Connect Live | NATS as a Service Mesh

  • 1. © 2020 Cingulara, Inc. NATS as a Service Mesh Using the power and simplicity of NATS to create a service mesh
  • 2. © 2020 Cingulara, Inc. Table of Contents ■ Define Service Mesh ■ NATS Service Discovery ■ NATS Security ■ NATS Metrics ■ NATS Tracing ■ NATS Load Balancing ■ NATS Routing Control
  • 3. © 2020 Cingulara, Inc. Define Service Mesh What is a Service Mesh, Where would you use it, Why would you use it
  • 4. © 2020 Cingulara, Inc. What is a Service Mesh? ❏ Infrastructure Layer for your applications ❏ Helps with interactions between / among services and microservices ❏ Service Discovery (eventual consistency, distributed caching) ❏ Load Balancing (least request, hashing, zone/latency aware) ❏ Communication Resiliency (retries, timeouts, circuit-breaking, rate limiting) ❏ Security (end-to-end encryption, AuthN, AuthZ, ACLs) ❏ Observability (metrics, tracing, alerts, control theory a.k.a. MipsyTipsy) ❏ Routing Control (traffic shifting, mirroring) ❏ API (programmable, K8s CRDs) ❏ Automated Rollouts (canary, blue/green) ❏ Fault Injection (add a timeout or error to test its resiliency)
  • 5. © 2020 Cingulara, Inc. Why Use a Service Mesh ❏ Mutual TLS implementation (security both ways) ❏ Put complexity into your framework, not your services ❏ Ephemeral containers moving around a Kubernetes type orchestration system ❏ Hype Engine ❏ “Read it on Twitter” ❏ “Saw it at KubeCon” IMPORTANT TO NOTE: ❏ Make sure you need it, you can implement it, you can support it ❏ If you are asking “Do I need a service mesh” you may not...
  • 6. © 2020 Cingulara, Inc. Where are Service Meshes Used ❏ You see a lot in Kubernetes ❏ Istio (K8s native, Aspen Mesh, Tetrate and Red Hat OpenShift’s) ❏ Linkerd ❏ Kong Kuma ❏ Hashicorp Consul Service Mesh ❏ Used with larger, more complex systems where appropriate ❏ Used to solve those problems as they come up
  • 7. © 2020 Cingulara, Inc. NATS Service Discovery NATS and Service Discovery
  • 8. © 2020 Cingulara, Inc. Service Discovery in Service Mesh ❏ Answers the “Hey where are you?” ❏ Think multiple services or microservices ❏ You need to know where each other are ❏ Can call by IP or Name, but you need to know what that is ❏ Picture to right is from the Istio docs online ❏ Hint: there is a registry that keeps track of where the services are
  • 9. © 2020 Cingulara, Inc. Service Discovery in NATS ❏ Answers the “Hey where are you?” ❏ Think multiple services or microservices ❏ You do not necessarily need to know where each other are ❏ What is important is the subject hierarchy and account/namespace ❏ Crude picture to right is from my article on medium.com ❏ Hint: we don’t care necessarily WHERE you are just that you are online
  • 10. © 2020 Cingulara, Inc. NATS Security NATS and Security
  • 11. © 2020 Cingulara, Inc. Security in a Service Mesh ❏ End-to-end encryption with mutual TLS ❏ Authentication ❏ Authorization ❏ Access Control ❏ Done in YAML files ❏ Must configure this correctly ❏ Centralized security model ❏ Manages the security certificates for you
  • 12. © 2020 Cingulara, Inc. Security in NATS (2.0+) ❏ NKeys ❏ JSON Web Tokens ❏ Operator -- Account -- Users security model ❏ More decentralized ❏ Can run with TLS and certificates -- you must manage
  • 13. © 2020 Cingulara, Inc. NATS Metrics NATS and Tracking Metrics
  • 14. © 2020 Cingulara, Inc. Metrics in a Service Mesh ❏ Metrics captured inherently ❏ Success rates, errors, response times ❏ API to API ❏ Service Mesh components ❏ Kiali ❏ Prometheus and Grafana
  • 15. © 2020 Cingulara, Inc. Metrics in NATS ❏ Metrics used with the NATS Prometheus Exporter ❏ Also starting to show metrics with 2.0+ implementation (Surveyor) ❏ Overall metrics, not per client ❏ Prometheus and Grafana ❏ Personally: recently worked on a per-client metrics for my application to show metrics down to the client level -- up in GH/Cingulara/
  • 16. © 2020 Cingulara, Inc. NATS Tracing NATS and Tracing Messages
  • 17. © 2020 Cingulara, Inc. Tracing in a Service Mesh ❏ Tracing calls from API A to B to C and back to see latency and issues ❏ Can use Istio/Envoy to export tracing information, Linkerd to collect and export ❏ Also gives you a topology of your calls
  • 18. © 2020 Cingulara, Inc. Tracing in NATS ❏ Reference architecture to use for Tracing ❏ GitHub has not.go and not.java ❏ https://github.com/nats-io/not.go ❏ Setup your Trace structure ❏ Setup your Span structure ❏ Create a binary representation ❏ Put onto the front of your Message.Data ❏ Read it off the Reply/Subscriber on the other end ❏ Keep using your data as required ❏ I have used with C# .NET Core 2.2+ as well ❏ Publish with C#, read subscriber with Golang, still works great ❏ NATS 2.0+ has a monitoring service to show latency
  • 19. © 2020 Cingulara, Inc. NATS Load Balancing NATS and Load Balancing
  • 20. © 2020 Cingulara, Inc. Load Balancing in a Service Mesh ❏ 2 or more services are setup as replicas, the mesh can load balance between them ❏ Can do round robin, locality, etc. not just rotate them around ❏ You can weight the routes
  • 21. © 2020 Cingulara, Inc. Load Balancing in NATS ❏ Uses Queued Subscriptions, similar to round robin (to me) ❏ Register your client with a queue name, that is the only setup you need ❏ Used with gateways in NATS 2.0 for clusters/superclusters you can have geo-aware subscriptions ❏ Subscribers “closer” get the information unless there is a network issue (auto-DRP) ❏ Roadmap for NATS to have a weighted load balancer, just not there yet
  • 22. © 2020 Cingulara, Inc. NATS Routing Control NATS and Routing Control
  • 23. © 2020 Cingulara, Inc. Routing Control in a Service Mesh ❏ Specifically traffic shifting and mirroring ❏ Mirroring / Shadowing to perform functions on another service/set of services (i.e. testing) ❏ Traffic Shifting is slowly migrating traffic from one to another (think canary) ❏ Typical to service mesh, defined in YAML
  • 24. © 2020 Cingulara, Inc. Routing Control in NATS ❏ Mirroring or shadowing can be done by default based on subscriptions ❏ Subscribe to the subjects or use wildcards ❏ Permissions, data stores, accounts have to match ❏ Harder to do with Publishing in a production environment!
  • 25. © 2020 Cingulara, Inc. NATS Service Mesh Summary What did we just go over
  • 26. © 2020 Cingulara, Inc. NATS Service Mesh Functionality ❏ Inherently has some service mesh functionality ❏ You need to know if you even need a service mesh ❏ You need to test if you need Istio/Linkerd/Kuma/Consul/etc. to solve your issues
  • 27. © 2020 Cingulara, Inc. Other Things on NATS Service Mesh ❏ AFAIK…..it can do ❏ Timeouts ❏ Retries ❏ Request/Reply as well as Pub/Sub ❏ Create a Service Mesh without Kubernetes as a basis ❏ AFAIK…..it cannot do ❏ Circuit Breaking
  • 28. © 2020 Cingulara, Inc. What Else to Read What else dovetails with this subject
  • 29. © 2020 Cingulara, Inc. Other Articles & Areas to Further This ❏ Christian Posta on getting started with a service mesh https://itnext.io/getting-started-with-a-service-mesh-starts-with-a-gateway-62a470350242 ❏ R.I. Pienaar Blog Series on NATS at https://choria.io/blog/post/2020/03/23/nats_patterns_1/ ❏ NATS.io blog and online docs ❏ Kevin Hoffman’s blog at https://medium.com/@KevinHoffman/managing-operator-hierarchies-in-nats-2-0-4977600b699d ❏ Slack https://natsio.slack.com/