44
DevOps Night I The new IT landscape

Dev ops night i the new infrastructure landscape

Embed Size (px)

Citation preview

DevOps Night IThe new IT landscape

With evolution, came DevOps.

With DevOps, came a new

landscape...

It’s a lot of stuff, but bare with

me...

Here we have Cloud Providers:

Container-related tools:

Automation Tools:

Monitoring:

But tonight, our main focus will be:

Containers?

OS-level virtualization: Applications share

libraries while being logically isolated

It’s fast... FAST! Like, really fast!!

Containers boot in ~1 sec...

And it also saves a LOT of

space!Images are build on top of

each other, incrementally

Containers are about ISOLATION

Components are isolated, and thus,

can be spawned at will, anywhere

And DECOUPLING

Each component (e.g. Nginx, Tomcat,

Redis, Solr) has it’s own container

The DockerFile

One file to rule them all...

FROM ubuntu/trusty64

RUN apt-get update -y

RUN apt-get install -y nginx wget

COPY conf/nginx/* /etc/nginx/conf.d/

CMD [ “nginx” ]

EXPOSE 80

EXPOSE 443

FROM ubuntu/trusty64

RUN apt-get update -y

RUN apt-get install -y nginx wget

COPY conf/nginx/* /etc/nginx/conf.d/

CMD [ “nginx” ]

EXPOSE 80

EXPOSE 443

Base Image (downloaded from Docker Hub)

FROM ubuntu/trusty64

RUN apt-get update -y

RUN apt-get install -y nginx wget

COPY conf/nginx/* /etc/nginx/conf.d/

CMD [ “nginx” ]

EXPOSE 80

EXPOSE 443

Base Image (downloaded from Docker Hub)

Runs command. Generates new image

FROM ubuntu/trusty64

RUN apt-get update -y

RUN apt-get install -y nginx wget

COPY conf/nginx/* /etc/nginx/conf.d/

CMD [ “nginx” ]

EXPOSE 80

EXPOSE 443

Base Image (downloaded from Docker Hub)

Runs command. Generates new image

Runs command.

Generates new

image

FROM ubuntu/trusty64

RUN apt-get update -y

RUN apt-get install -y nginx wget

COPY conf/nginx/* /etc/nginx/conf.d/

CMD [ “nginx” ]

EXPOSE 80

EXPOSE 443

Base Image (downloaded from Docker Hub)

Runs command. Generates new image

Runs command.

Generates new

image

Copy all files from conf/nginx/

(relative to local directory) to the

container. Generates new image.

FROM ubuntu/trusty64

RUN apt-get update -y

RUN apt-get install -y nginx wget

COPY conf/nginx/* /etc/nginx/conf.d/

CMD [ “nginx” ]

EXPOSE 80

EXPOSE 443

Base Image (downloaded from Docker Hub)

Runs command. Generates new image

Runs command.

Generates new

image

Copy all files from conf/nginx/

(relative to local directory) to the

container. Generates new image.Sets default startup

command for the

container

FROM ubuntu/trusty64

RUN apt-get update -y

RUN apt-get install -y nginx wget

COPY conf/nginx/* /etc/nginx/conf.d/

CMD [ “nginx” ]

EXPOSE 80

EXPOSE 443

Base Image (downloaded from Docker Hub)

Runs command. Generates new image

Runs command.

Generates new

image

Copy all files from conf/nginx/

(relative to local directory) to the

container. Generates new image.Sets default startup

command for the

container

Configure ports 80 and 443 on

the container as “exposed” i.e.

NATed on the host OS.

Each step is a new image, built on top of

the one before.

If a step fails, the process is aborted and

can continue from the last valid image

once it’s corrected.

The Docker client

How to access Docker servers

One-upping the game a bit...

Docker Compose!

Since each component sits on a different

container, it’s safe to assume they need

to communicate, right?

So, how to do that?

Using Docker Compose!

Compose - previously known as Fig - is a tool

to coordinate multiple containers.

Simply define your containers in Dockerfiles

and the whole “environment” in docker-

compose.yaml

docker-compose.yaml:app:

build: .

links:

- redis

- elasticsearch

ports:

- “5000”:”5000”

redis:

image: redis

elasticsearch:

image: elasticsearch

Dockerfile:FROM python:2.7

WORKDIR /code

ADD . /code

RUN pip install -r requirements.txt

CMD python app.py

Example: Python web application with Redis

and ElasticSearch:

And now, the fun part ;)