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

What Even is Cloud Native? (ScotlandPHP 2017)

David McKay
November 07, 2017

What Even is Cloud Native? (ScotlandPHP 2017)

The Cloud Native Computing Foundation, the organisation currently governing Kubernetes, Prometheus, OpenTracing, and more; describe the three goals of "Cloud Native" applications as:

Containerized
Each part (applications, processes, etc) is packaged in its own container. This facilitates reproducibility, transparency, and resource isolation.

Dynamically orchestrated
Containers are actively scheduled and managed to optimize resource utilization.

Microservices oriented
Applications are segmented into microservices. This significantly increases the overall agility and maintainability of applications.
In this talk, I will guide you towards taking your application cloud native, utilising the software available to us today, from the CNCF, and others, covering containers, tracing, logging and service discovery ... as well as the dreaded: "What actually is a micro-service?"

David McKay

November 07, 2017
Tweet

More Decks by David McKay

Other Decks in Technology

Transcript

  1. @rawkode #scotphp17 David McKay Software Consultant ➔ User Group Organiser

    ◆ Cloud Native Glasgow ◆ Docker Glasgow ◆ DevOps Glasgow ◆ Pair Programming Glasgow ◆ MongoDB Glasgow ➔ Developer ◆ Elixir ◆ Go ◆ Pony ◆ Crystal ◆ PHP
  2. @rawkode #scotphp17 Cloud Native Computing Foundation (CNCF) 1. Containerized Each

    part (applications, processes, etc) is packaged in its own container. This facilitates reproducibility, transparency, and resource isolation 2. Dynamically Orchestrated Containers are actively scheduled and managed to optimize resource utilization 3. Microservices Oriented Applications are segmented into microservices. This significantly increases the overall agility and maintainability of applications.
  3. @rawkode #scotphp17 Containerized “Each part (applications, processes, etc) is packaged

    in its own container. This facilitates reproducibility, transparency, and resource isolation”
  4. @rawkode #scotphp17 Containerized: Transparency FROM alpine:3.5 RUN apk update &&

    apk add php ENTRYPOINT [ “php” ] CMD [“-v”]
  5. @rawkode #scotphp17 Microservices Oriented Applications are segmented into microservices. This

    significantly increases the overall agility and maintainability of applications.
  6. @rawkode #scotphp17 Cloud Native Computing Foundation (CNCF) ★ Kubernetes ★

    Prometheus ★ OpenTracing ★ Fluentd ★ Linkerd ★ gRPC ★ CoreDNS ★ containerd ★ rkt ★ CNI ★ Envoy ★ Jaeger
  7. @rawkode #scotphp17 Fluent Bit Logging Written in C > 13k

    events per second ~ 450KIB RAM Footprint
  8. @rawkode #scotphp17 Fluentd/Bit Logging Plugins: ➔ AWS ➔ GCP ➔

    MySQL / PostgreSQL ➔ Elasticsearch ➔ Docker ➔ Kubernetes ➔ Twitter ➔ Kafka
  9. @rawkode #scotphp17 Prometheus Monitoring Export Everything! ➔ Elasticsearch ➔ Consul

    ➔ MongoDB ➔ RabbitMQ ➔ Kafka ➔ Apache ➔ Nginx ➔ Fluentd ➔ …
  10. @rawkode #scotphp17 Prometheus Monitoring Manual Instrumentation $counter = newCounter([ 'namespace'

    => 'myApp', 'subsystem' => 'Prod', 'name' => 'httpRequests', ]); $counter->increment( ['url' => '/login', 'status_code' => 200 ], 1);
  11. @rawkode #scotphp17 Prometheus Monitoring Manual Instrumentation $counter = newCounter([ 'namespace'

    => 'myApp', 'subsystem' => 'Prod', 'name' => 'httpRequests', ]); $counter->increment( ['url' => '/login', 'status_code' => 200 ], 1);
  12. @rawkode #scotphp17 Prometheus Monitoring Manual Instrumentation $counter = newCounter([ 'namespace'

    => 'myApp', 'subsystem' => 'Prod', 'name' => 'httpRequests', ]); $counter->increment( ['url' => '/login', 'status_code' => 200 ], 1);
  13. @rawkode #scotphp17 OpenTracing Tracing Libraries available in 9 languages: Go,

    JavaScript, Java, Python, Ruby, PHP, Objective-C, C++, C#
  14. @rawkode #scotphp17 1. Automation DevOps isn’t just a buzzword ➔

    Continuous Integration ➔ Automated Tests ➔ Automated Deployment
  15. @rawkode #scotphp17 2. 12-Factor Build Once. Deploy Anywhere. ➔ Version

    Control ➔ Explicit Dependencies ➔ Environment Based Config ◆ Runtime Injection Preferred ➔ Build. Release. Run. ➔ Disposability
  16. @rawkode #scotphp17 4. Logging Understanding what is going wrong Centralised

    Logging ➔ ssh prod ☹ ➔ Log to a central place ➔ Cross-sections ➔ Exception Tracking
  17. @rawkode #scotphp17 6. Micro-services Just don’t ask me to quantify

    “micro” ➔ Don’t refactor, replace ➔ Simplified testing ➔ Fast CI/Deploy ➔ Simple on-boarding
  18. @rawkode #scotphp17 From Monolith to Micro-services ★ Confidence ★ Scalability

    ★ Idempotence ★ Understanding ★ Super Mind Reading Abilities ★ Agility
  19. @rawkode #scotphp17 Service Mesh (istio edition) Connect, Manage & Secure

    your services ➔ Load Balancing ➔ Canaries ➔ Circuit Breakers ➔ Handling Timeouts and Retries ➔ Fault Injection ➔ mTLS
  20. @rawkode #scotphp17 Service Mesh (istio edition) Load Balancing source: name:

    user-service labels: version: v3 destination: name: email-service labels: version: v1 loadBalancing: name: ROUND_ROBIN
  21. @rawkode #scotphp17 Service Mesh (istio edition) Load Balancing Canaries destination:

    name: user-service route: - labels: version: v2 weight: 25 - labels: version: v1 weight: 75
  22. @rawkode #scotphp17 Service Mesh (istio edition) Timeouts & Retries httpReqTimeout:

    simpleTimeout: timeout: 10s httpReqRetries: simpleRetry: attempts: 3
  23. @rawkode #scotphp17 Service Mesh (istio edition) Fault Injection httpFault: delay:

    percent: 10 fixedDelay: 5s abort: percent: 2 httpStatus: 400