SlideShare ist ein Scribd-Unternehmen logo
1 von 52
Downloaden Sie, um offline zu lesen
Mario-Leander Reimer
mario-leander.reimer@qaware.de
@LeanderReimer
A Hitchhiker‘s Guide to the
Cloud Native Stack
Hamburg, 20. June 2017
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
Let‘s talk about Cloud Native Applications.
3
DISRUPT
4
CLOUD NATIVE APPLICATIONS
INDUSTRIALIZE
OPEX SAVINGS
(automation & utilization)
ANTIFRAGILITYHYPERSCALE
TRAFFIC, DATA, FEATURES
DEVOPS &
CONTINUOUS DELIVERY
BUILT AND COMPOSED
AS MICROSERVICES
3KEYPRINCIPLES
5
CLOUD NATIVE APPLICATIONS
PACKAGED AND
DISTRIBUTED IN CONTAINERS
DYNAMICALLY
EXECUTED IN THE CLOUD
Robert A. Heinlein, 1966, The Moon Is a Harsh Mistress
„There ain’t no such thing
as a free lunch.“
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
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.
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
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?
Specific Cloud Native Stack with Spring Cloud and K8s.
12
(1) Microservices
(2) Containerization
(3) Composition
(4) Orchestration
The 4 Phases of Cloud Native Application Development.
13
Microservices
Niloo138, Getty Images
2002
16
Buying
Registration
Items
Categories
Services
2008
17
Additional
Services
2011
18
Additional
Services
Bad News.
19
Very long
release cycles.
Limited
scalability.
2016
20
Additional
Services
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
WHAT DID THEY DO?
The obvious answer: Decomposition.
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
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
A simple Zwitscher microservices using Spring Cloud.
26
https://github.com/qaware/hitchhikers-guide-cloudnative
Containerization
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
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
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
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.
Composition
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?
34
Conceptual View on Infrastructure Composition.
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
Orchestration
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
Conceptual View on Kubernetes Building Blocks.
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
Single or Multi Container Pods?
41
K8s Deployment Overview.
42
K8s-only Deployment Variation.
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
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
# 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
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
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
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.
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
Mario-Leander Reimer
mario-leander.reimer@qaware.de
@LeanderReimer github.com/lreimer
linkedin.com/qaware slideshare.net/qaware
twitter.com/qaware xing.com/qaware

Weitere ähnliche Inhalte

Was ist angesagt?

The Containers Ecosystem, the OpenStack Magnum Project, the Open Container In...
The Containers Ecosystem, the OpenStack Magnum Project, the Open Container In...The Containers Ecosystem, the OpenStack Magnum Project, the Open Container In...
The Containers Ecosystem, the OpenStack Magnum Project, the Open Container In...
Daniel Krook
 

Was ist angesagt? (19)

What's New in Docker - February 2017
What's New in Docker - February 2017What's New in Docker - February 2017
What's New in Docker - February 2017
 
DockerCon SF 2015: Keynote Day 1
DockerCon SF 2015: Keynote Day 1DockerCon SF 2015: Keynote Day 1
DockerCon SF 2015: Keynote Day 1
 
Docker Overview - Rise of the Containers
Docker Overview - Rise of the ContainersDocker Overview - Rise of the Containers
Docker Overview - Rise of the Containers
 
Microservices with Terraform, Docker and the Cloud. IJug Chicago 2017-06-06
Microservices with Terraform, Docker and the Cloud. IJug Chicago 2017-06-06Microservices with Terraform, Docker and the Cloud. IJug Chicago 2017-06-06
Microservices with Terraform, Docker and the Cloud. IJug Chicago 2017-06-06
 
DockerCon Keynote Ben Golub
DockerCon Keynote Ben GolubDockerCon Keynote Ben Golub
DockerCon Keynote Ben Golub
 
Containers vs. VMs: It's All About the Apps!
Containers vs. VMs: It's All About the Apps!Containers vs. VMs: It's All About the Apps!
Containers vs. VMs: It's All About the Apps!
 
Containers and microservices for realists
Containers and microservices for realistsContainers and microservices for realists
Containers and microservices for realists
 
Microservices with Terraform, Docker and the Cloud. Chicago Coders Conference...
Microservices with Terraform, Docker and the Cloud. Chicago Coders Conference...Microservices with Terraform, Docker and the Cloud. Chicago Coders Conference...
Microservices with Terraform, Docker and the Cloud. Chicago Coders Conference...
 
Building Your Docker Swarm Tech Stack
Building Your Docker Swarm Tech StackBuilding Your Docker Swarm Tech Stack
Building Your Docker Swarm Tech Stack
 
The Containers Ecosystem, the OpenStack Magnum Project, the Open Container In...
The Containers Ecosystem, the OpenStack Magnum Project, the Open Container In...The Containers Ecosystem, the OpenStack Magnum Project, the Open Container In...
The Containers Ecosystem, the OpenStack Magnum Project, the Open Container In...
 
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...
 
Hypervisor "versus" Linux Containers with Docker !
Hypervisor "versus" Linux Containers with Docker !Hypervisor "versus" Linux Containers with Docker !
Hypervisor "versus" Linux Containers with Docker !
 
DCEU 18: Provisioning and Managing Storage for Docker Containers
DCEU 18: Provisioning and Managing Storage for Docker ContainersDCEU 18: Provisioning and Managing Storage for Docker Containers
DCEU 18: Provisioning and Managing Storage for Docker Containers
 
Docker, the Future of DevOps
Docker, the Future of DevOpsDocker, the Future of DevOps
Docker, the Future of DevOps
 
A Dive Into Containers and Docker
A Dive Into Containers and DockerA Dive Into Containers and Docker
A Dive Into Containers and Docker
 
Docker in Production, Look No Hands! by Scott Coulton
Docker in Production, Look No Hands! by Scott CoultonDocker in Production, Look No Hands! by Scott Coulton
Docker in Production, Look No Hands! by Scott Coulton
 
Docker Bday #5, SF Edition: Introduction to Docker
Docker Bday #5, SF Edition: Introduction to DockerDocker Bday #5, SF Edition: Introduction to Docker
Docker Bday #5, SF Edition: Introduction to Docker
 
Building a smarter application Stack by Tomas Doran from Yelp
Building a smarter application Stack by Tomas Doran from YelpBuilding a smarter application Stack by Tomas Doran from Yelp
Building a smarter application Stack by Tomas Doran from Yelp
 
Evénement Docker Paris: Anticipez les nouveaux business model et réduisez vos...
Evénement Docker Paris: Anticipez les nouveaux business model et réduisez vos...Evénement Docker Paris: Anticipez les nouveaux business model et réduisez vos...
Evénement Docker Paris: Anticipez les nouveaux business model et réduisez vos...
 

Ähnlich wie A Hitchhiker’s Guide to the Cloud Native Stack. #CDS17

Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
QAware GmbH
 

Ähnlich wie A Hitchhiker’s Guide to the Cloud Native Stack. #CDS17 (20)

Cloud-native .NET Microservices mit Kubernetes
Cloud-native .NET Microservices mit KubernetesCloud-native .NET Microservices mit Kubernetes
Cloud-native .NET Microservices mit Kubernetes
 
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
 
'DOCKER' & CLOUD: ENABLERS For DEVOPS
'DOCKER' & CLOUD:  ENABLERS For DEVOPS'DOCKER' & CLOUD:  ENABLERS For DEVOPS
'DOCKER' & CLOUD: ENABLERS For DEVOPS
 
Docker and Cloud - Enables for DevOps - by ACA-IT
Docker and Cloud - Enables for DevOps - by ACA-ITDocker and Cloud - Enables for DevOps - by ACA-IT
Docker and Cloud - Enables for DevOps - by ACA-IT
 
Cloud-native .NET-Microservices mit Kubernetes @BASTAcon
Cloud-native .NET-Microservices mit Kubernetes @BASTAconCloud-native .NET-Microservices mit Kubernetes @BASTAcon
Cloud-native .NET-Microservices mit Kubernetes @BASTAcon
 
Docker Platform and Ecosystem
Docker Platform and EcosystemDocker Platform and Ecosystem
Docker Platform and Ecosystem
 
Docker Orchestration: Welcome to the Jungle! Devoxx & Docker Meetup Tour Nov ...
Docker Orchestration: Welcome to the Jungle! Devoxx & Docker Meetup Tour Nov ...Docker Orchestration: Welcome to the Jungle! Devoxx & Docker Meetup Tour Nov ...
Docker Orchestration: Welcome to the Jungle! Devoxx & Docker Meetup Tour Nov ...
 
IAU workshop 2018 day one
IAU workshop 2018 day oneIAU workshop 2018 day one
IAU workshop 2018 day one
 
DCEU 18: Docker Container Networking
DCEU 18: Docker Container NetworkingDCEU 18: Docker Container Networking
DCEU 18: Docker Container Networking
 
DevOps with Kubernetes and Helm - Jenkins World Edition
DevOps with Kubernetes and Helm - Jenkins World EditionDevOps with Kubernetes and Helm - Jenkins World Edition
DevOps with Kubernetes and Helm - Jenkins World Edition
 
Kubernetes for java developers - Tutorial at Oracle Code One 2018
Kubernetes for java developers - Tutorial at Oracle Code One 2018Kubernetes for java developers - Tutorial at Oracle Code One 2018
Kubernetes for java developers - Tutorial at Oracle Code One 2018
 
Containers as a Service with Docker
Containers as a Service with DockerContainers as a Service with Docker
Containers as a Service with Docker
 
Docker Container As A Service - March 2016
Docker Container As A Service - March 2016Docker Container As A Service - March 2016
Docker Container As A Service - March 2016
 
Oscon 2017: Build your own container-based system with the Moby project
Oscon 2017: Build your own container-based system with the Moby projectOscon 2017: Build your own container-based system with the Moby project
Oscon 2017: Build your own container-based system with the Moby project
 
Docker, cornerstone of cloud hybridation ? [Cloud Expo Europe 2016]
Docker, cornerstone of cloud hybridation ? [Cloud Expo Europe 2016]Docker, cornerstone of cloud hybridation ? [Cloud Expo Europe 2016]
Docker, cornerstone of cloud hybridation ? [Cloud Expo Europe 2016]
 
Why Kubernetes? Cloud Native and Developer Experience at Zalando - OWL Tech &...
Why Kubernetes? Cloud Native and Developer Experience at Zalando - OWL Tech &...Why Kubernetes? Cloud Native and Developer Experience at Zalando - OWL Tech &...
Why Kubernetes? Cloud Native and Developer Experience at Zalando - OWL Tech &...
 
Docker Application to Scientific Computing
Docker Application to Scientific ComputingDocker Application to Scientific Computing
Docker Application to Scientific Computing
 
Kubernetes extensibility
Kubernetes extensibilityKubernetes extensibility
Kubernetes extensibility
 
Dev opsec dockerimage_patch_n_lifecyclemanagement_
Dev opsec dockerimage_patch_n_lifecyclemanagement_Dev opsec dockerimage_patch_n_lifecyclemanagement_
Dev opsec dockerimage_patch_n_lifecyclemanagement_
 
Red Hat and kubernetes: awesome stuff coming your way
Red Hat and kubernetes:  awesome stuff coming your wayRed Hat and kubernetes:  awesome stuff coming your way
Red Hat and kubernetes: awesome stuff coming your way
 

Mehr von Mario-Leander Reimer

Steinzeit war gestern! Die vielfältigen Wege der Cloud-nativen Evolution
Steinzeit war gestern! Die vielfältigen Wege der Cloud-nativen EvolutionSteinzeit war gestern! Die vielfältigen Wege der Cloud-nativen Evolution
Steinzeit war gestern! Die vielfältigen Wege der Cloud-nativen Evolution
Mario-Leander Reimer
 

Mehr von Mario-Leander Reimer (20)

Steinzeit war gestern! Vielfältige Wege der Cloud-nativen Evolution.
Steinzeit war gestern! Vielfältige Wege der Cloud-nativen Evolution.Steinzeit war gestern! Vielfältige Wege der Cloud-nativen Evolution.
Steinzeit war gestern! Vielfältige Wege der Cloud-nativen Evolution.
 
A Hitchhiker's Guide to Cloud Native Java EE
A Hitchhiker's Guide to Cloud Native Java EEA Hitchhiker's Guide to Cloud Native Java EE
A Hitchhiker's Guide to Cloud Native Java EE
 
Steinzeit war gestern! Die vielfältigen Wege der Cloud-nativen Evolution
Steinzeit war gestern! Die vielfältigen Wege der Cloud-nativen EvolutionSteinzeit war gestern! Die vielfältigen Wege der Cloud-nativen Evolution
Steinzeit war gestern! Die vielfältigen Wege der Cloud-nativen Evolution
 
Everything-as-code: DevOps und Continuous Delivery aus Sicht des Entwicklers....
Everything-as-code: DevOps und Continuous Delivery aus Sicht des Entwicklers....Everything-as-code: DevOps und Continuous Delivery aus Sicht des Entwicklers....
Everything-as-code: DevOps und Continuous Delivery aus Sicht des Entwicklers....
 
Das kleine Einmaleins der sicheren Architektur @heise_devSec
Das kleine Einmaleins der sicheren Architektur @heise_devSecDas kleine Einmaleins der sicheren Architektur @heise_devSec
Das kleine Einmaleins der sicheren Architektur @heise_devSec
 
Polyglot Adventures for the Modern Java Developer #javaone2017
Polyglot Adventures for the Modern Java Developer #javaone2017Polyglot Adventures for the Modern Java Developer #javaone2017
Polyglot Adventures for the Modern Java Developer #javaone2017
 
Elegantes In-Memory Computing mit Apache Ignite und Kubernetes. @data2day
Elegantes In-Memory Computing mit Apache Ignite und Kubernetes. @data2dayElegantes In-Memory Computing mit Apache Ignite und Kubernetes. @data2day
Elegantes In-Memory Computing mit Apache Ignite und Kubernetes. @data2day
 
A Hitchhiker’s Guide to the Cloud Native Stack. #DevoxxPL
A Hitchhiker’s Guide to the Cloud Native Stack. #DevoxxPLA Hitchhiker’s Guide to the Cloud Native Stack. #DevoxxPL
A Hitchhiker’s Guide to the Cloud Native Stack. #DevoxxPL
 
Everything-as-code. A polyglot adventure. #DevoxxPL
Everything-as-code. A polyglot adventure. #DevoxxPLEverything-as-code. A polyglot adventure. #DevoxxPL
Everything-as-code. A polyglot adventure. #DevoxxPL
 
Per Anhalter durch den Cloud Native Stack. #SEACONHH
Per Anhalter durch den Cloud Native Stack. #SEACONHHPer Anhalter durch den Cloud Native Stack. #SEACONHH
Per Anhalter durch den Cloud Native Stack. #SEACONHH
 
Everything-as-code. Ein polyglottes Abenteuer. #jax2017
Everything-as-code. Ein polyglottes Abenteuer. #jax2017Everything-as-code. Ein polyglottes Abenteuer. #jax2017
Everything-as-code. Ein polyglottes Abenteuer. #jax2017
 
Everything-as-code. Eine vielsprachige Reise. #javaland
Everything-as-code. Eine vielsprachige Reise. #javalandEverything-as-code. Eine vielsprachige Reise. #javaland
Everything-as-code. Eine vielsprachige Reise. #javaland
 
Everything as-code. Polyglotte Entwicklung in der Praxis. #oop2017
Everything as-code. Polyglotte Entwicklung in der Praxis. #oop2017Everything as-code. Polyglotte Entwicklung in der Praxis. #oop2017
Everything as-code. Polyglotte Entwicklung in der Praxis. #oop2017
 
Per Anhalter durch den Cloud Native Stack (Extended Edition) #oop2017
Per Anhalter durch den Cloud Native Stack (Extended Edition) #oop2017Per Anhalter durch den Cloud Native Stack (Extended Edition) #oop2017
Per Anhalter durch den Cloud Native Stack (Extended Edition) #oop2017
 
Der Cloud Native Stack in a Nutshell. #CloudExpoEurope
Der Cloud Native Stack in a Nutshell. #CloudExpoEuropeDer Cloud Native Stack in a Nutshell. #CloudExpoEurope
Der Cloud Native Stack in a Nutshell. #CloudExpoEurope
 
A Hitchhiker’s Guide to the Cloud Native Stack. #ContainerConf
A Hitchhiker’s Guide to the Cloud Native Stack. #ContainerConfA Hitchhiker’s Guide to the Cloud Native Stack. #ContainerConf
A Hitchhiker’s Guide to the Cloud Native Stack. #ContainerConf
 
Secure Architecture and Programming 101
Secure Architecture and Programming 101Secure Architecture and Programming 101
Secure Architecture and Programming 101
 
Automotive Information Research driven by Apache Solr
Automotive Information Research driven by Apache SolrAutomotive Information Research driven by Apache Solr
Automotive Information Research driven by Apache Solr
 
Automotive Information Research driven by Apache Solr
Automotive Information Research driven by Apache SolrAutomotive Information Research driven by Apache Solr
Automotive Information Research driven by Apache Solr
 
Kubernetes 101 and Fun
Kubernetes 101 and FunKubernetes 101 and Fun
Kubernetes 101 and Fun
 

Kürzlich hochgeladen

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Kürzlich hochgeladen (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 

A Hitchhiker’s Guide to the Cloud Native Stack. #CDS17

  • 1. Mario-Leander Reimer mario-leander.reimer@qaware.de @LeanderReimer A Hitchhiker‘s Guide to the Cloud Native Stack Hamburg, 20. June 2017
  • 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. Let‘s talk about Cloud Native Applications. 3
  • 4. DISRUPT 4 CLOUD NATIVE APPLICATIONS INDUSTRIALIZE OPEX SAVINGS (automation & utilization) ANTIFRAGILITYHYPERSCALE TRAFFIC, DATA, FEATURES DEVOPS & CONTINUOUS DELIVERY
  • 5. BUILT AND COMPOSED AS MICROSERVICES 3KEYPRINCIPLES 5 CLOUD NATIVE APPLICATIONS PACKAGED AND DISTRIBUTED IN CONTAINERS DYNAMICALLY EXECUTED IN THE CLOUD
  • 6. Robert A. Heinlein, 1966, The Moon Is a Harsh Mistress „There ain’t no such thing as a free lunch.“
  • 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. 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. 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. 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.
  • 12. Specific Cloud Native Stack with Spring Cloud and K8s. 12
  • 13. (1) Microservices (2) Containerization (3) Composition (4) Orchestration The 4 Phases of Cloud Native Application Development. 13
  • 19. Bad News. 19 Very long release cycles. Limited scalability.
  • 21. 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
  • 23. The obvious answer: Decomposition. 23
  • 24. 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
  • 25. 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
  • 26. A simple Zwitscher microservices using Spring Cloud. 26 https://github.com/qaware/hitchhikers-guide-cloudnative
  • 28. 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
  • 29. 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
  • 30. 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
  • 31. 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.
  • 33. 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?
  • 34. 34
  • 35. Conceptual View on Infrastructure Composition. 35
  • 36. 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
  • 38. 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
  • 39. Conceptual View on Kubernetes Building Blocks. 39
  • 40. 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
  • 41. Single or Multi Container Pods? 41
  • 44. 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
  • 45. 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
  • 46. # 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
  • 47. 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
  • 48. 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
  • 49.
  • 50. 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.
  • 51. 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