Nulecule: Packaging, Distributing and Deploying Multi-Container - - PowerPoint PPT Presentation

nulecule packaging distributing and deploying multi
SMART_READER_LITE
LIVE PREVIEW

Nulecule: Packaging, Distributing and Deploying Multi-Container - - PowerPoint PPT Presentation

Nulecule: Packaging, Distributing and Deploying Multi-Container Applications the Cloud Way ContainerCon North America 2016 Charlie Drage Container Tools / Project Atomic @ Red Hat cdrage @ http://projectatomic.io Wait, whats Project


slide-1
SLIDE 1

Nulecule: Packaging, Distributing and Deploying Multi-Container Applications the Cloud Way

ContainerCon North America 2016

slide-2
SLIDE 2

Charlie Drage

Container Tools / Project Atomic @ Red Hat cdrage @

http://projectatomic.io

slide-3
SLIDE 3

Wait, what’s Project Atomic?

Lightweight OS designed with the sole purpose of deploying containerized applications Container tools such as the Atomic CLI to deploy your applications GUI tools such as the Cockpit Project to help manage

slide-4
SLIDE 4

What’s the current problem?

Multiple standards in multi-container deployment

  • rchestrators (Kubernetes,

OpenShift, Docker Compose, Mesos, Nomad, Dokku, Flynn, etc..) Even though… We’re slowly converging to a single standard in the container front (single image and runtime spec) via the OCI (Open Container Initiative) e.g. rkt + docker

https://www.opencontainers.org/

slide-5
SLIDE 5

Nulecule && Atomic App

A simple way of deploying multi-container applications to provider-agnostic environments Nulecule = specification Atomic App = implementation "Well, it all starts when a nulecule comes out of its nest...” - Homer

slide-6
SLIDE 6

Issues with container distribution /

  • rchestration

As awesome as container orchestration tools are, (imo) they’ve got a high learning curve. What distribution, parameterization methods? How do I deploy a Kubernetes example as simple as `docker run -p 80:80 nginx`?

slide-7
SLIDE 7

Containers galore

Over 941 different MariaDB containers on Docker Hub So many varieties and yet only one that people should use * Last checked August 3rd 2016

slide-8
SLIDE 8

How we help

Creating a multi-container application for say, ex. Ops to deploy Building a single image for deployment Deploy and undeploy from multiple providers Distributing parameterized apps Composability to multiple orchestration providers Atomic App is packaged into a single deployment container

slide-9
SLIDE 9

Multi-container applications

slide-10
SLIDE 10

Composability

Import and use an

  • fficial container into

your application *Similar to “Docker Compose”

slide-11
SLIDE 11

Metadata

Most environment variables require some sort of change

slide-12
SLIDE 12

Metadata and various

  • rchestrators

Metadata: No common way to distribute metadata from ops to devs and vice-versa. Unable to provide environment variables at deployment time (have to specify in an .env file) Orchestrators: Multiple deployment tools and file formats

slide-13
SLIDE 13

Creating your first Nulecule file

It’s super easy! “Hello world” Includes: specification, composability, distribution, parametrization, orchestrator agnostic

  • specversion: 0.0.2

id: helloapache-app metadata: name: Hello Apache App appversion: 0.0.1 description: Atomic app for deploying a really basic Apache HTTP server location: docker.io/projectatomic/helloapache params:

  • name: provider

description: The specified default provider. default: kubernetes graph:

  • name: helloapache-app

params:

  • name: image

description: The webserver image default: centos/httpd

  • name: hostport

description: The host TCP port as the external endpoint default: 80 artifacts: docker:

  • file://artifacts/docker/hello-apache-pod_run

kubernetes:

  • file://artifacts/kubernetes/hello-apache-pod.json

marathon:

  • file://artifacts/marathon/helloapache.json
slide-14
SLIDE 14

Another spec?

slide-15
SLIDE 15

Let’s build an Etherpad example with MariaDB

slide-16
SLIDE 16

Identifier and Specification Version

Give the ID that will be used for import into different applications as well as the current spec version

  • specversion: "0.0.2"

id: etherpad-app

slide-17
SLIDE 17

Metadata

Included metadata available for scraping

metadata: name: etherpad-app appversion: 0.0.1 description: Etherpad demo location: docker.io/user/etherpad-app

slide-18
SLIDE 18

Params

Global parameters

params:

  • name: provider

description: Default provider default: kubernetes

slide-19
SLIDE 19

Graph

The “bread and butter” of the Nulecule file format. Define application components and dependencies.

graph:

  • name: mariadb-centos7-atomicapp

...

  • name: etherpad-app

...

slide-20
SLIDE 20

Graph Source

Import an already pre-made Nulecule application

graph:

  • name: mariadb-centos7-atomicapp

source: docker://user/mariadb-atomicapp ...

slide-21
SLIDE 21

Graph Params

Provide the correct values at deployment time

graph: ...

  • name: etherpad-app

params:

  • name: image

description: Container image default: centos/etherpad

  • name: hostport

description: Host TCP Port default: 9001

  • name: db_user

description: Database User

  • name: db_pass

description: Database Password

  • name: db_name

description: Database Name

  • name: db_host

description: Database hostname/IP default: mariadb

  • name: db_port

description: Database service port default: 3306

slide-22
SLIDE 22

Answers file

Graph parameters can be pre-defined prior to deployment instead of “answered”

[general] provider = kubernetes [etherpad-app] db_user = foo db_host = bar ...

slide-23
SLIDE 23

Graph Artifacts

Metadata templates for different orchestrators

graph: ...

  • name: etherpad-app

params: ... artifacts: docker: ... kubernetes:

  • file://artifacts/kubernetes/etherpad-rc.yaml
  • file://artifacts/kubernetes/etherpad-svc.yaml
  • penshift:
  • inherit:
  • kubernetes
slide-24
SLIDE 24

Graph Params in kubernetes/etherpad-rc.yaml

Dollar sign variable replacement in each artifact file

  • apiVersion: v1

kind: ReplicationController metadata: name: etherpad labels: name: etherpad spec: replicas: 1 selector: name: etherpad template: metadata: labels: name: etherpad spec: containers:

  • name: etherpad

image: $image ports:

  • name: etherpad-server

containerPort: $hostport env:

  • name: DB_HOST

value: $db_host

  • name: DB_DBID

value: $db_name

  • name: DB_PASS

value: $db_pass

  • name: DB_PORT

value: $db_port

  • name: DB_USER

value: $db_user

slide-25
SLIDE 25

Atomic App

Reference implementation of Nulecule Installer, manager, container builder, single command deployment

slide-26
SLIDE 26

Create a Nulecule application in one container

FROM projectatomic/atomicapp:0.6.1 MAINTAINER Red Hat, Inc. <container-tools@redhat.com> LABEL io.projectatomic.nulecule.providers="kubernetes" \ io.projectatomic.nulecule.specversion="0.0.2" ADD /Nulecule /Dockerfile README.md /application-entity/ ADD /artifacts /application-entity/artifacts

Build your app on top of our Atomic App base image

slide-27
SLIDE 27

DEMO

slide-28
SLIDE 28

Learn more at

Project: http://projectatomic.io Github: http://github.com/projectatomic/nulecule http://github.com/projectatomic/atomicapp IRC: #nulecule @ freenode Mailing list: container-tools@redhat.com Charlie Drage, @cdrage, cdrage@redhat.com