Brought to you by... What is... Server for running and managing - - PowerPoint PPT Presentation

brought to you by what is server for running and managing
SMART_READER_LITE
LIVE PREVIEW

Brought to you by... What is... Server for running and managing - - PowerPoint PPT Presentation

in the belly of the Brought to you by... What is... Server for running and managing Linux containers. What are Linux containers? Para-virtualized Linux instances. Why not regular virtualization? slooooooow gigantic images


slide-1
SLIDE 1

in the belly of the

slide-2
SLIDE 2

Brought to you by...

slide-3
SLIDE 3

What is...

Server for running and managing Linux containers.

slide-4
SLIDE 4

What are Linux containers?

Para-virtualized Linux instances.

slide-5
SLIDE 5

Why not regular virtualization?

  • slooooooow
  • gigantic images
  • aggressive resource allocation
  • bad API
slide-6
SLIDE 6

Key concepts

  • image (immutable, no state)
  • container (has state)

Container is the running image.

slide-7
SLIDE 7

Docker awesomeness #1

Commands.

slide-8
SLIDE 8

Docker awesomeness #2

Layers.

WAR Tomcat JRE Ubuntu base

slide-9
SLIDE 9

Docker awesomeness #3

Registries.

slide-10
SLIDE 10

Docker awesomeness #4

Build once. Deploy everywhere!

slide-11
SLIDE 11

Dockerfiles

“Recipes” for the new images.

FROM ubuntu EXPOSE 8080 RUN apt-get install java RUN mkdir /jars ADD target/app.jar /jars/ CMD ["java", "-jar", "/jars/app.jar"]

slide-12
SLIDE 12

Create new image in the local repo

$ docker build -t com.me/app:1.0 $ docker run -t com.me/app:1.0

slide-13
SLIDE 13

Apache Camel

Framework that routes messages like crazy.

slide-14
SLIDE 14

How to deploy Camel?

  • Karaf (JBoss Fuse, ServiceMix, Talend ESB)
  • Tomcat
  • WildFly (JBoss EAP)
  • standalone/embeded
  • Akka plugin
  • Grails plugin
  • Spring Boot
slide-15
SLIDE 15

Camel and Docker

How to split it? What should I dockerize?

slide-16
SLIDE 16

Messaging architecture in a nutshell

slide-17
SLIDE 17

Concrete messaging architecture

slide-18
SLIDE 18
slide-19
SLIDE 19

Dockerized example

slide-20
SLIDE 20

In-endpoint route

from(“netty-http:http://0.0.0.0:18080”). setBody(randomUUID()). inOnly("jms:invoices"); ... new ActiveMQConnectionFactory("tcp://amqbroker:6162")

slide-21
SLIDE 21

Processing route

from("jms:invoices"). setBody(). groovy("new Invoice(request.body,currentTimeMillis())"). to("mongodb:mongo?...operation=insert"); ... new ActiveMQConnectionFactory("tcp://amqbroker:6162"); ... new MongoClient("mongodb");

slide-22
SLIDE 22

How can I get database images?

docker run -d -p 27017:27017

  • -name mongodb dockerfile/mongodb

Provided by database community/vendor.

slide-23
SLIDE 23

How can I put fresh jar into image?

Docker Maven plugin by Roland ‘Jolokia’ Huß

slide-24
SLIDE 24

How to bootstrap Camel?

  • no Karaf bundle activators
  • no server (Tomcat, etc.)
  • how can we start CamelContext?
slide-25
SLIDE 25

Custom class with the main method

slide-26
SLIDE 26

Spring Boot for Camel

http://projects.spring.io/spring-boot

slide-27
SLIDE 27

Camel + Spring Boot: step #1

Take a Spring Boot fat jar.

slide-28
SLIDE 28

Camel + Spring Boot: step #2

Add camel-spring-boot jar to your classpath.

slide-29
SLIDE 29

Camel + Spring Boot: step #3

Add Camel route to your classpath.

slide-30
SLIDE 30

Camel + Spring Boot: step #4

Dockerize your fat jar and run it!

slide-31
SLIDE 31

ENV-centric runtime configuration

# override endpoint definition via ENV variable docker run -e FROM=jms:queue -it my-springboot-camel-app # run with the given Spring profile docker run -e spring.profiles.active=production -it my- springboot-camel-app

slide-32
SLIDE 32

Monitoring

Expose JMX via REST with the Jolokia base image.

slide-33
SLIDE 33

Kubernetes

  • orchestration of many Docker containers
  • ...and many Docker servers!
  • logical container groups (pods)
  • auto-scaling
  • wiring your Docker stuff together
slide-34
SLIDE 34

Thank you!