Deploying to the cloud with golden images, Heat and Docker Steve - - PowerPoint PPT Presentation

deploying to the cloud
SMART_READER_LITE
LIVE PREVIEW

Deploying to the cloud with golden images, Heat and Docker Steve - - PowerPoint PPT Presentation

Deploying to the cloud with golden images, Heat and Docker Steve Baker / sbaker@redhat.com @stevebake / Declarative vs Procedural Orchestration Procedural/Imperative describes a list of instructions to execute Declarative describes the


slide-1
SLIDE 1

Deploying to the cloud

with golden images, Heat and Docker

Steve Baker / / sbaker@redhat.com @stevebake

slide-2
SLIDE 2

Declarative vs Procedural Orchestration

Procedural/Imperative describes a list of instructions to execute Declarative describes the desired state

slide-3
SLIDE 3

What is Heat?

Heat is a REST service for the declarative orchestration of multi- tenant OpenStack cloud services.

slide-4
SLIDE 4

What is Heat Kubernetes?

Heat Kubernetes is a REST service for the declarative

  • rchestration of multi-tenant OpenStack cloud services

containers.

slide-5
SLIDE 5

I want to orchestrate containers in an OpenStack cloud

No OpenStack container API :( Kubernetes / Docker are not multi-tenant APIs ;(

slide-6
SLIDE 6

Evolution of Heat software configuration

boot-time config - user-data script + cfn-init metadata, cloud-init / cloud-config config/deployment resources - shell / puppet / ansible etc

slide-7
SLIDE 7

Kubelet

Processes a container manifest so the containers are launched according to how they are described.

slide-8
SLIDE 8

What is a pod?

slide-9
SLIDE 9

What you don't get with kubelet vs full kubernetes

no service load balancing no scheduler - requires manual placement of pods

slide-10
SLIDE 10

Declarative Heat template

heat_template_version: 2014-10-16 parameters: key_name: type: string resources: server: type: OS::Nova::Server properties: image: Fedora-x86_64-20-20140618-sda flavor: m1.small key_name: {get_param: key_name}

  • utputs:

server_ip: value: {get_attr: [server, first_address]}

slide-11
SLIDE 11

To run the latest heat against a cloud with no (or older) heat

Building a stand-alone heat appliance

slide-12
SLIDE 12

Heat architecture

heat-engine heat-api rabbitmq mysql

slide-13
SLIDE 13

Heat HA architecture

heat-engine heat-api rabbitmq mysql heat-engine heat-api heat-engine heat-api haproxy

slide-14
SLIDE 14

Heat appliance pod

heat-engine heat-api rabbitmq mysql

slide-15
SLIDE 15

Building the docker image

# heat-base-standalone/Dockerfile FROM fedora:20 MAINTAINER Steve Baker <steve@stevebaker.org> ADD heat /opt/heat ADD install-heat.sh /opt/install-heat.sh RUN /opt/install-heat.sh ADD config-heat.sh /opt/heat/config-heat.sh # heat-api-standalone/Dockerfile FROM stevebake/heat-base-standalone MAINTAINER Steve Baker <steve@stevebaker.org> ADD ./start.sh /start.sh CMD ["/start.sh"]

slide-16
SLIDE 16

Building the VM image

Built using diskimage-builder Uses the heat-config-kubelet element from the heat- templates repository Currently Fedora only (lots of systemd) Includes a tar file of docker images for import on boot https://github.com/openstack/heat- templates/tree/master/hot/software-config

slide-17
SLIDE 17

Images and Security

“...the code responsible for downloading images is shockingly

  • insecure. Users should only download images whose provenance is

without question. At present, this does not include “trusted” images hosted by Docker, Inc” - Jonathan Rudenberg https://titanous.com/posts/docker-insecurity

slide-18
SLIDE 18

Images and Security

“...one of the most important ways you can protect yourself when using Docker images is to make sure you only use content from a source you trust and to separate the download and unpack/install

  • steps. The easiest way to do this is simply to not use “docker pull”

command.” - Trevor Jay https://securityblog.redhat.com/2014/12/18/before-you- initiate-a-docker-pull/

slide-19
SLIDE 19

Writing the heat template

resources: heat_pod_config: type: OS::Heat::StructuredConfig properties: group: kubelet config: version: v1beta2 containers:

  • name: rabbitmq

image: {get_input: rabbitmq_image} ports:

  • containerPort: 5672

hostPort: 5672

  • name: mariadb

image: {get_input: mariadb_image} ports:

  • containerPort: 3306

hostPort: 3306 env:

  • name: DB_ROOT_PASSWORD

value: {get_input: mariadb_password} volumeMounts:

  • name: mariadb-data

mountPath: /var/lib/mysql

  • name: heat-engine

image: {get_input: heat_engine_image}

slide-20
SLIDE 20

Launching the stack

You launch the heat-standalone template Heat launches VM with kubelet-enabled image Heat builds data describing pods to create VM agent fetches data, writes out pod template files Kubelet picks up files, creates containers VM agent monitors for container creation, signals Heat with results

slide-21
SLIDE 21

Launching the stack

0:00

slide-22
SLIDE 22

Lifecycle of container stacks

Image releases handled with heat stack-update Container architecture changes handled with heat stack- update Other workflows handled procedurally (with zero or more stack-updates)

slide-23
SLIDE 23

Evolution of Heat software configuration

boot-time config - user-data script + cfn-init metadata, cloud-init / cloud-config config/deployment resources - shell / puppet / ansible etc config fed to service running on host - docker / kubelet (future) config driving heat-provisioned cluster - kubernetes / etcd / mesos

slide-24
SLIDE 24

Next steps

Expose cAdvisor stats as deployment outputs Bring up a full Kubernetes cluster with heat, define containers in heat template, use unmodified Atomic OS image Encourage Kubernetes to declare stable interfaces for its components

slide-25
SLIDE 25

Other container things in OpenStack

Nova Docker driver Heat contrib docker API resource plugin OpenStack Magnum multi-tenant container API Heat templates for Atomic based Kubernetes cluster https://github.com/stackforge/nova-docker https://github.com/stackforge/magnum https://github.com/larsks/heat-kubernetes

slide-26
SLIDE 26

Get the code

https://github.com/steveb/docker-heat-templates https://github.com/openstack/heat- templates/tree/master/hot/software-config

slide-27
SLIDE 27

Questions?

Steve Baker / / sbaker@redhat.com @stevebake