Tear down this pyramid... using functions and meshes

Tear down this pyramid... using functions and meshes

In this live coding talk you will learn about techniques you can use to better test your microservice architecture. We will build a stateful HTTP-based Pac-Man game engine from highly isolated and testable components using pure functions, type parameters, side cars and service meshes.

6f6dc1b13fd3fe35d36db3adafcb0c8e?s=128

Michał Płachta

October 09, 2018
Tweet

Transcript

  1. @miciek @miciek Michał Płachta michalplachta.com @miciek E2E Integration Unit Tear

    down this pyramid... using functions & meshes Tear down this pyramid... using functions & meshes
  2. @miciek In this talk... code production

  3. @miciek In this talk... code functional programming immutability Scala production

    accidental complexity DevOps Kubernetes
  4. @miciek In this talk... functions functional programming immutability Scala service

    meshes accidental complexity DevOps Kubernetes / Linkerd
  5. @miciek In this talk... E2E Integration Unit

  6. @miciek Pac-Man Game Server Frontend Backend 100ms - Grid setup

    - Direction change - Movement - Multiple games - Fetch & render - Send direction changes
  7. @miciek Pac-Man Game Server Frontend Backend 100ms Collectibles 100ms -

    Things that can be eaten - Dots - Fruit (appearing randomly)
  8. @miciek Code → Production Collectibles Service Live coding

  9. @miciek Creating Collectibles service code - fast HTTP tests -

    No HTTP server - No mocking production - pacman-collectibles:v1 - Yaml → K8s
  10. @miciek Fast, Stable, Real, Documenting

  11. @miciek Kubernetes Deployments

  12. @miciek Rolling out Collectibles Frontend Backend Collectibles v1 prod /

    no collectibles v1 prod / no collectibles v1 not used player
  13. @miciek Big Bang Frontend Backend Collectibles v1 prod / no

    collectibles v2 prod / collectibles v1 prod / no collectibles v2 prod / collectibles v1 not used prod player
  14. @miciek What if? Frontend Backend Collectibles v1 prod / no

    collectibles v1 prod / no collectibles v1 player Frontend v2 collectibles Backend v2 collectibles
  15. @miciek Per-request routing... Frontend Backend Collectibles v1 prod / no

    collectibles v1 prod / no collectibles v1 Frontend v2 collectibles Backend v2 collectibles player test player (automated)
  16. @miciek Without Service Sidecar Collectibles pacman-collectibles:v1

  17. @miciek With Service Sidecar Collectibles pacman-collectibles:v1 Linkerd Sidecar

  18. @miciek With Service Mesh Collectibles pacman-collectibles:v1 Linkerd

  19. @miciek Per-request routing... Frontend Collectibles v1 prod / no collectibles

    v1 Frontend v2 collectibles Player test player Linkerd
  20. @miciek Isolated tests on Production Live coding

  21. @miciek Rolling out Collectibles Frontend Collectibles v1 prod / no

    collectibles v1 Frontend v2 collectibles Player normal requests test player requests with routing headers Linkerd
  22. @miciek Cherry Picking using Header l5d-dtab: /k8s/pacman/http/backend=>/k8s/pacman/http/backend-test https://linkerd.io/1/advanced/dtabs/

  23. @miciek Cherry Picking using Header Linkerd Service A Service B

    Service Y Service Z Backend v2 Frontend v2 Frontend v1 Collectibles l5d-dtab: /k8s/pacman/http/backend=>/k8s/pacman/http/backend-test
  24. @miciek Communicating Services Linkerd Service A Service B Service Y

    Service Z Backend v2 Frontend v2 Frontend v1 Collectibles
  25. @miciek Communicating Services Service Discovery Circuit Breaking Security Telemetry Linkerd

    Service A Service B Service Y Service Z Backend v2 Frontend v2 Frontend v1 Collectibles For free:
  26. @miciek Service Meshes, Sidecars, Proxies

  27. @miciek Conclusion… what do we really want? Fast! Stable! Quick

    to read/write! Documentation
  28. @miciek Conclusion… Tearing down the pyramid! E2E Integration Unit

  29. @miciek New Testing Pyramid Real Fast Stable Quick to read/write

    99% production code
  30. @miciek New Testing Pyramid Real Fast Stable Quick to read/write

    99% production code No HTTP Servers Function parameters Abstracting over data Routing test traffic Isolated tests on PROD No Mocking
  31. @miciek New Testing Pyramid Real Fast Stable Quick to read/write

    99% production code No HTTP Servers Function parameters Abstracting over data Routing test traffic Isolated tests on PROD functions service meshes No Mocking
  32. @miciek Next steps ➔ Play around with https://github.com/miciek/pacman-kubernetes-linkerd project ➔

    Play with Kubernetes and Linkerd using Katakoda: https://www.katacoda.com/stephpr/scenarios/k8s-l5d ➔ Play with Kubernetes and Istio using Katakoda https://www.katacoda.com/courses/istio/deploy-istio-on-kubernetes
  33. @miciek @miciek www.michalplachta.com

  34. @miciek @miciek Michał Płachta michalplachta.com @miciek Real Tear down this

    pyramid... using functions & meshes Tear down this pyramid... using functions & meshes Fast Stable Quick to read/write 99% production code