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

What Even is Cloud Native? (PHPNE, April 2018)

What Even is Cloud Native? (PHPNE, April 2018)

What Even is Cloud Native? (ScotlandPHP 2017) by David McKay

Published November 7, 2017 in Technology

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

April 17, 2018
Tweet

More Decks by David McKay

Other Decks in Technology

Transcript

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

    Cloud Native Glasgow ◆ Docker Glasgow ◆ DevOps Glasgow ◆ Pair Programming Glasgow ◆ MongoDB Glasgow ➔ Developer ◆ Ballerina ◆ Crystal ◆ Elixir ◆ Go ◆ PHP ◆ Python ◆ Pony
  2. @rawkode 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 Containerized “Each part (applications, processes, etc) is packaged in

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

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

    increases the overall agility and maintainability of applications.
  6. @rawkode // npm: is-even:1.0.0 if (i % 2 == 0)

    { return true; } return false;
  7. @rawkode // is-odd:2.0.0 var isNumber = require('is-number'); module.exports = function

    isOdd(i) { if (!isNumber(i)) { throw new TypeError('is-odd expects a number.'); } if (Number(i) !== Math.floor(i)) { throw new RangeError('is-odd expects an integer.'); } return !!(~~i & 1); };
  8. @rawkode Cloud Native Computing Foundation (CNCF) ★ Kubernetes ★ Prometheus

    ★ OpenTracing ★ Fluentd ★ Linkerd ★ gRPC ★ CoreDNS ★ containerd ★ rkt ★ CNI ★ Envoy ★ Jaeger
  9. @rawkode apiVersion: extensions/v1beta1 kind: Deployment spec: replicas: 3 template: spec:

    containers: - name: my-container image: rawkode/my-container:sha256
  10. @rawkode Fluent Bit Logging Written in C > 13k events

    per second ~ 450KIB RAM Footprint
  11. @rawkode Fluentd/Bit Logging Plugins: ➔ AWS ➔ GCP ➔ MySQL

    / PostgreSQL ➔ Elasticsearch ➔ Docker ➔ Kubernetes ➔ Twitter ➔ Kafka
  12. @rawkode Prometheus Monitoring Export Everything! ➔ Elasticsearch ➔ Consul ➔

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

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

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

    'myApp', 'subsystem' => 'Prod', 'name' => 'httpRequests', ]); $counter->increment( ['url' => '/login', 'status_code' => 200 ], 1);
  16. @rawkode 1. Automation DevOps isn’t just a buzzword ➔ Environment

    Parity ➔ Continuous Integration ➔ Automated Tests ➔ Automated Deployment
  17. @rawkode 2. 12-Factor Build Once. Deploy Anywhere. ➔ Version Control

    ➔ Explicit Dependencies ➔ JIT Configuration ➔ Build. Release. Run. ➔ Disposability
  18. @rawkode 4. Logging Understanding what is going wrong Centralised Logging

    ➔ ssh prod ☹ ➔ Log to a central place ➔ Cross-sections ➔ Exception Tracking
  19. @rawkode 6. Micro-services Just don’t ask me to quantify “micro”

    ➔ Don’t refactor, replace ➔ Simplified testing ➔ Fast CI/Deploy ➔ Simple on-boarding
  20. @rawkode From Monolith to Micro-services ★ Scaleable Horizontally ★ Idempotence

    ★ Intelligence ★ Intuition ★ Trust ★ Simplicity
  21. @rawkode Service Mesh (istio edition) Connect, Manage & Secure your

    services ➔ Load Balancing ➔ Canaries ➔ Circuit Breakers ➔ Handling Timeouts and Retries ➔ Fault Injection ➔ mTLS
  22. @rawkode Service Mesh (istio edition) Load Balancing source: name: user-service

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

    user-service route: - labels: version: v2 weight: 25 - labels: version: v1 weight: 75
  24. @rawkode Service Mesh (istio edition) Fault Injection httpFault: delay: percent:

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