SlideShare una empresa de Scribd logo
1 de 31
© 2018 Google LLC. All rights reserved.
How i learned to stop worrying and learned to love the mesh
Microservices on GCP
The information, scoping, and pricing data in this presentation is for evaluation/discussion purposes only and is non-binding. For reference purposes,
Google's standard terms and conditions for professional services are located at: https://enterprise.google.com/terms/professional-services.html.
https://github.com/salrashid123
https://medium.com/@salmaan.rashid/
© 2018 Google LLC. All rights reserved.
Topic
s
Microservices on GCP1
Your Utility Belt2
Service Mesh3
Demo4
Microserves on GCP
Motivation to use a service mesh
© 2018 Google LLC. All rights reserved.
● Rapid release cycle
● "Data ownership"
● Single Responsibility
● Discovery, bootstrapping
● Rate Control
● Security
○ Identity, connectivity
● Observability
● Independent/decoupled
...Microservices
© 2018 Google LLC. All rights reserved.
chaos, connectivity, and clarity
© 2018 Google LLC. All rights reserved.
● Cloud Run
○ Managed; 0->N->0
○ Automatic Auth, IAM
● Cloud Functions
○ Managed; 0->N->0
○ Automatic Auth, IAM
● App Engine (original flavor)
○ Managed; 0->N->0
○ Automatic Auth
● GKE
○ well..GKE is managed
○ Your app needs some assembly
choices, choices
● GKE+Istio
○ Helps with management
● GKE+Istio+Knative
○ Helps even more (too alpha)
● Cloud Services Platform
○ All inclusive vacation
● Provided Services
○ Cloud Scheduler (cron)
○ Cloud Tasks
○ Pub/Sub
Your Utility Belt
● Cloud Logging
○ Structured (jsonPayload, protoPayload)
○ Unstructured (textPayload)
● Container Logs
○ just write to stdout/stderr 😊
○ Write via Logging API 😞*
○ Log grouped by resource type, source
○ gke_cluster, pod, container
● Request->Log correlation
○ "parent->child"
● Logs to Metrics
○ User defined alertable metric derived
from logs
log.Printf("Found ENV lookup backend ip: %v port: %vn",
backendHost, backendPort)
Logging
● What can you monitor?
● Application Monitoring
○ Your app metrics, request metrics
● System Monitoring:
○ GKE (cluster, node), Loadbalancer, GCE (VM),
GAE
● Built in Metric by type: eg: a Cloud Run requests
○ "type": "run.googleapis.com/request_count",
○ Metric shows each request
○ How do you break down requests by its
response_code? Use its Metric Labels to filter
● Labels
○ Filter subset (eg, "response code=500, for
route=66")
Monitoring
{
"name": "projects//metricDescriptors/run.googleapis.com/request_count",
"labels": [
{
"key": "response_code",
"description": "Response code of a request."
},
{
"key": "response_code_class",
"description": "Response code class of a request."
},
{
"key": "route",
"description": "Route name that forwards a request."
}
],
"metricKind": "DELTA",
"valueType": "INT64",
"unit": "1",
"description": "Number of requests reaching the revision.",
"displayName": "Request Count",
"type": "run.googleapis.com/request_count",
}
● What do you want to monitor?
● Service Level (Objectives | Indicator| Agreement)
○ SLI: measure metrics for user happiness :)
○ SLO: SLI + target goal over window
○ ↑ (SLO) →more﹩to operate
○ SLA: lawyer stuff
○ SRE Fundamentals
● Setup a Dashboard
● Setup Alerts based on Dashboard/SL*
○ PagerDuty,Email, Phone, Slack, etc
● Incident Dashboard to ACK/Resolve/Track
● UptimeChecks:
○ Send HTTP requests to your external IP
○ Check latency, response_code from
datacenters around the world!
Monitoring + Alerts ● Creating Dashboard with Istio+Stackdriver
Create a monitoring dashboard
1. Head over to Stackdriver Monitoring and create a Stackdriver Workspace.
2. Navigate to Dashboards > Create Dashboard in the left sidebar.
3. In the new Dashboard, click Add Chart and the following metric:
● Metric: Server Response Latencies
(istio.io/service/server/response_latencies)
● Group By: destination_workload_name
● Aligner: 50th percentile
● Reducer: mean
● Alignment Period: 1 minute
● Type: Line
● Trace a HTTP/gRPC request end-to-end*
○ User → yourService
○ yourService → yourOtherService
○ yourService → GCP APIs
● Trace _WITHIN_ a GCP request:
○ What went on within the GCP API request
○ What query did my spanner system invoke and
how long did it take?
● Make it generic!
○ OpenCensus: run it anywhere, add you own
tracers (sample helloworld in reference section!)
Tracing
● Need to use Logging API to traces and logs
together :(
● Trick is to embed the parent traceID as the
"trace" field.
ctx := span.SpanContext()
tr := ctx.TraceID.String()
lg := client.Logger("spannerlab")
trace := fmt.Sprintf("projects/%s/traces/%s", projectId, tr)
lg.Log(logging.Entry{
Severity: severity,
Payload: fmt.Sprintf(format, v...),
Trace: trace,
SpanID:
ctx.SpanID.String(),
})
Tracing+Logging
● Live Heap, CPU, Thread info
● Collects metrics and emits to GCP
● Memory issues, CPU, etc
● Stackdriver CPU statistics and Profiler: identify
over/under provisioned systems.
● Profile and iterate code; use traffic splitting to A/B test!
Profiling
● Live Debug of your running app
● Does NOT _stop_ your application at a breakpoint (just
not how it works!)
● Observe parameters at any breakpoint given a
reference to the source code (on github, Cloud Repo,
bitbucket).
● Insert log parameters for propagation.
● Need to start application as instrumented; do not
enable by default! (only canary/test with small% traffic)
● Observe parameters at any breakpoint given a
reference to the source code (on github, Cloud Repo,
bitbucket).
● Java, Python :) .... golang :(
Debug
Service mesh overview
Motivation to use a service mesh
© 2018 Google LLC. All rights reserved.
● Maintaining resilience, discovery, and routing logic in code for independent services written in different
languages becomes incredibly complex and expensive to operate
● The role of a service mesh is to overlay your services with a management framework
Microservices create API management challenges
© 2018 Google LLC. All rights reserved.
routing/traffic shaping
advanced load balancing
service discovery
circuit breaking
timeouts/retries
rate limiting
metrics/logging/tracing
fault injection
A service mesh differs from an
edge/API service in that a service
mesh is an infrastructure built for
service-to-service communication
and resiliency with zero business
logic
Service mesh features
How to manage all this?
Which version?
Version 2.0
Which instance?
Service to Service Communication
Service
(Caller)
Service
(Provider)
Quota Exhausted?
Authorized?
Wait for response?
Retry on Failure?
Secure?
Who’s calling?
Version 1.0
Without changing the service implementation!
Are my services
healthy?
Service Management
Service
(Caller)
Service
(Provider)
Proxy Proxy
Lookup
Routing
Timeout
Circuit Breaker
Policy Enforcement
TLS Termination
ThrottlingIn Out In Out
Service proxies intercept outbound and inbound service calls transparent to the service implementation.
The outbound proxy manages routing and error handling strategies, such as retries and circuit breakers.
The inbound proxy validates the service call based on credentials, available quota etc.
Management & Configuration
© 2018 Google LLC. All rights reserved.
A service mesh architecture is comprised
of two parts:
Control plane — configures the service
proxies and manages the mesh
Data plane — acts as a service proxy and
communicates service behavior back to the
control plane
Service
container
Service proxy
container
Service
container
Service proxy
container
Kubernetes cluster
Pod Pod
Pods/Containers
Control plane
Data plane
Service mesh
conceptual overview
© 2018 Google LLC. All rights reserved.
Istio — Overview *click*
© 2018 Google LLC. All rights reserved.
Istio — Overview *2x click*
© 2018 Google LLC. All rights reserved.
Istio — Overview *3x click*
© 2018 Google LLC. All rights reserved.
● Stackdriver — Metrics - Prometheus
● Stackdriver — Logging - Mixer, Fluentd
● Stackdriver — Tracing - Jaeger
● Stackdriver — Debugging
● Stackdriver — Topology - Kiali
* or..bring your own
Monitor Istio
with GCP*
Service Proxy
Container
Bookinfo
Service
Container
Service
Container
Bookinfo
Service
Container
Kubernetes Engine
Pod Pod
istio-mixer
Istio Control Plane
Data Plane
Prometheus/Grafana
Metrics
Zipkin
Traces
Stackdriver
Telemetry reports
Demos
© 2018 Google LLC. All rights reserved.
HelloWorld: https://35.224.11.70/
● Simple, frontend->backend
● No Cloud Service Mesh
● Progressive traffic splitting
● Fault Injection
● Tracing
● Profiling
● Logging
● Monitoring
● Turn to page 27
HipsterShop: http://35.222.251.20/
● Complex, frontend>?->?->?
● Cloud Services Mesh Monitoring
● Cloud Services Mesh Topology
● Tracing
● Monitoring
● Logging
● Turn to page 28
choose your own adventure
© 2018 Google LLC. All rights reserved.
HelloWorld: https://35.224.11.70/
● fe: frontend (v1|v2)
● be: backend (v1|v2)
○ v2 has built in 1000ms latency
● Routing/Splitting
○ user-> fe(v1)
○ user->fe(v1)->be(v1)
○ user->fe(v1|v2)->be(v1)
○ user->fe(v1|v2)->be(v1|v2)
● Logging
○ JSON Struct logging
● Monitoring
○ Response Rates
● Tracing: End-to-end Tracing
● Error: Custom Errors
● Profiler: CPU, HEAP
● Debugger: no-golang :(
HelloWorld!
© 2018 Google LLC. All rights reserved.
HipsterShop: http://35.222.251.20/
● Sorry, out of stock
Hipstershop
That’s a wrap.
Appendix
© 2018 Google LLC. All rights reserved.
● Using Stackdriver* with golang on istio.
● "Hipstershop"
● Google Cloud Trace context propagation and metrics graphs with
Grafana+Prometheus and Stackdriver
● SRE Fundamentals
Stuff for reference

Más contenido relacionado

Más de Grid Dynamics

"Trends in Building Advanced Analytics Platform for Large Enterprises" - Atul...
"Trends in Building Advanced Analytics Platform for Large Enterprises" - Atul..."Trends in Building Advanced Analytics Platform for Large Enterprises" - Atul...
"Trends in Building Advanced Analytics Platform for Large Enterprises" - Atul...Grid Dynamics
 
The New Era of Public Safety Records Management: Dynamic talks Chicago 9/24/2019
The New Era of Public Safety Records Management: Dynamic talks Chicago 9/24/2019The New Era of Public Safety Records Management: Dynamic talks Chicago 9/24/2019
The New Era of Public Safety Records Management: Dynamic talks Chicago 9/24/2019Grid Dynamics
 
Dynamic Talks: "Implementing data quality automation with open source stack" ...
Dynamic Talks: "Implementing data quality automation with open source stack" ...Dynamic Talks: "Implementing data quality automation with open source stack" ...
Dynamic Talks: "Implementing data quality automation with open source stack" ...Grid Dynamics
 
"Implementing AI for New Business Models and Efficiencies" - Parag Shrivastav...
"Implementing AI for New Business Models and Efficiencies" - Parag Shrivastav..."Implementing AI for New Business Models and Efficiencies" - Parag Shrivastav...
"Implementing AI for New Business Models and Efficiencies" - Parag Shrivastav...Grid Dynamics
 
Reducing No-shows and Late Cancelations in Healthcare Enterprise" - Shervin M...
Reducing No-shows and Late Cancelations in Healthcare Enterprise" - Shervin M...Reducing No-shows and Late Cancelations in Healthcare Enterprise" - Shervin M...
Reducing No-shows and Late Cancelations in Healthcare Enterprise" - Shervin M...Grid Dynamics
 
Customer intelligence: a Machine Learning Approach: Dynamic talks Atlanta 8/2...
Customer intelligence: a Machine Learning Approach: Dynamic talks Atlanta 8/2...Customer intelligence: a Machine Learning Approach: Dynamic talks Atlanta 8/2...
Customer intelligence: a Machine Learning Approach: Dynamic talks Atlanta 8/2...Grid Dynamics
 
"ML Services - How do you begin and when do you start scaling?" - Madhura Dud...
"ML Services - How do you begin and when do you start scaling?" - Madhura Dud..."ML Services - How do you begin and when do you start scaling?" - Madhura Dud...
"ML Services - How do you begin and when do you start scaling?" - Madhura Dud...Grid Dynamics
 
Realtime Contextual Product Recommendations…that scale and generate revenue -...
Realtime Contextual Product Recommendations…that scale and generate revenue -...Realtime Contextual Product Recommendations…that scale and generate revenue -...
Realtime Contextual Product Recommendations…that scale and generate revenue -...Grid Dynamics
 
Decision Automation in Marketing Systems using Reinforcement Learning: Dynami...
Decision Automation in Marketing Systems using Reinforcement Learning: Dynami...Decision Automation in Marketing Systems using Reinforcement Learning: Dynami...
Decision Automation in Marketing Systems using Reinforcement Learning: Dynami...Grid Dynamics
 
Best practices for enterprise-grade microservices implementations with Google...
Best practices for enterprise-grade microservices implementations with Google...Best practices for enterprise-grade microservices implementations with Google...
Best practices for enterprise-grade microservices implementations with Google...Grid Dynamics
 
Attribution Modelling 101: Credit Where Credit is Due!: Dynamic talks Seattle...
Attribution Modelling 101: Credit Where Credit is Due!: Dynamic talks Seattle...Attribution Modelling 101: Credit Where Credit is Due!: Dynamic talks Seattle...
Attribution Modelling 101: Credit Where Credit is Due!: Dynamic talks Seattle...Grid Dynamics
 
Building an algorithmic price management system using ML: Dynamic talks Seatt...
Building an algorithmic price management system using ML: Dynamic talks Seatt...Building an algorithmic price management system using ML: Dynamic talks Seatt...
Building an algorithmic price management system using ML: Dynamic talks Seatt...Grid Dynamics
 
Customer intelligence: a machine learning approach- Dynamic talks Dallas Q2
Customer intelligence: a machine learning approach- Dynamic talks Dallas Q2 Customer intelligence: a machine learning approach- Dynamic talks Dallas Q2
Customer intelligence: a machine learning approach- Dynamic talks Dallas Q2 Grid Dynamics
 
Improving Customer Experience via Experimentation Dynamic Talks: San Francisc...
Improving Customer Experience via Experimentation Dynamic Talks: San Francisc...Improving Customer Experience via Experimentation Dynamic Talks: San Francisc...
Improving Customer Experience via Experimentation Dynamic Talks: San Francisc...Grid Dynamics
 
Customer intelligence: a machine learning approach 5/21/2019
Customer intelligence: a machine learning approach 5/21/2019Customer intelligence: a machine learning approach 5/21/2019
Customer intelligence: a machine learning approach 5/21/2019Grid Dynamics
 
Cloud and microservices on the enterprise level: Dynamic Talks Portland 5/16/...
Cloud and microservices on the enterprise level: Dynamic Talks Portland 5/16/...Cloud and microservices on the enterprise level: Dynamic Talks Portland 5/16/...
Cloud and microservices on the enterprise level: Dynamic Talks Portland 5/16/...Grid Dynamics
 
Dialogflow Chat Experiences Best Practices for Intent Detection // Measuring ...
Dialogflow Chat Experiences Best Practices for Intent Detection // Measuring ...Dialogflow Chat Experiences Best Practices for Intent Detection // Measuring ...
Dialogflow Chat Experiences Best Practices for Intent Detection // Measuring ...Grid Dynamics
 
Conversational commerce: emerging architectures for smart & useful chatbots -...
Conversational commerce: emerging architectures for smart & useful chatbots -...Conversational commerce: emerging architectures for smart & useful chatbots -...
Conversational commerce: emerging architectures for smart & useful chatbots -...Grid Dynamics
 
Conversational commerce: emerging architectures for smart & useful chatbots -...
Conversational commerce: emerging architectures for smart & useful chatbots -...Conversational commerce: emerging architectures for smart & useful chatbots -...
Conversational commerce: emerging architectures for smart & useful chatbots -...Grid Dynamics
 
MPL: modular pipeline library - Dynamic Talks Milwaukee 4/11/2019
MPL: modular pipeline library - Dynamic Talks Milwaukee 4/11/2019MPL: modular pipeline library - Dynamic Talks Milwaukee 4/11/2019
MPL: modular pipeline library - Dynamic Talks Milwaukee 4/11/2019Grid Dynamics
 

Más de Grid Dynamics (20)

"Trends in Building Advanced Analytics Platform for Large Enterprises" - Atul...
"Trends in Building Advanced Analytics Platform for Large Enterprises" - Atul..."Trends in Building Advanced Analytics Platform for Large Enterprises" - Atul...
"Trends in Building Advanced Analytics Platform for Large Enterprises" - Atul...
 
The New Era of Public Safety Records Management: Dynamic talks Chicago 9/24/2019
The New Era of Public Safety Records Management: Dynamic talks Chicago 9/24/2019The New Era of Public Safety Records Management: Dynamic talks Chicago 9/24/2019
The New Era of Public Safety Records Management: Dynamic talks Chicago 9/24/2019
 
Dynamic Talks: "Implementing data quality automation with open source stack" ...
Dynamic Talks: "Implementing data quality automation with open source stack" ...Dynamic Talks: "Implementing data quality automation with open source stack" ...
Dynamic Talks: "Implementing data quality automation with open source stack" ...
 
"Implementing AI for New Business Models and Efficiencies" - Parag Shrivastav...
"Implementing AI for New Business Models and Efficiencies" - Parag Shrivastav..."Implementing AI for New Business Models and Efficiencies" - Parag Shrivastav...
"Implementing AI for New Business Models and Efficiencies" - Parag Shrivastav...
 
Reducing No-shows and Late Cancelations in Healthcare Enterprise" - Shervin M...
Reducing No-shows and Late Cancelations in Healthcare Enterprise" - Shervin M...Reducing No-shows and Late Cancelations in Healthcare Enterprise" - Shervin M...
Reducing No-shows and Late Cancelations in Healthcare Enterprise" - Shervin M...
 
Customer intelligence: a Machine Learning Approach: Dynamic talks Atlanta 8/2...
Customer intelligence: a Machine Learning Approach: Dynamic talks Atlanta 8/2...Customer intelligence: a Machine Learning Approach: Dynamic talks Atlanta 8/2...
Customer intelligence: a Machine Learning Approach: Dynamic talks Atlanta 8/2...
 
"ML Services - How do you begin and when do you start scaling?" - Madhura Dud...
"ML Services - How do you begin and when do you start scaling?" - Madhura Dud..."ML Services - How do you begin and when do you start scaling?" - Madhura Dud...
"ML Services - How do you begin and when do you start scaling?" - Madhura Dud...
 
Realtime Contextual Product Recommendations…that scale and generate revenue -...
Realtime Contextual Product Recommendations…that scale and generate revenue -...Realtime Contextual Product Recommendations…that scale and generate revenue -...
Realtime Contextual Product Recommendations…that scale and generate revenue -...
 
Decision Automation in Marketing Systems using Reinforcement Learning: Dynami...
Decision Automation in Marketing Systems using Reinforcement Learning: Dynami...Decision Automation in Marketing Systems using Reinforcement Learning: Dynami...
Decision Automation in Marketing Systems using Reinforcement Learning: Dynami...
 
Best practices for enterprise-grade microservices implementations with Google...
Best practices for enterprise-grade microservices implementations with Google...Best practices for enterprise-grade microservices implementations with Google...
Best practices for enterprise-grade microservices implementations with Google...
 
Attribution Modelling 101: Credit Where Credit is Due!: Dynamic talks Seattle...
Attribution Modelling 101: Credit Where Credit is Due!: Dynamic talks Seattle...Attribution Modelling 101: Credit Where Credit is Due!: Dynamic talks Seattle...
Attribution Modelling 101: Credit Where Credit is Due!: Dynamic talks Seattle...
 
Building an algorithmic price management system using ML: Dynamic talks Seatt...
Building an algorithmic price management system using ML: Dynamic talks Seatt...Building an algorithmic price management system using ML: Dynamic talks Seatt...
Building an algorithmic price management system using ML: Dynamic talks Seatt...
 
Customer intelligence: a machine learning approach- Dynamic talks Dallas Q2
Customer intelligence: a machine learning approach- Dynamic talks Dallas Q2 Customer intelligence: a machine learning approach- Dynamic talks Dallas Q2
Customer intelligence: a machine learning approach- Dynamic talks Dallas Q2
 
Improving Customer Experience via Experimentation Dynamic Talks: San Francisc...
Improving Customer Experience via Experimentation Dynamic Talks: San Francisc...Improving Customer Experience via Experimentation Dynamic Talks: San Francisc...
Improving Customer Experience via Experimentation Dynamic Talks: San Francisc...
 
Customer intelligence: a machine learning approach 5/21/2019
Customer intelligence: a machine learning approach 5/21/2019Customer intelligence: a machine learning approach 5/21/2019
Customer intelligence: a machine learning approach 5/21/2019
 
Cloud and microservices on the enterprise level: Dynamic Talks Portland 5/16/...
Cloud and microservices on the enterprise level: Dynamic Talks Portland 5/16/...Cloud and microservices on the enterprise level: Dynamic Talks Portland 5/16/...
Cloud and microservices on the enterprise level: Dynamic Talks Portland 5/16/...
 
Dialogflow Chat Experiences Best Practices for Intent Detection // Measuring ...
Dialogflow Chat Experiences Best Practices for Intent Detection // Measuring ...Dialogflow Chat Experiences Best Practices for Intent Detection // Measuring ...
Dialogflow Chat Experiences Best Practices for Intent Detection // Measuring ...
 
Conversational commerce: emerging architectures for smart & useful chatbots -...
Conversational commerce: emerging architectures for smart & useful chatbots -...Conversational commerce: emerging architectures for smart & useful chatbots -...
Conversational commerce: emerging architectures for smart & useful chatbots -...
 
Conversational commerce: emerging architectures for smart & useful chatbots -...
Conversational commerce: emerging architectures for smart & useful chatbots -...Conversational commerce: emerging architectures for smart & useful chatbots -...
Conversational commerce: emerging architectures for smart & useful chatbots -...
 
MPL: modular pipeline library - Dynamic Talks Milwaukee 4/11/2019
MPL: modular pipeline library - Dynamic Talks Milwaukee 4/11/2019MPL: modular pipeline library - Dynamic Talks Milwaukee 4/11/2019
MPL: modular pipeline library - Dynamic Talks Milwaukee 4/11/2019
 

Último

Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
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 businesspanagenda
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
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 WorkerThousandEyes
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
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 challengesrafiqahmad00786416
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
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, ...apidays
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 

Último (20)

Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
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
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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 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, ...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

"Google Cloud and Microservices - a practical approach on GCP" - Salmaan Rashid

  • 1. © 2018 Google LLC. All rights reserved. How i learned to stop worrying and learned to love the mesh Microservices on GCP The information, scoping, and pricing data in this presentation is for evaluation/discussion purposes only and is non-binding. For reference purposes, Google's standard terms and conditions for professional services are located at: https://enterprise.google.com/terms/professional-services.html. https://github.com/salrashid123 https://medium.com/@salmaan.rashid/
  • 2. © 2018 Google LLC. All rights reserved. Topic s Microservices on GCP1 Your Utility Belt2 Service Mesh3 Demo4
  • 3. Microserves on GCP Motivation to use a service mesh
  • 4. © 2018 Google LLC. All rights reserved. ● Rapid release cycle ● "Data ownership" ● Single Responsibility ● Discovery, bootstrapping ● Rate Control ● Security ○ Identity, connectivity ● Observability ● Independent/decoupled ...Microservices
  • 5. © 2018 Google LLC. All rights reserved. chaos, connectivity, and clarity
  • 6. © 2018 Google LLC. All rights reserved. ● Cloud Run ○ Managed; 0->N->0 ○ Automatic Auth, IAM ● Cloud Functions ○ Managed; 0->N->0 ○ Automatic Auth, IAM ● App Engine (original flavor) ○ Managed; 0->N->0 ○ Automatic Auth ● GKE ○ well..GKE is managed ○ Your app needs some assembly choices, choices ● GKE+Istio ○ Helps with management ● GKE+Istio+Knative ○ Helps even more (too alpha) ● Cloud Services Platform ○ All inclusive vacation ● Provided Services ○ Cloud Scheduler (cron) ○ Cloud Tasks ○ Pub/Sub
  • 8. ● Cloud Logging ○ Structured (jsonPayload, protoPayload) ○ Unstructured (textPayload) ● Container Logs ○ just write to stdout/stderr 😊 ○ Write via Logging API 😞* ○ Log grouped by resource type, source ○ gke_cluster, pod, container ● Request->Log correlation ○ "parent->child" ● Logs to Metrics ○ User defined alertable metric derived from logs log.Printf("Found ENV lookup backend ip: %v port: %vn", backendHost, backendPort) Logging
  • 9. ● What can you monitor? ● Application Monitoring ○ Your app metrics, request metrics ● System Monitoring: ○ GKE (cluster, node), Loadbalancer, GCE (VM), GAE ● Built in Metric by type: eg: a Cloud Run requests ○ "type": "run.googleapis.com/request_count", ○ Metric shows each request ○ How do you break down requests by its response_code? Use its Metric Labels to filter ● Labels ○ Filter subset (eg, "response code=500, for route=66") Monitoring { "name": "projects//metricDescriptors/run.googleapis.com/request_count", "labels": [ { "key": "response_code", "description": "Response code of a request." }, { "key": "response_code_class", "description": "Response code class of a request." }, { "key": "route", "description": "Route name that forwards a request." } ], "metricKind": "DELTA", "valueType": "INT64", "unit": "1", "description": "Number of requests reaching the revision.", "displayName": "Request Count", "type": "run.googleapis.com/request_count", }
  • 10. ● What do you want to monitor? ● Service Level (Objectives | Indicator| Agreement) ○ SLI: measure metrics for user happiness :) ○ SLO: SLI + target goal over window ○ ↑ (SLO) →more﹩to operate ○ SLA: lawyer stuff ○ SRE Fundamentals ● Setup a Dashboard ● Setup Alerts based on Dashboard/SL* ○ PagerDuty,Email, Phone, Slack, etc ● Incident Dashboard to ACK/Resolve/Track ● UptimeChecks: ○ Send HTTP requests to your external IP ○ Check latency, response_code from datacenters around the world! Monitoring + Alerts ● Creating Dashboard with Istio+Stackdriver Create a monitoring dashboard 1. Head over to Stackdriver Monitoring and create a Stackdriver Workspace. 2. Navigate to Dashboards > Create Dashboard in the left sidebar. 3. In the new Dashboard, click Add Chart and the following metric: ● Metric: Server Response Latencies (istio.io/service/server/response_latencies) ● Group By: destination_workload_name ● Aligner: 50th percentile ● Reducer: mean ● Alignment Period: 1 minute ● Type: Line
  • 11. ● Trace a HTTP/gRPC request end-to-end* ○ User → yourService ○ yourService → yourOtherService ○ yourService → GCP APIs ● Trace _WITHIN_ a GCP request: ○ What went on within the GCP API request ○ What query did my spanner system invoke and how long did it take? ● Make it generic! ○ OpenCensus: run it anywhere, add you own tracers (sample helloworld in reference section!) Tracing
  • 12. ● Need to use Logging API to traces and logs together :( ● Trick is to embed the parent traceID as the "trace" field. ctx := span.SpanContext() tr := ctx.TraceID.String() lg := client.Logger("spannerlab") trace := fmt.Sprintf("projects/%s/traces/%s", projectId, tr) lg.Log(logging.Entry{ Severity: severity, Payload: fmt.Sprintf(format, v...), Trace: trace, SpanID: ctx.SpanID.String(), }) Tracing+Logging
  • 13. ● Live Heap, CPU, Thread info ● Collects metrics and emits to GCP ● Memory issues, CPU, etc ● Stackdriver CPU statistics and Profiler: identify over/under provisioned systems. ● Profile and iterate code; use traffic splitting to A/B test! Profiling
  • 14. ● Live Debug of your running app ● Does NOT _stop_ your application at a breakpoint (just not how it works!) ● Observe parameters at any breakpoint given a reference to the source code (on github, Cloud Repo, bitbucket). ● Insert log parameters for propagation. ● Need to start application as instrumented; do not enable by default! (only canary/test with small% traffic) ● Observe parameters at any breakpoint given a reference to the source code (on github, Cloud Repo, bitbucket). ● Java, Python :) .... golang :( Debug
  • 15. Service mesh overview Motivation to use a service mesh
  • 16. © 2018 Google LLC. All rights reserved. ● Maintaining resilience, discovery, and routing logic in code for independent services written in different languages becomes incredibly complex and expensive to operate ● The role of a service mesh is to overlay your services with a management framework Microservices create API management challenges
  • 17. © 2018 Google LLC. All rights reserved. routing/traffic shaping advanced load balancing service discovery circuit breaking timeouts/retries rate limiting metrics/logging/tracing fault injection A service mesh differs from an edge/API service in that a service mesh is an infrastructure built for service-to-service communication and resiliency with zero business logic Service mesh features
  • 18. How to manage all this? Which version? Version 2.0 Which instance? Service to Service Communication Service (Caller) Service (Provider) Quota Exhausted? Authorized? Wait for response? Retry on Failure? Secure? Who’s calling? Version 1.0 Without changing the service implementation! Are my services healthy?
  • 19. Service Management Service (Caller) Service (Provider) Proxy Proxy Lookup Routing Timeout Circuit Breaker Policy Enforcement TLS Termination ThrottlingIn Out In Out Service proxies intercept outbound and inbound service calls transparent to the service implementation. The outbound proxy manages routing and error handling strategies, such as retries and circuit breakers. The inbound proxy validates the service call based on credentials, available quota etc. Management & Configuration
  • 20. © 2018 Google LLC. All rights reserved. A service mesh architecture is comprised of two parts: Control plane — configures the service proxies and manages the mesh Data plane — acts as a service proxy and communicates service behavior back to the control plane Service container Service proxy container Service container Service proxy container Kubernetes cluster Pod Pod Pods/Containers Control plane Data plane Service mesh conceptual overview
  • 21. © 2018 Google LLC. All rights reserved. Istio — Overview *click*
  • 22. © 2018 Google LLC. All rights reserved. Istio — Overview *2x click*
  • 23. © 2018 Google LLC. All rights reserved. Istio — Overview *3x click*
  • 24. © 2018 Google LLC. All rights reserved. ● Stackdriver — Metrics - Prometheus ● Stackdriver — Logging - Mixer, Fluentd ● Stackdriver — Tracing - Jaeger ● Stackdriver — Debugging ● Stackdriver — Topology - Kiali * or..bring your own Monitor Istio with GCP* Service Proxy Container Bookinfo Service Container Service Container Bookinfo Service Container Kubernetes Engine Pod Pod istio-mixer Istio Control Plane Data Plane Prometheus/Grafana Metrics Zipkin Traces Stackdriver Telemetry reports
  • 25. Demos
  • 26. © 2018 Google LLC. All rights reserved. HelloWorld: https://35.224.11.70/ ● Simple, frontend->backend ● No Cloud Service Mesh ● Progressive traffic splitting ● Fault Injection ● Tracing ● Profiling ● Logging ● Monitoring ● Turn to page 27 HipsterShop: http://35.222.251.20/ ● Complex, frontend>?->?->? ● Cloud Services Mesh Monitoring ● Cloud Services Mesh Topology ● Tracing ● Monitoring ● Logging ● Turn to page 28 choose your own adventure
  • 27. © 2018 Google LLC. All rights reserved. HelloWorld: https://35.224.11.70/ ● fe: frontend (v1|v2) ● be: backend (v1|v2) ○ v2 has built in 1000ms latency ● Routing/Splitting ○ user-> fe(v1) ○ user->fe(v1)->be(v1) ○ user->fe(v1|v2)->be(v1) ○ user->fe(v1|v2)->be(v1|v2) ● Logging ○ JSON Struct logging ● Monitoring ○ Response Rates ● Tracing: End-to-end Tracing ● Error: Custom Errors ● Profiler: CPU, HEAP ● Debugger: no-golang :( HelloWorld!
  • 28. © 2018 Google LLC. All rights reserved. HipsterShop: http://35.222.251.20/ ● Sorry, out of stock Hipstershop
  • 31. © 2018 Google LLC. All rights reserved. ● Using Stackdriver* with golang on istio. ● "Hipstershop" ● Google Cloud Trace context propagation and metrics graphs with Grafana+Prometheus and Stackdriver ● SRE Fundamentals Stuff for reference

Notas del editor

  1. *depending on their existing application, can either shoot through this or spend more time* But what are microservices exactly? We can think of them as an isolated, autonomous services that work together. Typically, communication between these services are happening via network calls, so that we avoid tight coupling that led us to adopt this architecture in the first place. A more concrete rule of thumb would be one codebase per service, thoroughly discussed in the 12 Factor app methodology. This gives companies two standout benefits: a.) the ability to release features rapidly and independent of the rest of the codebase and b.) the opportunity to organize people and teams according to business boundaries. Generally, when trying to decide what services belong together, we want to follow the Single Responsibility Rule - any service should not have more than one reason to change, giving us a clean system design to deploy independent service.
  2. The mixed technology landscape of a microservices implementation left using code to deal with resilience issues unsustainable, writing solutions for each and every programming language in your microservices implementation is time consuming and hard to maintain
  3. As many people talk about services and micro-services, service to service communication seems simple enough: one service calls another service who provides a useful function. However, there are quite a few things to think about: What is the response doesn’t come right away? How long should the caller wait before giving up? Should the caller retry the operation after a request times out? Retries are useful but can also burden a system that’s already overloaded. Likely there’s more than one instance of the service, e.g. to provide resilience. Which one should you call? Worse yet, there are likely diffeent versions of the service: someone may be soft-launching a new version or has to maintain backwards compatibility. Which version should you be calling? This could change any time, e.g. when the soft launch transitions into a full launch. The service provider will also have quite a few questions: It may need to know which service is calling. It’ll want to check whether the caller is authorized to call the service Even when the caller is authorized, it may have exhausted the number of calls it’s allowed to make in a specific time period. After all these checks pass, communication between the services should be secured. And last but not least, we’d like to know what’s going on with our services: are they healthy, are there a lot of errors, e.g. because the service provider has issues or because the caller makes invalid requests? All these things need to be configured and managed for a large set of services. That needs to be done centrally - otherwise we have a giant mess. And, in most cases you can’t modify the services to do so because you may not have the source. Even if you do, you would not want to make a code change and redeploy just to change the operational setup.
  4. The answer lies in adding a service management layer that’s connected to, but independent of the services: Service proxies intercept outbound and inbound service calls transparent to the service implementation. The outbound proxy manages routing and error handling strategies, such as retries and circuit breakers, based on information from the management center. The inbound proxy validates the service call based on credentials, available quota etc., which can be centrally configured