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

Orchestration and CI/CD in the OpenStack Cloud

Aug 17, 2015

Download

Internet

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Orchestration and CI/CD in the OpenStack Cloud

Orchestration and CI/CDin the OpenStack Cloud

by Simone Soldateschi@soldasimo

20150731

Page 2: Orchestration and CI/CD in the OpenStack Cloud

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

Page 3: Orchestration and CI/CD in the OpenStack Cloud

● Task Automation○ Chef, Ansible○ Heat○ Python

● Cloud (OpenStack)○ dev → live○ Autoscale

What do I do?

Page 4: Orchestration and CI/CD in the OpenStack Cloud

Outline

● pipeline to build container

● full stack

● orchestration

● service discovery

● pipeline to go live

Page 5: Orchestration and CI/CD in the OpenStack Cloud

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

Development Workflow

Page 6: Orchestration and CI/CD in the OpenStack Cloud

Why

Page 7: Orchestration and CI/CD in the OpenStack Cloud

Desired State

«Write code to tell systems how to manage themselves»

Page 8: Orchestration and CI/CD in the OpenStack Cloud

Trivial Issue

Page 9: Orchestration and CI/CD in the OpenStack Cloud

$ cat attributes/default.rb

…default[‘users’] = “foo”

Trivial Issue

foo

Page 10: Orchestration and CI/CD in the OpenStack Cloud

$ cat attributes/default.rb

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

Trivial Issue

foo bar

Page 11: Orchestration and CI/CD in the OpenStack Cloud

Causes and issues

● Complexity○ systems, networking○ development workflow

● Idempotency

Page 12: Orchestration and CI/CD in the OpenStack Cloud

● Simple● Repeatable● Versioned

Things should be

Page 13: Orchestration and CI/CD in the OpenStack Cloud

How to solve it// aim for simplicity

Page 14: Orchestration and CI/CD in the OpenStack Cloud
Page 15: Orchestration and CI/CD in the OpenStack Cloud

HA Cluster

Page 16: Orchestration and CI/CD in the OpenStack Cloud

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

https://discovery.etcd.io/b42a0e4720728d4fa9ecf06a68102294

Page 17: Orchestration and CI/CD in the OpenStack Cloud
Page 18: Orchestration and CI/CD in the OpenStack Cloud

: 1 process

Page 19: Orchestration and CI/CD in the OpenStack Cloud

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

Page 20: Orchestration and CI/CD in the OpenStack Cloud

JSON +Playbooks

Page 21: Orchestration and CI/CD in the OpenStack Cloud

Repository

Public Hub Private Registry

Page 22: Orchestration and CI/CD in the OpenStack Cloud

Full Stack

Hardware

OpenStack

CoreOs Cluster

Containers

Page 23: Orchestration and CI/CD in the OpenStack Cloud

Provision

Bare-metal server

OpenStack

CoreOs CoreOsCoreOs

Act of Faith

OSAD

Vagrant, Heat

!!!

Page 24: Orchestration and CI/CD in the OpenStack Cloud
Page 25: Orchestration and CI/CD in the OpenStack Cloud

Provision CoreOS Cluster

Page 26: Orchestration and CI/CD in the OpenStack Cloud

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

Page 27: Orchestration and CI/CD in the OpenStack Cloud

Service Discovery

Page 28: Orchestration and CI/CD in the OpenStack Cloud

web: «Where is DB serverfor this environment ?»

ha: «Where are web nodesfor this environment ?»

Page 29: Orchestration and CI/CD in the OpenStack Cloud

Register Web Container

CoreOs Cluster

Etcd

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

done

Page 30: Orchestration and CI/CD in the OpenStack Cloud

Discover Web Container

CoreOs Cluster

Etcd

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

done

Page 31: Orchestration and CI/CD in the OpenStack Cloud

CI/CD

Page 32: Orchestration and CI/CD in the OpenStack Cloud
Page 33: Orchestration and CI/CD in the OpenStack Cloud

CI

Page 34: Orchestration and CI/CD in the OpenStack Cloud

Pub Hub Pvt Reg

Dev

UAT/STG

LIVE

CD

Page 35: Orchestration and CI/CD in the OpenStack Cloud

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»

Page 36: Orchestration and CI/CD in the OpenStack Cloud