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

Stretching the Service Mesh

Stretching the Service Mesh

Originally presented at .NET Conf 2019. In this talk, you'll learn about how to stretch the service mesh for .NET applications.

Be8b596c46f4c9a1aec6a7586af33134?s=128

Rosemary Wang

September 29, 2019
Tweet

More Decks by Rosemary Wang

Other Decks in Programming

Transcript

  1. www.dotnetconf.n et

  2. Stretching the Service Mesh Rosemary Wang

  3. she/her Developer Advocate rosemary@hashicorp.com @joatmon08 joatmon08 Rosemary Wang

  4. • What’s the buzz about service mesh? • Examination: Tracing

    • Examination: Traffic Management • What can we conclude? Overview
  5. .NET What’s the buzz about service mesh?

  6. We need a service mesh. We can't trace transaction s.

    We don't have a way to control traffic. We can't secure every application .
  7. We need a service mesh because Kubernetes has one. We

    can't trace transaction s. We don't have a way to control traffic. We can't secure every application .
  8. Private Monolith to Microservices, Private to Public Cloud… MSSQL Server

    Expens e v1 Expens e v2 Public Cloud Report
  9. We need a library OR some proxy to control. We

    can't trace transaction s. We don't have a way to control traffic. We can't secure every application .
  10. .NET Examination: Tracing*

  11. * Tracing is non-trivial.

  12. Code Sample Using a Library public void ConfigureServices(IServiceCollection services) {

    // sections omitted for clarity services.AddOpenTracing(); services.AddSingleton<ITracer>(serviceProvider => { // sections omitted for clarity }); services.Configure<HttpHandlerDiagnosticOptions>(options => { options.IgnorePatterns.Add(request => request.RequestUri.ToString().Contains (Configuration.GetConnectionString("JaegerURL"))); }); }
  13. Code Sample Using a Library (Jaeger) services.AddSingleton<ITracer>(serviceProvider => { string

    serviceName = serviceProvider.GetRequiredService<IHostingEnvironment>().A pplicationName; var sampler = new ConstSampler(sample: true); var reporter = new RemoteReporter.Builder() .WithSender(new HttpSender( Configuration.GetConnectionString("Jaeger")) .Build(); var tracer = new Tracer.Builder(serviceName) .WithSampler(sampler) .WithReporter(reporter) .Build(); return tracer; });
  14. Jaeger Zipkin… zipkin4net? OpenTelemetr y? Zipkin with OpenTracing? Consul +

    Envoy
  15. Takeaways • Still need a library and code to mark

    spans • Lots of movement in this space • OpenCensus + OpenTracing = OpenTelemetry • Currently, no stable library for .NET + Zipkin + OpenTracing • Envoy 1.12 (Jaeger) • Keep it as library?
  16. .NET Examination: Traffic Management

  17. Private Circuit Breaking Database Expens e v2 Public Cloud Report

    database issues “when I get 500s three times, stop.”
  18. Libraries… Akka Polly Write your own logic? Circuit Breaking Libraries

  19. Code Sample Circuit Breaking (Envoy) "outlier_detection": { "consecutive_5xx": 10, "consecutive_gateway_failure":

    10, "base_ejection_time": "30s" } "circuit_breakers": { "thresholds": [ { "priority": "HIGH", "max_requests": 10 } ] }
  20. Private Canary or A/B Testing MSSQL Server Expens e v1

    Expens e v2 Public Cloud Report testgroup: b
  21. Code Sample Canary or A/B Testing kind = "service-router" name

    = "expense" routes = [ { match { http { header = [ { name = "testgroup" exact = "b" }, ] } } destination { service = "expense" service_subset = "v2" } } ]
  22. Private Traffic Splitting MSSQL Server Expens e v1 Expens e

    v2 Public Cloud Report
  23. Code Sample Traffic Splitting kind = "service-splitter", name = "expense"

    splits = [ { weight = 50, service_subset = "v1" }, { weight = 50, service_subset = "v2" } ]
  24. .NET What can we conclude?

  25. • Still non-trivial • Libraries + mesh compatibility requires investigation

    • Maybe greatest value in proxy in front of database? Tracing
  26. • Worth attempting (fewer libraries) • Less configuration within application

    code • Control traffic based on intent Traffic Shaping
  27. • envoyproxy.io/docs • Nic Jackson’s Consul-Related Works • github.com/nicholasjackson/demo-consul-service-mesh •

    hashicorp.com/resources/consul-service-mesh-deep-dive • github.com/joatmon08/dotnet-service-mesh-example References
  28. Thank you! Rosemary Wang rosemary@hashicorp.com @joatmon08