90
Apache Mesos & Marathon Framework Gerenciando remotamente recursos e aplicações on-premises Pedro Arthur P. R. Duarte [email protected]

TDC2016POA | Trilha Infraestrutura - Apache Mesos & Marathon: gerenciando remotamente recursos e aplicações on premises

Embed Size (px)

Citation preview

Apache Mesos &Marathon FrameworkGerenciando remotamente recursose aplicações on-premises

Pedro Arthur P. R. [email protected]

Redes TCP/IP, SDN & NFV

2

Alguém lembra das camadas?

Physical

Link

Network

{Media Layers

Transport

Session

Application

}Host Layers

3

Alguém lembra das camadas?

Physical

Link

Network

{Media Layers

Transport

Session

Application

}Host Layers

3

Alguém lembra das camadas?

Physical

Link

Network

{Media Layers

Transport

Session

Application

}Host Layers

3

Alguém lembra das camadas?

Physical

Link

Network

{Media Layers

Transport

Session

Application

}Host Layers

3

Alguém lembra das camadas?

Physical

Link

Network

{Media Layers

Transport

Session

Application

}Host Layers

3

Inovação e Evolução das Redes

Physical

Link

Network

Transport

Session

Application

Inovation/EvolutionNumber of Protocols

Adaptions tonew technologies

Addressing newuse cases

Signaling techniquesPhysics evlotution

Addressing scalabilty requirements

Minor adjustmentsin techniques

Mostly impossibleto avoid TCP/IP

4

Inovação e Evolução das Redes

Physical

Link

Network

Transport

Session

Application

Inovation/EvolutionNumber of Protocols

Adaptions tonew technologies

Addressing newuse cases

Signaling techniquesPhysics evlotution

Addressing scalabilty requirements

Minor adjustmentsin techniques

Mostly impossibleto avoid TCP/IP

4

Inovação e Evolução das Redes

Physical

Link

Network

Transport

Session

Application

Inovation/EvolutionNumber of Protocols

Adaptions tonew technologies

Addressing newuse cases

Signaling techniquesPhysics evlotution

Addressing scalabilty requirements

Minor adjustmentsin techniques

Mostly impossibleto avoid TCP/IP

4

Inovação e Evolução das Redes

Physical

Link

Network

Transport

Session

Application

Inovation/EvolutionNumber of Protocols

Adaptions tonew technologies

Addressing newuse cases

Signaling techniquesPhysics evlotution

Addressing scalabilty requirements

Minor adjustmentsin techniques

Mostly impossibleto avoid TCP/IP

4

Inovação e Evolução das Redes

Physical

Link

Network

Transport

Session

Application

Inovation/EvolutionNumber of Protocols

Adaptions tonew technologies

Addressing newuse cases

Signaling techniquesPhysics evlotution

Addressing scalabilty requirements

Minor adjustmentsin techniques

Mostly impossibleto avoid TCP/IP

4

Inovação e Evolução das Redes

Physical

Link

Network

Transport

Session

Application

Inovation/EvolutionNumber of Protocols

Adaptions tonew technologies

Addressing newuse cases

Signaling techniquesPhysics evlotution

Addressing scalabilty requirements

Minor adjustmentsin techniques

Mostly impossibleto avoid TCP/IP

4

Hardware Ossificado

Packet Switching Hardware

Hardware Abstraction Layer

Feature 0 Feature N

{Mostly bloated to deal withprotocols' requirements

{Vendorized withoutAPIs or any kind ofcustomization facility

{Thousand oflines of code

More than 6k standards(IETF, ITU-T, IEEE, etc)

5

Hardware Ossificado

Packet Switching Hardware

Hardware Abstraction Layer

Feature 0 Feature N

{Mostly bloated to deal withprotocols' requirements

{Vendorized withoutAPIs or any kind ofcustomization facility

{Thousand oflines of code

More than 6k standards(IETF, ITU-T, IEEE, etc)

5

Hardware Ossificado

Packet Switching Hardware

Hardware Abstraction Layer

Feature 0 Feature N

{Mostly bloated to deal withprotocols' requirements

{Vendorized withoutAPIs or any kind ofcustomization facility

{Thousand oflines of code

More than 6k standards(IETF, ITU-T, IEEE, etc)

5

Hardware Ossificado

Packet Switching Hardware

Hardware Abstraction Layer

Feature 0 Feature N

{Mostly bloated to deal withprotocols' requirements

{Vendorized withoutAPIs or any kind ofcustomization facility

{Thousand oflines of code

More than 6k standards(IETF, ITU-T, IEEE, etc)

5

Rede Ossificada

Packet Switching Hardware

Hardware Abstraction Layer

Feature 0 Feature N

Packet Switching Hardware

Hardware Abstraction Layer

Feature 0 Feature N

Packet Switching Hardware

Hardware Abstraction Layer

Feature 0 Feature N

Packet Switching Hardware

Hardware Abstraction Layer

Feature 0 Feature N

Packet Switching Hardware

Hardware Abstraction Layer

Feature 0 Feature N

Packet Switching Hardware

Hardware Abstraction Layer

Feature 0 Feature N

Packet Switching Hardware

Hardware Abstraction Layer

Feature 0 Feature N

Packet Switching Hardware

Hardware Abstraction Layer

Feature 0 Feature N

Packet Switching Hardware

Packet Switching Hardware

Packet Switching Hardware

Packet Switching HardwarePacket Switching Hardware

Packet Switching Hardware

Packet Switching Hardware

Packet Switching Hardware

6

Rede Ossificada

Packet Switching Hardware

Hardware Abstraction Layer

Feature 0 Feature N

Packet Switching Hardware

Hardware Abstraction Layer

Feature 0 Feature N

Packet Switching Hardware

Hardware Abstraction Layer

Feature 0 Feature N

Packet Switching Hardware

Hardware Abstraction Layer

Feature 0 Feature N

Packet Switching Hardware

Hardware Abstraction Layer

Feature 0 Feature N

Packet Switching Hardware

Hardware Abstraction Layer

Feature 0 Feature N

Packet Switching Hardware

Hardware Abstraction Layer

Feature 0 Feature N

Packet Switching Hardware

Hardware Abstraction Layer

Feature 0 Feature N

Packet Switching Hardware

Packet Switching Hardware

Packet Switching Hardware

Packet Switching HardwarePacket Switching Hardware

Packet Switching Hardware

Packet Switching Hardware

Packet Switching Hardware

6

Separação de Planos

Networking Operating System

App 0 App 1 App N

Simple Packet Switching Hardware

Simple Packet Switching Hardware

Simple Packet Switching Hardware

Open HardwareInterfaces

Vendor Agnostic Standardized APIs

7

Separação de Planos

Networking Operating System

App 0 App 1 App N

Simple Packet Switching Hardware

Simple Packet Switching Hardware

Simple Packet Switching Hardware

Open HardwareInterfaces

Vendor Agnostic Standardized APIs

7

Open Networking Foundation Architecture

InfrastructureLayer

Networking Device Networking Device

Networking Device Networking Device

Networking Device

Control Layer SDN ControlSoftware

Network Service A ... Network Service X

Control/DataplaneInterfaces

Application Layer

Business Application Business Application

Business Application

Business Application

Business Application

High level APIs

8

Open Networking Foundation Architecture

InfrastructureLayer

Networking Device Networking Device

Networking Device Networking Device

Networking Device

Control Layer SDN ControlSoftware

Network Service A ... Network Service X

Control/DataplaneInterfaces

Application Layer

Business Application Business Application

Business Application

Business Application

Business Application

High level APIs

8

Open Networking Foundation Architecture

InfrastructureLayer

Networking Device Networking Device

Networking Device Networking Device

Networking Device

Control Layer SDN ControlSoftware

Network Service A ... Network Service X

Control/DataplaneInterfaces

Application Layer

Business Application Business Application

Business Application

Business Application

Business Application

High level APIs

8

Open Networking Foundation Architecture

InfrastructureLayer

Networking Device Networking Device

Networking Device Networking Device

Networking Device

Control Layer SDN ControlSoftware

Network Service A ... Network Service X

Control/DataplaneInterfaces

Application Layer

Business Application Business Application

Business Application

Business Application

Business Application

High level APIs

8

Open Networking Foundation Architecture

InfrastructureLayer

Networking Device Networking Device

Networking Device Networking Device

Networking Device

Control Layer SDN ControlSoftware

Network Service A ... Network Service X

Control/DataplaneInterfaces

Application Layer

Business Application Business Application

Business Application

Business Application

Business Application

High level APIs

8

Open Networking Foundation Architecture

InfrastructureLayer

Networking Device Networking Device

Networking Device Networking Device

Networking Device

Control Layer SDN ControlSoftware

Network Service A ... Network Service X

Control/DataplaneInterfaces

Application Layer

Business Application Business Application

Business Application

Business Application

Business Application

High level APIs

8

Software Defined Networking (aka SDN)

Packet Switching Hardware

Packet Switching Hardware

Packet Switching Hardware

Packet Switching HardwarePacket Switching Hardware

Packet Switching Hardware

Packet Switching Hardware

Packet Switching Hardware

Hardware Abstraction Layer

Feature 0 Feature N

Hardware Abstraction Layer

Feature 0 Feature N

9

Software Defined Networking (aka SDN)

Packet Switching Hardware

Packet Switching Hardware

Packet Switching Hardware

Packet Switching HardwarePacket Switching Hardware

Packet Switching Hardware

Packet Switching Hardware

Packet Switching Hardware

Hardware Abstraction Layer

Feature 0 Feature N

Hardware Abstraction Layer

Feature 0 Feature N

9

Software Defined Networking (aka SDN)

Packet Switching Hardware

Packet Switching Hardware

Packet Switching Hardware

Packet Switching HardwarePacket Switching Hardware

Packet Switching Hardware

Packet Switching Hardware

Packet Switching Hardware

Hardware Abstraction Layer

Feature 0 Feature N

Hardware Abstraction Layer

Feature 0 Feature N

9

Hardware Middleboxes

PublicNetwork

Service Provider

Router

Firewall

10

Network Function Virtualization (aka NFV)

PublicNetwork

Service Provider

Point of PresenceMostly COTS Hardware

Virtual Appliances

11

Network Function Virtualization (aka NFV)

PublicNetwork

Service Provider

Point of PresenceMostly COTS Hardware

Virtual Appliances

11

Service Function Chaining (aka SFC)

Service Provider

PublicNetwork

1

2

3

4

5

6

7

App 0 App N

SDN Control Software

12

Service Function Chaining (aka SFC)

Service Provider

PublicNetwork

1

2

3

4

5

6

7

App 0 App N

SDN Control Software

12

Service Function Chaining (aka SFC)

Service Provider

PublicNetwork

1

2

3

4

5

6

7

App 0 App N

SDN Control Software

12

Em resumo...

Sotware Defined Networking desacopla o controle da rede doselementos que realizam o encaminhamento de pacotes e osabstraem para que possam ser utilizados por aplicações e serviços.

Network Function Virtualization transforma os tradicionaismiddleboxes dedicados em appliances de rede de propósito geralque podem ser especializados de acordo com as necessiades dasaplicações e serviços

13

Bem vindo ao Deserto do Real!

SDN + NFV

Redução de Custos

Versatilidade& Flexibilidade

Escalabilidade

14

Bem vindo ao Deserto do Real!

SDN + NFV

Redução de Custos

Versatilidade& Flexibilidade

Escalabilidade

14

Bem vindo ao Deserto do Real!

SDN + NFV

Redução de Custos

Versatilidade& Flexibilidade

Escalabilidade

14

Bem vindo ao Deserto do Real!

SDN + NFV

Redução de Custos

Versatilidade& Flexibilidade

Escalabilidade

14

Novos Desafios

15

Como entregar novas aplicações/appliances?

Service Provider

PublicNetwork

SDN Control Software

App 0 App N

App (N+1)App (N+2)

16

Como entregar novas aplicações/appliances?

Service Provider

PublicNetwork

SDN Control Software

App 0 App N App (N+1)

App (N+2)

16

Como entregar novas aplicações/appliances?

Service Provider

PublicNetwork

SDN Control Software

App 0 App N App (N+1)App (N+2)

16

Como entregar novas aplicações/appliances?

Service Provider

PublicNetwork

SDN Control Software

App 0 App N App (N+1)App (N+2)

16

Como entregar novas aplicações/appliances?

Service Provider

PublicNetwork

SDN Control Software

App 0 App N App (N+1)App (N+2)

16

Apache Mesos

17

Publicação e Alocação de Recursos no Mesos

cpus(.

..) mem(...

) ports

(...) g

pus(...)

cpus(...) mem(...) ppms(...)

cpus(...) mem

(...)cpus

(...)

mem

(...)

offer([(s1, ...), ..., (s5, ...)])offer([(

s1, ...), .

.., (s5, ...

)])

18

Publicação e Alocação de Recursos no Mesos

cpus(.

..) mem(...

) ports

(...) g

pus(...)

cpus(...) mem(...) ppms(...)

cpus(...) mem

(...)cpus

(...)

mem

(...)

offer([(s1, ...), ..., (s5, ...)])offer([(

s1, ...), .

.., (s5, ...

)])

18

Publicação e Alocação de Recursos no Mesos

cpus(.

..) mem(...

) ports

(...) g

pus(...)

cpus(...) mem(...) ppms(...)

cpus(...) mem

(...)cpus

(...)

mem

(...)

offer([(s1, ...), ..., (s5, ...)])offer([(

s1, ...), .

.., (s5, ...

)])

18

Publicação e Alocação de Recursos no Mesos

cpus(.

..) mem(...

) ports

(...) g

pus(...)

cpus(...) mem(...) ppms(...)

cpus(...) mem

(...)cpus

(...)

mem

(...)

offer([(s1, ...), ..., (s5, ...)])offer([(

s1, ...), .

.., (s5, ...

)])

18

Publicação e Alocação de Recursos no Mesos

cpus(.

..) mem(...

) ports

(...) g

pus(...)

cpus(...) mem(...) ppms(...)

cpus(...) mem

(...)cpus

(...)

mem

(...)

offer([(s1, ...), ..., (s5, ...)])offer([(

s1, ...), .

.., (s5, ...

)])

18

Publicação e Alocação de Recursos no Mesos

cpus(.

..) mem(...

) ports

(...) g

pus(...)

cpus(...) mem(...) ppms(...)

cpus(...) mem

(...)cpus

(...)

mem

(...)

offer([(s1, ...), ..., (s5, ...)])offer([(

s1, ...), .

.., (s5, ...

)])

18

Mesos: Publicando Recursos

[

{ ... },

{

"name": "ppms",

"type": "SCALAR",

"scalar": {

"value": 10000000

}

},

{

"name": "processors",

"type": "SCALAR",

"set": {

"item": 24

}

}

]

19

Mesos: Publicando Atributos

$ cat /etc/mesos-slave/attributes

ixgbe:1,pf_ring_dna:1,so_busy_poll:1,flowdirector:1

20

Framework Marathon

Escalabilidade Fácil set-up

Health CheckAPIs & Event Bus

21

Framework Marathon

Escalabilidade

Fácil set-up

Health CheckAPIs & Event Bus

21

Framework Marathon

Escalabilidade Fácil set-up

Health CheckAPIs & Event Bus

21

Framework Marathon

Escalabilidade Fácil set-up

Health Check

APIs & Event Bus

21

Framework Marathon

Escalabilidade Fácil set-up

Health CheckAPIs & Event Bus

21

Marathon Example: Application Payload

{

"id": "snort -ips",

"instances": 1,

"cpus": 1,

"mem": 1024,

"ppms": 133334 ,

"processors": 1,

"constraints": [

["ixgbe", "CLUSTER", "true"],

["flowdirector", "CLUSTER", "true"]],

"container": { ... }

}

22

Marathon Example: HTTP API

Instanciar o novo serviço:$ curl -XPOST http://marathon:8080/v2/apps -d @service.json

HTTP/1.1 201 Created

Content-Type: application/json

Location: http://marathon:8080/v2/apps/snort-ips

Server: Jetty(8.y.z-SNAPSHOT)

Transfer-Encoding: chunked

{ ... }

Atualizar um serviço existente:$ curl -XPUT http://marathon:8080/v2/apps/snort-ips -d @service.json

23

Marathon Example: Health Checking

"healthChecks": [

{

"protocol": "HTTP",

"path": "/v1/ping",

"portIndex": 0,

"gracePeriodSeconds": 3,

"intervalSeconds": 5,

"maxConsecutiveFailures": 3

}

]

24

Em resumo...

Apache Mesos abstrai os recursos de hardware e provê interfacespara gerência e alocação desses recursos.

Marathon gerencia o ciclo de vida de long-lived processes atravésdo recursos oferecidos por um cluster Mesos.

25

Mas nem tudo são flores...

26

Overhead de Infraestrutura

Service Provider

PublicNetwork

SDN Control Software

App 0 App N

SDN Control Software

App 0 App N

SDN Control Software

App 0 App N

27

Overhead de Infraestrutura

Service Provider

PublicNetwork

SDN Control Software

App 0 App N

SDN Control Software

App 0 App N

SDN Control Software

App 0 App N

27

Overhead de Infraestrutura

Service Provider

PublicNetwork

SDN Control Software

App 0 App N

SDN Control Software

App 0 App N

SDN Control Software

App 0 App N

27

Overhead de Infraestrutura

Service Provider

PublicNetwork

SDN Control Software

App 0 App N

SDN Control Software

App 0 App N

SDN Control Software

App 0 App N

27

Overhead de Infraestrutura

Service Provider

PublicNetwork

SDN Control Software

App 0 App N

SDN Control Software

App 0 App N

SDN Control Software

App 0 App N

27

Controle off-premises

28

Movendo o máximo para a cloud

Service ProviderSDN Control Software

App 0 App N

CloudProvider

29

Movendo o máximo para a cloud

Service ProviderSDN Control Software

App 0 App N

CloudProvider

29

Movendo o máximo para a cloud

Service ProviderSDN Control Software

App 0 App N

CloudProvider

29

Movendo o máximo para a cloud

Service ProviderSDN Control Software

App 0 App N

CloudProvider

29

Premises: vazão de dados

CloudProvider

Client'sNetwork

ISP-to-ISP L2/L3 Network

1Gbps < tx/rx < 10Gbps 1Gbps < tx/rx < 10Gbps

max(tx/rx) = 1Gbps

30

Premises: vazão de dados

CloudProvider

Client'sNetwork

ISP-to-ISP L2/L3 Network

1Gbps < tx/rx < 10Gbps 1Gbps < tx/rx < 10Gbps

max(tx/rx) = 1Gbps

30

Premises: vazão de dados

CloudProvider

Client'sNetwork

ISP-to-ISP L2/L3 Network

1Gbps < tx/rx < 10Gbps 1Gbps < tx/rx < 10Gbps

max(tx/rx) = 1Gbps

30

Premises: latência

CloudProvider

Client'sNetwork

ISP-to-ISP L2/L3 Network

avg(rtt) ~ 1ms avg(rtt) ~ 1ms

avg(rtt) > 30ms

31

Problemas em aberto

32

Tolerância a Falhas do Canal de Controle

Service ProviderSDN Control Software

App 0 App N

CloudProvider

XXX

X

33

Tolerância a Falhas do Canal de Controle

Service ProviderSDN Control Software

App 0 App N

CloudProvider

X

XX

X

33

Tolerância a Falhas do Canal de Controle

Service ProviderSDN Control Software

App 0 App N

CloudProvider

XXX

X

33

Health Check "complexo"

Service ProviderSDN Control Software

App 0 App N

PublicNetwork

1

2

3

4 5

1

45

34

Health Check "complexo"

Service ProviderSDN Control Software

App 0 App N

PublicNetwork

1

2

3

4 5

1

45

34

Health Check "complexo"

Service ProviderSDN Control Software

App 0 App N

PublicNetwork

1

2

3

4 5

1

45

34

Alocação de recursos arbitrários no Marathon

Support for arbitrary resources #375

https://github.com/mesosphere/marathon/issues/375

35

Isso é tudo, Pessoal...

36

These aren’t the droids you’re looking for

$ # yank 6 lines from the empty line

37