Nulecule: Packaging, Distributing and Deploying Multi-Container Applications the Cloud Way
ContainerCon North America 2016
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
ContainerCon North America 2016
Container Tools / Project Atomic @ Red Hat cdrage @
http://projectatomic.io
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
Multiple standards in multi-container deployment
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/
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
Issues with container distribution /
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`?
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
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
Import and use an
your application *Similar to “Docker Compose”
Most environment variables require some sort of change
Metadata and various
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
It’s super easy! “Hello world” Includes: specification, composability, distribution, parametrization, orchestrator agnostic
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:
description: The specified default provider. default: kubernetes graph:
params:
description: The webserver image default: centos/httpd
description: The host TCP port as the external endpoint default: 80 artifacts: docker:
kubernetes:
marathon:
Another spec?
Give the ID that will be used for import into different applications as well as the current spec version
id: etherpad-app
Included metadata available for scraping
metadata: name: etherpad-app appversion: 0.0.1 description: Etherpad demo location: docker.io/user/etherpad-app
Global parameters
params:
description: Default provider default: kubernetes
The “bread and butter” of the Nulecule file format. Define application components and dependencies.
graph:
...
...
Import an already pre-made Nulecule application
graph:
source: docker://user/mariadb-atomicapp ...
Provide the correct values at deployment time
graph: ...
params:
description: Container image default: centos/etherpad
description: Host TCP Port default: 9001
description: Database User
description: Database Password
description: Database Name
description: Database hostname/IP default: mariadb
description: Database service port default: 3306
Graph parameters can be pre-defined prior to deployment instead of “answered”
[general] provider = kubernetes [etherpad-app] db_user = foo db_host = bar ...
Metadata templates for different orchestrators
graph: ...
params: ... artifacts: docker: ... kubernetes:
Graph Params in kubernetes/etherpad-rc.yaml
Dollar sign variable replacement in each artifact file
kind: ReplicationController metadata: name: etherpad labels: name: etherpad spec: replicas: 1 selector: name: etherpad template: metadata: labels: name: etherpad spec: containers:
image: $image ports:
containerPort: $hostport env:
value: $db_host
value: $db_name
value: $db_pass
value: $db_port
value: $db_user
Reference implementation of Nulecule Installer, manager, container builder, single command deployment
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
DEMO
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