integration in the cloud, by rob davies

88
Integration in The Cloud Rob Davies 2016

Upload: judy-breedlove

Post on 12-Jan-2017

128 views

Category:

Software


4 download

TRANSCRIPT

Page 1: Integration in the Cloud, by Rob Davies

Integration in The Cloud

Rob Davies2016

Page 2: Integration in the Cloud, by Rob Davies

2

Rob Davies

• Director of Middleware Engineering for iPaaS, Technical Director for Fuse

• Herd the fabric8 cats• Over 20 years experience of developing

large scale solutions for telcos and finance

• Creator of ActiveMQ and ServiceMix• Committer on open source projects,

including fabric8, Apache Camel and other stuff …

Page 3: Integration in the Cloud, by Rob Davies

3

Fabric8 – some

background

Page 4: Integration in the Cloud, by Rob Davies

4

Camel’s Journey to Microservices

Self-Service,On-Demand,

Elastic,Infrastructure

asCode

(Cloud)

Re-Org toDevOps

AutomationPuppet, Chef,

Ansibleand/or

ContainersFabric8 v1(2010 ish)

Page 5: Integration in the Cloud, by Rob Davies

5

Fabric8: Cloud Engine

Agent

RuntimeRegistry

Configuration

coordination

Monitoring

Agent

Agent

Fabric v1

Page 6: Integration in the Cloud, by Rob Davies

6

Camel’s Journey to Microservices

CI & CDDeployment

Pipeline

OneMicroservice

SiliconValley

DotComStartup

Meanwhile …

Page 7: Integration in the Cloud, by Rob Davies

7

We had to pivot and go Kubernetes

and containers

Page 8: Integration in the Cloud, by Rob Davies

8

Why do you want to run your application inside containers?

Page 9: Integration in the Cloud, by Rob Davies

9

● Lightweight footprint and minimal overhead,● Portability across machines,● Simplify DevOps practices,● Speeds up Continuous Integration,● Empower Microservices Architectures.● Isolation

ContainerAdvantages

Page 10: Integration in the Cloud, by Rob Davies

10

Kubernetes: Container Orchestration

• Inspired by Google’s experience with Orchestration• Automatic bin packing• Self healing• Horizontal Scaling• Service Discovery and load balancing• Automated rollouts and rollbacks• Secret and Configuration management• Storage orchestration• 2 years old – 30,000 commits

Page 11: Integration in the Cloud, by Rob Davies

11

Master

API Server

Service Layer

VirtualPhysical Private Public

PersistentStorage

Node Node

Logger

Node

Node Node Node

Dev

Ops

SCM(Git/Svn)

CI/CD

Automation

Routing LayerRegistry

SDN Overlay Network

Controllers- Scheduler- Replication- Services- Builds- Routes- Deployment

Kubernetes

OpenShift- Deployments- Builds- ImageStreams

Page 12: Integration in the Cloud, by Rob Davies

12

Page 13: Integration in the Cloud, by Rob Davies

13

Page 14: Integration in the Cloud, by Rob Davies

14

Open Source community

Version 1.3.x

Hosted on GitHub

800+ contributors

34,000+ commits

16,000+ GitHub stars

Red Hat

HP

IBM

Mesosphere

Microsoft

Project Partners

CoreOS

Pivotal

SaltStack

VMWare

http://kubernetes.io/

https://github.com/kubernetes/kubernetes

Page 15: Integration in the Cloud, by Rob Davies

15

Page 16: Integration in the Cloud, by Rob Davies

16

What are Microservices

Page 17: Integration in the Cloud, by Rob Davies

17

Peak of Inflated

Expectations

x

Trough of Disillusionment

Serious Hotness

Techology Trigger

Slope of Enlightenment

Page 18: Integration in the Cloud, by Rob Davies

18

Red Hat Definition

“Microservices is an architectural approach, that emphasizes the decomposition of applications into single-purpose, loosely coupled services managed by cross-functional teams, for delivering and maintaining complex software systems with the velocity and quality required by today’s digital business”

Page 19: Integration in the Cloud, by Rob Davies

19

What does that mean ?

Application is composed of multiple servicesUNIX style – do one thing, and one thing well – in one

process.Language agnosticAPI is important

Organize teams around delivery of a service

Page 20: Integration in the Cloud, by Rob Davies

20

Microservices characteristics …

1. Deployment Independence - updates to an individual microservice have no negative impact to any other component of

the system. Optimized for replacement

2. API Focused

3. Do one thing well - small enough and no smaller

4. Fit in your head

5. Decentralized Data Management

Page 21: Integration in the Cloud, by Rob Davies

21

How to do Microservices ?

Page 22: Integration in the Cloud, by Rob Davies

22

Big Team, Big Effort, High Ceremony DeploymentCode offers no value until it survives in production

24 Weeks

Monolithic System

BusinessChange

Requests

Page 23: Integration in the Cloud, by Rob Davies

23

Programmers(18) Operators

(6)

DBAs(3)

Project Managers

(2)

Business Analysts

(4)

QualityAssurance

(6)

Compliance(2)

Page 24: Integration in the Cloud, by Rob Davies

24

Page 25: Integration in the Cloud, by Rob Davies

25

Automated TestingContinuous Integration & Build Automation

24 Weeks 8 of 3 week sprints

Monolithic System

12 Weeks

BusinessChange

Requests

Page 26: Integration in the Cloud, by Rob Davies

26

Linux Containers (e.g. docker)Automation via Orchestration (allows Devs to become

DevOps)Infrastructure as Code

24 Weeks 8 of 3 week sprints

Monolithic System

12 Weeks 9 Weeks

BusinessChange

Requests

Page 27: Integration in the Cloud, by Rob Davies

27

Continuous Delivery Pipeline

24 Weeks 8 of 3 week sprints

Monolithic System

612 Weeks 9 Weeks

BusinessChange

Requests

Page 28: Integration in the Cloud, by Rob Davies

28

Zero-Downtime Deployment Strategies (Blue/Green, Canary)

24 Weeks 8 of 3 week sprints

Monolithic System

6 312 Weeks 9 Weeks

BusinessChange

Requests

Page 29: Integration in the Cloud, by Rob Davies

29

24 Weeks 8 of 3 week sprints

Monolithic System

6 3 1 112 Weeks 9 Weeks 1

BusinessChange

Requests

Page 30: Integration in the Cloud, by Rob Davies

30

24 Weeks 8 of 3 week sprints

Monolithic System

6 3 1 112 Weeks 9 Weeks 1

Deploying faster than 3-week sprint cycles?

Patches to your application as well as your “stack” are also deployments.

BusinessChange

Requests

Page 31: Integration in the Cloud, by Rob Davies

31

Microservices Fallacies…

From:http://basho.com/posts/technical/microservices-please-dont/

Page 32: Integration in the Cloud, by Rob Davies

32

#1 – Cleaner Code

Well, less code to go wrong, but

Its not going to magically fix poor engineers

Page 33: Integration in the Cloud, by Rob Davies

33

#2 – Its Easier

Only doing one thing, so it should be easier - but

The complexity still exists – its moved somewhere else – the platform

Page 34: Integration in the Cloud, by Rob Davies

34

#3 – Its Faster

Easier to optimize an isolated service, but

Network is always going to be slower than co-located code

Page 35: Integration in the Cloud, by Rob Davies

35

#5 – Better for Scalability

Microservices are better for scalability, but

Only if you carefully consider what should be architected as a Microservice in the first place

Page 36: Integration in the Cloud, by Rob Davies

36

Microservices In reality

Page 37: Integration in the Cloud, by Rob Davies

37

Its fine to mix and match monoliths and MicroservicesSome things are better left untouched

Choose carefully what to build as a Microservice

Don’t do it yourself:

Page 38: Integration in the Cloud, by Rob Davies

38

Fabric8: Makes cloud stuff

easy – and we are building an

iPaaS too

Page 39: Integration in the Cloud, by Rob Davies

39

Page 40: Integration in the Cloud, by Rob Davies

40

Page 41: Integration in the Cloud, by Rob Davies

41

Page 42: Integration in the Cloud, by Rob Davies

42

Page 43: Integration in the Cloud, by Rob Davies

43

Microservices Platform – the Foundations

• Runtime Registry• Logging• Security• Deployment• Scalability

• Loosely coupled• Resilient• Temporal

From the platform: The services:

Page 44: Integration in the Cloud, by Rob Davies

44

Page 45: Integration in the Cloud, by Rob Davies

45

iPaaS 2.0 Microservices Platform

• Built on top of OpenShift

• Provides additional services to generate, build and test integration services

• Integration Services use Apache Camel:– deployed in Spring Boot– In a Docker Container

Page 46: Integration in the Cloud, by Rob Davies

46

iPaaS 2.0: Microservices Platform

Citizen DeveloperiPaaS Console

Expert DeveloperCan view

what’s under the

hood

AdministratorCan look at

InfrastructureOpenShift Dedicated

Component Catalog

Integration Editor

Funktion Editor

Data Mapper

ArtifactRepository

Git Repository

Application Logging

Application Metrics

Tracing Project Wizards

Code Quality

AutomatedTesting

Circuit Breaker Social

API Management

Page 47: Integration in the Cloud, by Rob Davies

47

Agility: Integrated CI/CD

• Continuous Deployment automatically, with jenkins pipelines for your integration services

• Automated tests• Hooks for manual

approval before production

Page 48: Integration in the Cloud, by Rob Davies

48

What Do we need from our

Microservices Platform?

Page 49: Integration in the Cloud, by Rob Davies

49

Logging …

Page 50: Integration in the Cloud, by Rob Davies

50

Why Logging ?

What a system is doing

What happened

A record of Actions and Outcomes

Page 51: Integration in the Cloud, by Rob Davies

51

Traditional Application Logging

Logging strategies defined by the systemStorage and routing defined by the system

Write to local FileCentralizing

Custom configurator per system

Page 52: Integration in the Cloud, by Rob Davies

52

Container Logging

Container standardize Management of your ProcessesSo lets standardize Logging

Logs to STDOUT & STDERRCaptured by Execution EnvironmentRouted by Execution Environment

Containers are Ephemeral

CENTRALIZE

Page 53: Integration in the Cloud, by Rob Davies

53

Contextual Logging

Logs are for machines, not humansContext gives logs power

Structured Logging

Page 54: Integration in the Cloud, by Rob Davies

54

Structured Logging Example

{"STATUS": "200”,"REQUEST": "GET /apache_pb.gif

HTTP/1.0”,"HOST": ”127.0.0.1”,"REFERER": http"REFERER":

http://www.example.com/"REFERER": http://www.example.com/start.html,

"USER": "frank”,"TIME": "10/Oct/2000:13:55:36

-0700”,"USERAGENT": "Mozilla/4.08 [en]

(Win98; I ;Nav)“,"IDENTITY": "-”,"SIZE": "2326”}

Context added by the logging process

Machine ReadableFilterable and Searchable

Page 55: Integration in the Cloud, by Rob Davies

55

CENTRALIZE

Page 56: Integration in the Cloud, by Rob Davies

56

Deployment is Easy

RC and Service for ElasticSearchRC and Service for Kibana

daemon set for fluentd

Every Container’s Log is Centralized

Page 57: Integration in the Cloud, by Rob Davies

57

Page 58: Integration in the Cloud, by Rob Davies

58

Can we do the same for Metrics ?

Page 59: Integration in the Cloud, by Rob Davies

59

Why collect Metrics ?

Logs tell you what’s happeningMetrics measure behavior

Measure improvement of change

Adapt to runtime changes – e.g. auto-scaling

Page 60: Integration in the Cloud, by Rob Davies

60

Kubernetes Infra … Kublet

Runs on each node

Manages Pod and container lifecycle

Key Elements:

• Docker client

• cAdvisor client• Etcd client

• Docker client

• Root directory

masterNode

NodeNode

NodeNode

Node

Pod

Container

Container

Pod

Container

Container

Kublet

Page 61: Integration in the Cloud, by Rob Davies

61

cAdvisor

Daemon that collects, aggregates processes and exports information about containers

Collects metrics for both system components and user containers

Page 62: Integration in the Cloud, by Rob Davies

62

Heapster

One per cluster

Aggregates all metrics exposed by cAdvisor

Has Pluggable backend for persistent storage:

• InfluxDB

• Kafka

• Hawkular etc.

masterNode

NodeNode

NodeNode

Kublet

Heapster

Page 63: Integration in the Cloud, by Rob Davies

63

Microservices Platform – Application Metrics

• Historical metrics required for diagnosis,trends, and auto-scaling

• Uses Prometheus for storage

• Grafana for front end

Page 64: Integration in the Cloud, by Rob Davies

64

In Summary

Logs tell you what’s happeningMetrics measure how it happened

Use Microservices to capture

CENTRALIZE

Page 65: Integration in the Cloud, by Rob Davies

65

What about Tracing ??

Page 66: Integration in the Cloud, by Rob Davies

66

Why do Tracing?

Latency optimization – where are the bottlenecks ?Root cause analysis

Measure improvement of change

Continuous Analysis for Continuous Improvement

Page 67: Integration in the Cloud, by Rob Davies

67

Open Tracing

Vendor neutral Open APIs

Support for Go, Python, Java and Javascript

No lock in, easy to develop, easy to switch

Page 68: Integration in the Cloud, by Rob Davies

68

Microservices Platform – Tracing: Zipkin

• Zipkin: distributed tracing framework:

• Manages both the tracing and lookup of the data.

• All routes for iPaaS use camel-zipkin to record incoming and outgoing Camel messages

• OpenTracing

Page 69: Integration in the Cloud, by Rob Davies

69

Microservices Platform – Tracing: Zipkin Architecture

Page 70: Integration in the Cloud, by Rob Davies

70

Wait – there’s more

Page 71: Integration in the Cloud, by Rob Davies

71

Writing an Integration easily: Funktion

Page 72: Integration in the Cloud, by Rob Davies

72

Funktion

Event driven lambda style Microservices, built on top of Kubernetes

Polygot - supports Java, Node.js, Groovy, Kotlin, Go …Supports hundreds of trigger endpoint URLs

Trigger endpoint defined in funktion.yml:

rules: - trigger: http://0.0.0.0:8080 action: io.fabric8.funktion.sample.Main

Page 73: Integration in the Cloud, by Rob Davies

73

Funktion supports same URLs as Camel:

Page 74: Integration in the Cloud, by Rob Davies

74

Funktion rules:

rules: name: foo - trigger: URL action: io.fabric8.funktion.sample.Producer::message chain: URL

Optional code to call

Optional

Mandatory – the input

Out – can have multiple of these

Page 75: Integration in the Cloud, by Rob Davies

75

Page 76: Integration in the Cloud, by Rob Davies

76

Page 77: Integration in the Cloud, by Rob Davies

77

Page 78: Integration in the Cloud, by Rob Davies

78

Funktion how it works:

Page 79: Integration in the Cloud, by Rob Davies

79

Funktion how it works:

http://

Pod

Page 80: Integration in the Cloud, by Rob Davies

80

Funktion: part of the Fabric8 family

Code: https Code: https://github.com/fabric8io/ Code: https://github.com/fabric8io/funktion

Examples: in quickstarts: https://github.com/fabric8-Examples: in quickstarts: https://github.com/fabric8-quickstarts

• funktion-java-example• funktion-nodejs-example• funktion-kotlin-example• funktion-nats-example• funktion-java-kafka-example

Page 81: Integration in the Cloud, by Rob Davies

81

iPaaS:

A lot is happening under the hood …

Page 82: Integration in the Cloud, by Rob Davies

82

But … the user just sees this:

Page 83: Integration in the Cloud, by Rob Davies

83

iPaaS is being built on

fabric8 and OpenShift

Page 84: Integration in the Cloud, by Rob Davies

84

Red Hat Registry

Page 85: Integration in the Cloud, by Rob Davies

85

Page 86: Integration in the Cloud, by Rob Davies

86

SERVICE CATALOG(LANGUAGE RUNTIMES, MIDDLEWARE, DATABASES, …)

SELF-SERVICE

APPLICATION LIFECYCLE MANAGEMENT(CI / CD)

BUILD AUTOMATION DEPLOYMENT AUTOMATION

CONTAINER CONTAINERCONTAINER CONTAINER CONTAINER

NETWORKING SECURITYSTORAGE REGISTRYLOGS &

METRICS

CONTAINER ORCHESTRATION & CLUSTER MANAGEMENT(KUBERNETES)

RED HAT ENTERPRISE LINUX

CONTAINER RUNTIME & PACKAGING(DOCKER)

ATOMIC HOST

Page 87: Integration in the Cloud, by Rob Davies

87

Single Sign On By RH SSO

Integration ServicesBy JBoss Fuse

Intelligent Process Server

By JBoss BPM Suite

Real time Decision Service

By JBoss BRMS

In Memory Data GridBy JBoss Data Grid

Messaging ServicesBy JBoss A-MQ

Java EE Application Server

By JBoss EAP

TomcatBy JBoss Web Server

API ManagementData Services

By JBoss Data Virtualization