orchestration and ci/cd in the openstack cloud

37
Orchestration and CI/CD in the OpenStack Cloud by Simone Soldateschi @soldasimo 20150731

Upload: simone-soldateschi

Post on 17-Aug-2015

131 views

Category:

Internet


4 download

TRANSCRIPT

Orchestration and CI/CDin the OpenStack Cloud

by Simone Soldateschi@soldasimo

20150731

Who I am● Senior DevOps Engineer, Sydney● Lead DevOps Team at Rackspace AU● ~15 years of experience as

○ Software Eng○ Systems Eng○ Been DevOps'in for the last 5-ish years

Simone Soldateschi

● Task Automation○ Chef, Ansible○ Heat○ Python

● Cloud (OpenStack)○ dev → live○ Autoscale

What do I do?

Outline

● pipeline to build container

● full stack

● orchestration

● service discovery

● pipeline to go live

● Develop App● Test● UAT/QC● Provision● Deploy

Development Workflow

Why

Desired State

«Write code to tell systems how to manage themselves»

Trivial Issue

$ cat attributes/default.rb

…default[‘users’] = “foo”

Trivial Issue

foo

$ cat attributes/default.rb

…default[‘users’] = “foo bar”

Trivial Issue

foo bar

Causes and issues

● Complexity○ systems, networking○ development workflow

● Idempotency

● Simple● Repeatable● Versioned

Things should be

How to solve it// aim for simplicity

HA Cluster

$ curl https://discovery.etcd.io/new

https://discovery.etcd.io/b42a0e4720728d4fa9ecf06a68102294

: 1 process

Build container...RUN apt-get -qqy install git nodejs npmRUN ln -s /usr/bin/nodejs /usr/bin/node

# Install reveal.jsWORKDIR /optRUN git clone https://github.com/hakimel/reveal.js.gitWORKDIR /opt/reveal.jsRUN npm install -g grunt-cliRUN npm installRUN sed -i "s/port: port/port: port,\n\t\t\t\t\thostname: \'\'/g" Gruntfile.js...EXPOSE 8000CMD [ "grunt", "serve" ]

// suboptimal solution

JSON +Playbooks

Full Stack

Hardware

OpenStack

CoreOs Cluster

Containers

Provision

Bare-metal server

OpenStack

CoreOs CoreOsCoreOs

Act of Faith

OSAD

Vagrant, Heat

!!!

Provision CoreOS Cluster

Composelb: image: haproxydb: image: mysqlweb: image: httpd ports: - "80:80" volumes: - ./vhosts:/var/www/vhosts links: - lb - db

Service Discovery

web: «Where is DB serverfor this environment ?»

ha: «Where are web nodesfor this environment ?»

Register Web Container

CoreOs Cluster

Etcd

while true; do etcdctl set /announce/services/apache80 ${COREOS_PUBLIC_IPV4}:80 --ttl 60sleep 45

done

Discover Web Container

CoreOs Cluster

Etcd

while true; do etcdctl get /announce/services/apache80# reconfigure HA Proxysleep 60

done

CI/CD

CI

Pub Hub Pvt Reg

Dev

UAT/STG

LIVE

CD

Lesson Learned

● CoreOS for HA Cluster it’s easy!

● Pipeline to build container repeatable● let services run as desired it’s easy!

● service discovery it’s easy!● CI/CD pipelines repeatable

«All Configuration Management Systems suck,Ansible just sucks less»