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

Stretching the Service Mesh from Java to Beyond

Rosemary Wang
February 21, 2020

Stretching the Service Mesh from Java to Beyond

How do we extend the capabilities of service mesh from Java microservices to on-premise databases and .NET applications? In this talk, we will refactor and scatter a set of Java microservices to various workloads and environments, configure the application for observability and traffic management in a service mesh, and discuss its trade-offs and benefits.

Rosemary Wang

February 21, 2020
Tweet

More Decks by Rosemary Wang

Other Decks in Technology

Transcript

  1. Java Microservice to Java Microservice CODE EDITOR @EnableDiscoveryClient @EnableAutoConfiguration @EnableConfigurationProperties

    @EnableOAuth2Client @EnableFeignClients @EnableCircuitBreaker @SpringBootApplication @EnableGlobalMethodSecurity(prePostEnabled = true) public class AccountApplication { public static void main(String[] args) { SpringApplication.run(AccountApplication.class, args); } } 2 https://github.com/sqshq/piggymetrics
  2. Java Microservice to Java Microservice CODE EDITOR logging: level: org.springframework.security:

    INFO hystrix: command: default: execution: isolation: thread: timeoutInMilliseconds: 10000 eureka: instance: hostname: localhost client: serviceUrl: defaultZone: http://localhost:8761/eureka/ security: oauth2: resource: user-info-uri: http://localhost:5000/uaa/users/current 3 https://github.com/sqshq/piggymetrics
  3. SSL Various Libraries Service Discovery Eureka DNS Network Policy API

    Authorization Firewalls ACLs Policy Groups Load Balancing Ribbon Appliances Traffic Management Hystrix Zuul Observability Brave Spring Metrics 4
  4. “…a dedicated infrastructure layer that controls service-to-service communication over a

    network” TechTarget searchitoperations.techtarget.com/definition/service-mesh 8
  5. 10

  6. SSL Service Mesh Service Discovery Service Mesh Network Policy Service

    Mesh Load Balancing Service Mesh Traffic Management Service Mesh Observability Service Mesh 13
  7. MUTUAL TLS 16 PROXY PROXY CONSUL CLIENT CONSUL CLIENT PROXY

    CONSUL CLIENT REPORT EXPENSE DATABASE
  8. 17 PROXY PROXY CONSUL CLIENT CONSUL CLIENT PROXY CONSUL CLIENT

    REPORT NO TLS USE LOOPBACK EXPENSE DATABASE
  9. TERMINAL > curl localhost:19000/config_dump "filter_chains": [{ "tls_context": { "common_tls_context": {

    "tls_params": {}, "tls_certificates": [ “REDACTED” ], "validation_context": { "trusted_ca": { "inline_string": “REDACTED” } } }, "require_client_certificate": true } }] 18
  10. CODE EDITOR service { name = “expense" // omitted for

    clarity tags = ["java"] meta = { framework = "java" } … } 20
  11. 21

  12. The Problem: Multi-Framework 22 DATABASE REPORT :8080 :3306 :5002 :5001

    EXPENSE EXPENSE DATABASE :1433 HOW DOES EXPENSE CONNECT TO DATABASE?
  13. CODE EDITOR service { name = “expense" connect { sidecar_service

    { proxy { upstreams { destination_name = “expense-db-mysql” local_bind_address = "127.0.0.1" local_bind_port = 3306 } } } } } 24
  14. The Problem: Multi-Framework 25 DATABASE REPORT :8080 :3306 :5002 :5001

    EXPENSE EXPENSE DATABASE :1433 REPORT CONNECTS TO EXPENSE ON :5001 ???
  15. CODE EDITOR service { name = “report" connect { sidecar_service

    { proxy { upstreams { destination_name = "expense" local_bind_address = "127.0.0.1" local_bind_port = 5001 } } } } } 26
  16. The Problem: Multi-Framework 27 DATABASE REPORT :8080 :3306 :5002 :5001

    EXPENSE EXPENSE DATABASE :1433 REPORT CONNECTS TO EXPENSE ON :5001 :5001
  17. 31

  18. 34

  19. * Many capabilities ▪ Circuit Breaking (AKA Outlier Detection) ▪

    Retries ▪ Timeouts ▪ Canary Testing ▪ A/B Testing 36
  20. CODE EDITOR // Envoy Proxy Configuration (Cluster) { "@type": "type.googleapis.com/envoy.api.v2.Cluster",

    "name": "expense.default.dc1.internal.CONSUL_FQDN", "type": "EDS", "eds_cluster_config": { "eds_config": { "ads": {} } }, "connect_timeout": "5s", "outlier_detection": { "consecutive_5xx": 10, "consecutive_gateway_failure": 10, "base_ejection_time": "30s" } } 39
  21. CODE EDITOR // Envoy Proxy Configuration (Listener) { "match": {

    "prefix": "/" }, "route": { "cluster": "expense.default.dc1.internal.CONSUL_FQDN", "timeout": "60s", "retry_policy": { "retry_on": "5xx", "num_retries": 5, "per_try_timeout": "10s" } } } 40
  22. 41

  23. Tracing In 1 Slide Headline / 1 line max. Delete

    if slide title is 2 lines. 43 SPAN UNIT OF WORK CHILD SPAN TRACE CONTEXT PROPAGATED BY HEADERS TAGS ADDED TO SPANS
  24. Tracing with Service Mesh The ConfusionHeadline / 1 line max.

    Delete if slide title is 2 lines. 45 TRACE CONTEXT PROPAGATED BY HEADERS APPLICATION NEEDS TO PROPAGATE HEADERS INSTALL LIBRARIES TO DO TRACING SERVICE MESH ADDS METADATA
  25. 47

  26. SSL Various Libraries Service Discovery Eureka DNS Network Policy API

    Authorization Firewalls ACLs Policy Groups Load Balancing Ribbon Appliances Traffic Management Hystrix Zuul Observability Brave Spring Metrics 48
  27. AZURE KUBERNETES SERVICE DATACENTER The Larger Problem: Multi-* 50 DATABASE

    EXPENSE EXPENSE DATABASE REPORT UI GCP CLOUD RUN AWS EC2 (VMS) REPORT HTTP HTTP2 TCP GRPC
  28. If framework has no libraries Traffic management “contract” One configuration

    for multi-* Eases Day 0 Operations Eases Day N Operations 51
  29. SSL Service Mesh Service Discovery Service Mesh Network Policy Service

    Mesh Load Balancing Service Mesh Traffic Management Service Mesh Observability Service Mesh 52