Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

A hitchhiker‘s guide to the cloud native stack

634 views

Published on

Container Days 2017, Hamburg: Vortrag von Mario-Leander Reimer (@LeanderReimer, Cheftechnologe bei QAware).

Abstract: Cloud-Größen wie Google, Twitter und Netflix haben die Kernbausteine ihrer Infrastruktur quelloffen verfügbar gemacht. Das Resultat aus vielen Jahren Cloud-Erfahrung ist nun frei zugänglich, und jeder kann seine eigenen Cloud-nativen Anwendungen entwickeln – Anwendungen, die in der Cloud zuverlässig laufen und fast beliebig skalieren. Die einzelnen Bausteine wachsen zu einem großen Ganzen zusammen, dem Cloud Native Stack.
In dieser Session stellen wir die wichtigsten Konzepte und Schlüsseltechnologien vor und bringen dann eine Spring-Cloud-basierte Beispielanwendung schrittweise auf Kubernetes und DC/OS zum Laufen. Dabei diskutieren wir verschiedene praktikable Architekturalternativen.

Published in: Data & Analytics
  • I’ve personally never heard of companies who can produce a paper for you until word got around among my college groupmates. My professor asked me to write a research paper based on a field I have no idea about. My research skills are also very poor. So, I thought I’d give it a try. I chose a writer who matched my writing style and fulfilled every requirement I proposed. I turned my paper in and I actually got a good grade. I highly recommend ⇒ www.HelpWriting.net ⇐
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • D0WNL0AD FULL ▶ ▶ ▶ ▶ http://1lite.top/85NP1 ◀ ◀ ◀ ◀
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • I think you need a perfect and 100% unique academic essays papers have a look once this site i hope you will get valuable papers, ⇒ www.WritePaper.info ⇐
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • D0WNL0AD FULL ▶ ▶ ▶ ▶ http://1lite.top/85NP1 ◀ ◀ ◀ ◀
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

A hitchhiker‘s guide to the cloud native stack

  1. 1. Mario-Leander Reimer mario-leander.reimer@qaware.de @LeanderReimer A Hitchhiker‘s Guide to the Cloud Native Stack Hamburg, 20. June 2017
  2. 2. Mario-Leander Reimer Chief Technologist, QAware GmbH Contact Details Phone: +49 89 23 23 15 121 Mail: mario-leander.reimer@qaware.de Twitter: @LeanderReimer Github: https://github.com/lreimer 2 Developer & Architect 20+ years of experience #CloudNativeNerd Open Source Enthusiast
  3. 3. Let‘s talk about Cloud Native Applications. 3
  4. 4. DISRUPT 4 CLOUD NATIVE APPLICATIONS INDUSTRIALIZE OPEX SAVINGS (automation & utilization) ANTIFRAGILITYHYPERSCALE TRAFFIC, DATA, FEATURES DEVOPS & CONTINUOUS DELIVERY
  5. 5. BUILT AND COMPOSED AS MICROSERVICES 3KEYPRINCIPLES 5 CLOUD NATIVE APPLICATIONS PACKAGED AND DISTRIBUTED IN CONTAINERS DYNAMICALLY EXECUTED IN THE CLOUD
  6. 6. Robert A. Heinlein, 1966, The Moon Is a Harsh Mistress „There ain’t no such thing as a free lunch.“
  7. 7. 7 The 5 Cloud Commandments: 1. Everything Fails All The Time. 2. Focus on MTTR not MTTF. 3. Know the Eight Fallacies of Distributed Computing. 4. Scale out, not up. 5. Treat resources as cattle not as pets. picture alliance / United Archive
  8. 8. Design Principles for Cloud Native Applications. 8 Design for Distribution: Containers; microservices; API driven development. Design for Performance: Responsive; concurrent; resource efficient. Design for Automation: Automated Dev & Ops tasks. Design for Resiliency: Fault-tolerant and self-healing. Design for Elasticity: Scales dynamically and reacts to stimuli. Design for Delivery: Short roundtrips and automated provisioning. Design for Diagnosability: Cluster-wide logs, metrics and traces.
  9. 9. Different Levels of Cloud Native Application Maturity. 9 Scales dynamically based on stimuli. Dynamic infrastructure migration without service downtime. Level 3: Cloud Native Fault tolerant and resilient design. Metrics and monitoring built-in. Runs anywhere. Infrastructure agnostic. Level 2: Cloud Resilient Consists of loosely coupled systems. Services can be found by name. Adheres to the 12-factor app principles. Level 1: Cloud Friendly No file system requirements. Runs on virtualized hardware. Executed as self-contained image. Level 0: Cloud Ready https://www.opendatacenteralliance.org/docs/architecting_cloud_aware_applications.pdf
  10. 10. The Anatomy of the Cloud Native Stack. 10 How to decouple from physical hardware? How to provide the right resources for container execution? How to run (containerized) applications on a cluster? How to automate standard operations procedures? What infrastructure to provide to cloud native applications?
  11. 11. Specific Cloud Native Stack with Spring Cloud and K8s. 12
  12. 12. (1) Microservices (2) Containerization (3) Composition (4) Orchestration The 4 Phases of Cloud Native Application Development. 13
  13. 13. Microservices
  14. 14. Niloo138, Getty Images
  15. 15. 2002 16 Buying Registration Items Categories Services
  16. 16. 2008 17 Additional Services
  17. 17. 2011 18 Additional Services
  18. 18. Bad News. 19 Very long release cycles. Limited scalability.
  19. 19. 2016 20 Additional Services
  20. 20. Good News. 21 1000 deployments a day … … triggered by dev teams. ~ 100% availability Resource efficiency Suitable scalability Enabled new kinds of applications ( IoT, mobile, APIs) to compete globally
  21. 21. WHAT DID THEY DO?
  22. 22. The obvious answer: Decomposition. 23
  23. 23. 24 Cloud Native Application Development: Components All Along the Software Lifecycle. DESIGN BUILD RUN § Complexity unit § Data integrity unit § Coherent and cohesive features unit § Decoupled unit § Planning unit § Team assignment unit § Knowledge unit § Development unit § Integration unit § Release unit § Deployment unit § Runtime unit (crash, slow-down, access) § Scaling unit 1:1 n:1
  24. 24. 25 Dev Components Ops Components?:1 System Subsystems Components Services Good starting point Decomposition Trade-Offs Microservices Nanoservices Macroservices Monolith + More flexible to scale + Runtime isolation (crash, slow-down, …) + Independent releases, deployments, teams + Higher utilization possible - Distribution debt: Latency - Increasing infrastructure complexity - Increasing troubleshooting complexity - Increasing integration complexity
  25. 25. A simple Zwitscher microservices using Spring Cloud. 26 https://github.com/qaware/hitchhikers-guide-cloudnative
  26. 26. Containerization
  27. 27. Hardware vs. OS Virtualization. 28 Real Hardware Virtual Hardware OS OS Libraries Application Real Hardware (Virtual Hardware) OS OS Libraries Application HSI* SCI* Hardware Virtualization OS Virtualization Private Copy Shared ResourcesVirtualMachine Container Isolated Hardware Isolated NW-interface, process space, file system *) HSI = Hardware Software Interface SCI = System Call Interface § Less volume of private copy § Near zero runtime overhead § Short start-up time § Stong isolation
  28. 28. Developer‘s Perspective of the Docker Workflow. 29 $ docker build -t zwitscher-service:1.0.1 . $ docker run --name zwitscher-service -d -p 8080:8080 zwitscher-service:1.0.1 $ docker stop zwitscher-service $ docker start zwitscher-service $ docker tag zwitscher-service:1.0.1 hitchhikersguide/zwitscher-service:latest $ docker push hitchhikersguide/zwitscher-service
  29. 29. FROM qaware/alpine-k8s-ibmjava8:8.0-3.10 MAINTAINER QAware GmbH <qaware-oss@qaware.de> RUN mkdir -p /app COPY build/libs/zwitscher-service-1.0.1.jar /app/zwitscher-service.jar COPY src/main/docker/zwitscher-service.conf /app/ ENV JAVA_OPTS –Xmx256m EXPOSE 8080 CMD /app/zwitscher-service.jar Example Dockerfile. 30
  30. 30. Some Useful Tips on using Docker. 31 A Dockerfile is code! Treat it as 1st class citizen. Know your base image. Size matters. Chain RUN commands. Use intelligent layering. Remove temporary files and directories. Define ENV variables for important parameters. Use one image for all your environments. Version your images. Use quality tools to check Dockerfiles and images.
  31. 31. Composition
  32. 32. Microservices need an Ecosystem to run in. 33 How to access endpoints from the outside? How to expose and find service endpoints? How to execute an ops component? How to call other endpoints resilient and responsive? How to detect and resolve operational anomalies? How to provide cluster- wide configuration and consensus?
  33. 33. 34
  34. 34. Conceptual View on Infrastructure Composition. 35
  35. 35. version: '3' services: zwitscher-consul: ... zwitscher-service: image: hitchhikersguide/zwitscher-service:1.0.1 environment: - CONSUL_HOST=zwitscher-consul - CONSUL_PORT=8500 - TWITTER_APP_ID=${TWITTER_APP_ID} - TWITTER_APP_SECRET=${TWITTER_APP_SECRET} depends_on: - zwitscher-consul ports: - "8080:8080" networks: - zwitscher-net Example docker-compose.yml 36 $ docker-compose build $ docker-compose up –d --build $ docker-compose logs $ docker-compose down
  36. 36. Orchestration
  37. 37. echo "- The default provider is GCE" export KUBERNETES_PROVIDER=gce export KUBE_GCE_ZONE=europe-west1-d export NUM_NODES=4 echo "- Another possible provider is AWS" export KUBERNETES_PROVIDER=aws export KUBE_AWS_ZONE=eu-central-1a export NODE_SIZE=t2.small curl -sS https://get.k8s.io | bash Easy K8s setup: Local, Bare Metal, Cloud or Managed. 38
  38. 38. Conceptual View on Kubernetes Building Blocks. 39
  39. 39. Services are an abstraction for a logical collection of pods. Pods are the smallest unit of compute in Kubernetes Deployments are an abstraction used to declare and update pods, RCs, … Replica Sets ensure that the desired number of pod replicas are running Labels are key/value pairs used to identify Kubernetes resources Most important Kubernetes concepts. 40
  40. 40. Single or Multi Container Pods? 41
  41. 41. K8s Deployment Overview. 42
  42. 42. K8s-only Deployment Variation. 43
  43. 43. apiVersion: extensions/v1beta1 kind: Deployment metadata: name: zwitscher-service spec: replicas: 3 template: metadata: labels: zwitscher: service spec: containers: - name: zwitscher-service image: "hitchhikersguide/zwitscher-service:1.0.1" ports: - containerPort: 8080 env: - name: CONSUL_HOST value: zwitscher-consul Example K8s Deployment Definition. 44
  44. 44. resources: # Define resources to help K8S scheduler # CPU is specified in units of cores # Memory is specified in units of bytes # required resources for a Pod to be started requests: memory: "128Mi" cpu: "250m" # the Pod will be restarted if limits are exceeded limits: memory: "192Mi" cpu: "500m" Define Resource Constraints carefully. 45
  45. 45. # container will receive requests if probe succeeds readinessProbe: httpGet: path: /admin/info port: 8080 initialDelaySeconds: 30 timeoutSeconds: 5 # container will be killed if probe fails livenessProbe: httpGet: path: /admin/health port: 8080 initialDelaySeconds: 90 timeoutSeconds: 10 Liveness and Readiness Probes for Actuator endpoints. 46
  46. 46. apiVersion: v1 kind: Service metadata: name: zwitscher-service labels: zwitscher: service spec: # use NodePort here to be able to access the port on each node # use LoadBalancer for external load-balanced IP if supported type: NodePort ports: - port: 8080 selector: zwitscher: service Example K8s Service Definition. 47
  47. 47. Programmable MIDI Controller. Visualizes Deployments and Pods. Scales Deployments. Supports K8s, OpenShift, DC/OS. http://github.com/qaware/kubepad/ Let‘s have some fun with K8S! 48
  48. 48. No magic! Just complex technology. 50 Building distributed systems is hard! The Cloud Native Stack hides most of the inherent complexity. High abstraction: Boon and Bane of software development. Developers and architects need additional skills and know-how. Favour gradual transition over big bang cloud migration.
  49. 49. Sources and some articles to read @ home … 51 https://github.com/qaware/hitchhikers-guide-cloudnative Der Cloud Native Stack: Mesos, Kubernetes und Spring Cloud https://goo.gl/U5cJAU Spring Cloud und Netflix OSS: Cloud-native Anwendungen bauen https://goo.gl/edNlUK Cloud-native Anwendungen mit Kubernetes
 https://goo.gl/dVkoyR Eine Einführung in Apache Mesos: Das Betriebsystem der Cloud
 https://goo.gl/7SnMZA
  50. 50. Mario-Leander Reimer mario-leander.reimer@qaware.de @LeanderReimer github.com/lreimer linkedin.com/qaware slideshare.net/qaware twitter.com/qaware xing.com/qaware

×