introducción a docker - librecon 2016

33
Introducción a Docker 22-11-2016 LibreCon 2016 Bilbao

Upload: librecon

Post on 14-Jan-2017

48 views

Category:

Technology


3 download

TRANSCRIPT

Page 1: Introducción a Docker - LibreCon 2016

Introducción a Docker22-11-2016 LibreCon 2016 Bilbao

Page 2: Introducción a Docker - LibreCon 2016

2 / 33(C) 2016 Hopla! Software & Subsidiaries

About Us

• Only Docker Value-Added Master Reseller in Spain, Portugal and LATAM

• Only distributor for EDB in Spain, Italy & LATAM• Presence in France, Spain, Portugal, Mexico &

Colombia• We provide 24x7 Support in Spanish for:

• Docker• PostgreSQL – EDB

• 12 Engineers

Page 3: Introducción a Docker - LibreCon 2016

3 / 33(C) 2016 Hopla! Software & Subsidiaries

SUPPORT

● Break & Fix support L

1-2 ; local lang● 24x7 local languages● Proactive support w/

extensive

monitoring

LICENSES / SOLUTIONS

● Subscriptions:

EnterpriseDB,

Docker, Bacula● Management,

Monitoring &

Tooling

TRAINING

● Official + custom

EDB & Docker● Custom advanced

Enterprise training

TOOLS

● Migration solutions● Architectural

consulting &

re-engineering● Advanced / custom

functionalities

What we do

Page 4: Introducción a Docker - LibreCon 2016

4 / 33(C) 2016 Hopla! Software & Subsidiaries

Local References

Page 5: Introducción a Docker - LibreCon 2016

5 / 33(C) 2016 Hopla! Software & Subsidiaries

¿Qué es Docker?

Page 6: Introducción a Docker - LibreCon 2016

6 / 33(C) 2016 Hopla! Software & Subsidiaries

Software Containers and Docker Containers: Wikipedia• Software Containers:

Operating-system-level virtualization is a server virtualization method in which the kernel of an operating system allows the existence of multiple isolated user-space instances, instead of just one. Examples: chroot, LXC, OpenVZ, Solaris Containers (Zones), FreeBSD Jail, VMWare ThinApp

• Docker containers Designed to wrap up a piece of software in a complete filesystem that contains everything it needs to run: code, runtime, system tools, system libraries, anything you can install on a server. This guarantees that it will always run the same, regardless of the environment it is running in.

Page 7: Introducción a Docker - LibreCon 2016

7 / 33(C) 2016 Hopla! Software & Subsidiaries

Container Technology

Used Technologies• cgroups• Kernel namespaces

• PID• NET• IPC• MNT• UTS: Unix Timesharing System

• Union Filesystems: • AUFS• Btrfs• Vfs• DeviceMapper

• Container format: libcontainer, but some other will be supported: BSD Jails or Solaris Zones

Page 8: Introducción a Docker - LibreCon 2016

8 / 33(C) 2016 Hopla! Software & Subsidiaries

Motivation: Microservices and SOA

Page 9: Introducción a Docker - LibreCon 2016

9 / 33(C) 2016 Hopla! Software & Subsidiaries

Applications: Paradigm change

• Applications are no longer monolithic

• SOA implies multiple app stacks

• Services are decoupled

• Developers focused on Functionality

• Scalability

Page 10: Introducción a Docker - LibreCon 2016

10 / 33(C) 2016 Hopla! Software & Subsidiaries

Multiple Technologies, A Common Problem

Page 11: Introducción a Docker - LibreCon 2016

11 / 33(C) 2016 Hopla! Software & Subsidiaries

Problem Solved Again!!!

Page 12: Introducción a Docker - LibreCon 2016

Concepts

• Image

• Container

• Engine / Client

• Security• Attack surface• SE Linux• Networking

• Persistence vs Ephemeral

Page 13: Introducción a Docker - LibreCon 2016

Concepts

• Orchestrating Containers

• Swarm

• Compose

mysql: image: mysql:5.5 environment: MYSQL_ROOT_PASSWORD: rootpasswd MYSQL_DATABASE: drupal volumes: - ./conf/mysql/conf.d:/etc/mysql/conf.d ports: - "3306"

redis: image: redis:2.8 ports: - "6379"

solr: build: ../../build/drupal-solr ports: - "8983"

web: build: ../../build/drupal-nginx-php55x ports: - "80" - "443" - "22" volumes: - /opt/code/example/drupal:/var/www links: - mysql - redis - solr

Page 14: Introducción a Docker - LibreCon 2016

Docker: High Level Architecture

Page 15: Introducción a Docker - LibreCon 2016

Concepts

• Manage Images

• Registry / Trusted Registry

• Notary

• Extending Functionality

• Engine Plugins

• Volumes

• Networking

Page 16: Introducción a Docker - LibreCon 2016

Docker Enterprise Solutions

• Cloud Products

• Docker Hub

• Docker Cloud

• On-Premise Products

• Docker Universal Control Plane

• Docker Trusted Registry

Page 17: Introducción a Docker - LibreCon 2016

17 / 33(C) 2016 Hopla! Software & Subsidiaries

Developers IT Operations

BUILDDevelopment Environments

SHIPSecure Content & Collaboration

RUNDeploy, Manage, Scale

Docker CaaS Overview

Page 18: Introducción a Docker - LibreCon 2016

18 / 33(C) 2016 Hopla! Software & Subsidiaries

Introducing Docker Datacenter

Integrated, end-to-end platform for agile application development and management in production

Page 19: Introducción a Docker - LibreCon 2016

19 / 33(C) 2016 Hopla! Software & Subsidiaries

Docker Datacenter integrates with existing enterprise systems

Page 20: Introducción a Docker - LibreCon 2016

20 / 33(C) 2016 Hopla! Software & Subsidiaries

Why Docker?

Docker Ecosystem

Page 21: Introducción a Docker - LibreCon 2016

21 / 33(C) 2016 Hopla! Software & Subsidiaries

Integration: CI/CD

21

Developer

Versioncontrol

1. Development 2. Test 3. Stage / Production

QA / QE

SysadminProject Management

Page 22: Introducción a Docker - LibreCon 2016

22 / 33(C) 2016 Hopla! Software & Subsidiaries

Dockerizing an existing complex application

Page 23: Introducción a Docker - LibreCon 2016

23 / 33(C) 2016 Hopla! Software & Subsidiaries

Dockerizing an existing complex application

Page 24: Introducción a Docker - LibreCon 2016

24 / 33(C) 2016 Hopla! Software & Subsidiaries

Dockerizing an existing complex application (detail)• Remarkable elements

• Gateway to external services• Proxy for controlled access to the Internet (i.e. restricted)• Synchronizing gateway (w/ semaphore!)• Centralized configuration• User-controlled app-wide events

• Service Discovery … and consumption!• Auto-register (declaratively) containers upon startup• Containers can also register themselves• ALL services are available in the catalog, and resolvable via

DNS. Non-standard ports are supported too – SRV [RFC 2782]• Legacy services use the same mechanism

Page 25: Introducción a Docker - LibreCon 2016

25 / 33(C) 2016 Hopla! Software & Subsidiaries

Dockerizing an existing complex application (detail – cont.)• Event-driven reconfiguration

• Central distributed KV stores config params• Changes to configuration trigger reconfig actions

...and cluster-wide actions – management at scale!e.g.: apply patches, reconfigure services

• Comms security with performance• Hardware-accelerated flow separation till switches (VLAN)• Kernel-enforced/accelerated private network per application• Centrally-configured restricted access to the internet• Service consumption only over trusted datapath

DR/BC-ready: multi-DC & auto-failover

Page 26: Introducción a Docker - LibreCon 2016

Dockerization of Legacy Systems Benefits: Cost Reduction• 100 VMs Frontal Servers

• Apache2.2 on CentOS6-7; mpm-event[ILK]+php5-fpm 5.3• 4GB de RAM average• 2 or 4 vCPU • 10GB minimal disk image (tipically 25GB)

• That makes 400GB RAM and 200 vCPU

• 5 VMs with 8vCPUs and 32GB RAM• 60% RAM and 80% CPUs savings

Page 27: Introducción a Docker - LibreCon 2016

27 / 33(C) 2016 Hopla! Software & Subsidiaries

Escalado PostgresqlArchitecture and network

SELECTS

This demo shows how a STATEFUL application can be managed and scaled using containers.

Master Slave

Replication

Writes

Page 28: Introducción a Docker - LibreCon 2016

28 / 33(C) 2016 Hopla! Software & Subsidiaries

Escalado PostgresqlOne click scale

Scale in one click:• Application Server• DB Pool• Horizontal DB ScaleAND…Autoscale DB under several

configurable parameters.

SELECTSELECT

Master Slave

Replication

Slave

Replication

Page 29: Introducción a Docker - LibreCon 2016

29 / 33(C) 2016 Hopla! Software & Subsidiaries

Container Advantages

• BUSINESS: • Time to Market.

• Faster development cycles.

• More releases in less time

• Scalability: 0,5s to launch a new container

Page 30: Introducción a Docker - LibreCon 2016

30 / 33(C) 2016 Hopla! Software & Subsidiaries

Container Advantages

• IT ORGS: • Responsibilities Segregation

Page 31: Introducción a Docker - LibreCon 2016

31 / 33(C) 2016 Hopla! Software & Subsidiaries

Container Advantages

• DEVELOPMENT: • Portability

• Development Deployment→

• CI & testing simplified• Reproducible builds &

deploy• Fast rollback made possible• Deterministic operations

• Common CI tools• Native Jenkins plugin available• GitLab, Gerrit, Bamboo too

...no need to abandon BCPs!

Page 32: Introducción a Docker - LibreCon 2016

32 / 33(C) 2016 Hopla! Software & Subsidiaries

Container Advantages

• OPERATIONS: Efficiency• Higher density: 100s

containers/server vs 10’s VM/server

• Elasticity: grow and shrink. Better “pay per use”

• Management simplification. No need for virtualization

• Repeteable Architectures. Design once, deploy 100’s times

• Decoupling of OS from the applications: Independent evolution

Page 33: Introducción a Docker - LibreCon 2016

33 / 33

[email protected]