devnet-1148leveraging cisco openstack private cloud for developers

51
Developing Applications with Cisco OpenStack Private Cloud @vallard DevNet

Upload: cisco-devnet

Post on 13-Aug-2015

244 views

Category:

Technology


3 download

TRANSCRIPT

Page 1: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

Developing Applications with Cisco OpenStack

Private Cloud @vallard

DevNet

Page 2: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003

A New Startup!

Page 3: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003

•  Keep as much in-house as possible •  Build for Portability

•  Automate all the things

•  Use containers

Requirements

3

Page 4: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003

•  Cisco OpenStack Private Cloud (formerly Metacloud) •  CoreOS

•  Docker

•  Gitlab

•  Jenkins

•  Slack

•  Ansible

What it Takes

Page 5: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003

Logical Application Architecture

lba

mc-vlb

lbb

web01

web02

web03

CoreOS 633.1.0

app

app

app

Application runs as container

blba

blbb

db1

db2

mysql

mysql

/vol

/vol

CoreOS 633.1.0

Database runs in container

Page 6: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003

web-1-n

Using Availability Zones for A/B Testing

lba

lbb

web-1-1

Web-1

web-n

app

app

app

blba

blbb

db1-1

db2-n

mysql

mysql

/vol

/vol

db1-n

/vol

mysql

app AZ1

AZ2

db2-1 mysql

/vol

Page 7: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003

Using Projects

lbb

Web-1

web-n

app

app

blbb db2-n

mysql

/vol

AZ1

db2-1

mysql

/vol

App-Prod1 DB-Prod1

Page 8: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003 8

Love in an Elevator (Autoscaling)

•  No Cielometer •  Build it yourself

•  Salt Stack •  Mesos/ Consul •  Scripts that monitor and

do alerts e.g: Nagios (yes, Nagios)

•  Third Party Solutions

Page 9: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003

New in April Release nova server-group-create –policy anti-affinity group-1

nova boot –image IMAGE_ID –flavor FLAVOR_ID –hint \

group-SERVER_GROUP_UUID web01

nova server-group-list

Anti Affinity Rules

Page 10: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003

•  Logging •  Analyzing Data

•  (results of our A/B testing)

Analytics and Logging

Controller 1 Controller 2 Controller 3

Hypervisor

Hypervisor

Hypervisor

Hypervisor

Hypervisor

Hypervisor

Hypervisor

Hypervisor

Hypervisor

Aggregate Designated for BigData

Page 11: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003

Jenkins Continuous Integration

Service

Developer pushes commits

Build new Container / Run Tests

Push to production

New Metacloud Instance created

1 2 3 4 5 6

Push to Local Registry

Source Code Repository

Developers are notified

Ansible was used to build all servers

Page 12: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003

Bring up the Dev Env!

12

Page 13: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003

Development Architecture

CoreOS 633.1.0

LG-dev Jenkins :8080

/vol

Registry :5000

GitLab :10080 :10022

nginx :80

postgresql

redis

Page 14: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003 14

Page 15: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003

Make sure our credentials work!

15

Page 16: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003 16

Page 17: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003 17

The only state in the entire system is held in the volume that is mounted to the dev machine. (hostname: ci)

Page 18: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003 18

Nginx proxy Requests for port 80 http://jenkins.lawngnomed.com http://gitlab.lawngnomed.com http://registry.lawngnomed.com * Registry disabled because not secured.

Registry :5000 Mounts /vol/docker-registry

Jenkins :8080 Mounts: /vol/jenkins_home

Gitlab :10022,10080 Mounts: /vol/jenkins_home * Redis & Postgres maintain state in /vol/redis & /vol/postgresql

Page 19: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003 19

Steven Tyler Tip “Feel free to experiment… You can use any configuration management tool in place of Ansible.”

Page 20: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003 20

Ansible Playbook to deploy Dev Server

Page 21: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003

Allow for insecure registries

21

Page 22: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003 22

Pro-Tip Put SSH credentials in ~/.ssh/config

Host lg-dev User core Hostname 38.84.67.179 IdentityFile ~/.ssh/tco-gold.pem

ssh –i ~/.ssh/tco-gold.pem [email protected]

ssh lg-dev

Page 23: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003

Web & Load Balancers

23

Page 24: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003

Done This Doing This

lba

lbb

web01

web02

web03

LG-dev Jenkins :8080

/vol

Registry :5000

GitLab :10080 :10022

nginx :80

postgresql

redis

Page 25: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003 25

Ansible Playbook to deploy load balancers

Use Metacloud provided image and flavor

Page 26: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003 26

Ansible Playbook to deploy Web Servers •  No floating IP

Page 27: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003 27

Install Python

Insecure Registry

Page 28: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003

Jenkins CI Setup

28

Page 29: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003

Jenkins Continuous Integration

Service

Developer pushes commits

Build new Container / Run Tests

Push to production

New Metacloud Instance created

1 2 3 4 5 6

Push to Local Registry

Source Code Repository

Developers are notified

Continuous Integration

Continuous Delivery

Page 30: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003

•  Creat Jenkins User in Metacloud

•  Use Packer or Build image in Cisco OpenStack Private Cloud

•  Copy Jenkins keys so jenkins can login

Jenkins Slave

http://www.redguava.com.au/2014/03/jenkins-slaves-running-coreos-and-docker/

Page 31: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003

Jenkins Plugins

Page 32: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003

Manage Jenkins

32

From Manage Jenkins / Configure System

Page 33: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003 33

Add the slave image

Page 34: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003 34

User data for when instance boots

*** Could have done this in Packer or when we created image

Page 35: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003

Create New Project

35

Page 36: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003

Configure New Project

36

1 Make sure job only runs on slaves

2 Allow git checkout

Page 37: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003

Configure New Project

37

3 Tell it to build for GitLab changes.

Allow git checkout

Page 38: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003

Configure New Project

38

4 Tell it to use the slave.

Page 39: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003 39

5 Build it.

Page 40: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003

Integration with Gitlab

40

Page 41: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003

Gitlab Setup

41

https://github.com/jenkinsci/gitlab-plugin

Page 42: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003

Integration with Slack

42

Page 43: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003 43

1

2

3

Create a WebHook

Define the Channel

Copy the URL

Page 44: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003 44

4 In Jenkins, add Slack to Configuration

Page 45: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003 45

5 In Jenkins, add Slack to Project

Page 46: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003 46

Page 47: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003

Jenkins Continuous Integration

Service

Developer pushes commits

Build new Container / Run Tests

Push to production

New Metacloud Instance created

1 2 3 4 5 6

Push to Local Registry

Source Code Repository

Developers are notified

Ansible was used to build all servers

Page 48: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003

•  We Demonstrated the application delivery pipeline. •  The pipeline stack can be used in any cloud.

•  Different tools can be used and substituted for any place in the pipeline.

•  Your problems are not unique. No code was written, we just configured existing open source projects.

Summary

Page 49: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003

Breakout Session

Title Date and Time

TECCLD-3001 Intercloud Fabric Technical Deepdive: Mauricio Arregoces

Sun, Jun 7, 8-12 PM – 16B Mezz.

PSOCLD-1001 Hybrid Cloud with Intercloud Fabric Percy Wadia, CNSG Product Mgr

Mon, Jun 8, 11:00AM-12:00PM 14B Mezz.

BRKCLD-2002 Cisco Cloud Services - Under the Hood Ken Schroeder

Mon, Jun 8, 1:00-3:00 PM 16B Mezz.

PSOCLD-1002 Cisco Cloud Services and Intercloud Marketplace, Chandra Venkatapathy, Product Mgr, CSG

Tues, Jun 9, 11:00 AM - 12:00 PM 3 Upper Lvl

PSOCLD-1005 Cisco Powered Architectures Under the Hood, Jeff Minson, Technical Solutions Arch.

Thurs, Jun 11, 11:00 AM - 12:00 PM – 14B Mezz.

PSOCLD-1006 Cisco Cloud Architecture on OpenStack Rohit Agarwalla, Technical Lead, OpenStack

Tues, Jun 9, 2:30 - 3:30 PM – 23C Upper Level

BRKCLD-2003 Building Hybrid Cloud Applications with Intercloud Fabric, Ben Del Vento

Wed, Jun 10, 8:00-10:00 AM 7A Upper Lvl

DEVNET-1109

Cisco Executive Panel: All about the Cloud Cisco's Executives Lew Tucker, Faiyaz Shahpurwala and Ken Owens discuss the current and future opportunities around public, private and hybrid clouds.

Wed, Jun 10, 9:30 - 10:30 AM DevNet Theater

Cisco Live 2015 Cloud Breakout Sessions Breakout Session

Title Date and Time

PSOCLD-1004 Cisco OpenStack® Private Cloud (Formerly Metacloud) Niki Acosta, Marketing Manager

Wed, Jun 10, 9:30-10:30 AM – 28D Upper Level

BRKCLD-2001

Building Scalable and Highly Available Enterprise Applications on Cisco Cloud Services: Chandra Venkatapathy, Ken Schroeder, Technical Staff, CSG

Wed, Jun 10, 1:00-3:00 PM 25C Upper Level

BRKCLD-1004

End-to-end Cloud Management: A holistic approach for developing and managing the platform and service offerings that transform IT: Ben Del Vento

Wed, Jun 10, 3:30-5:00 PM 24C Upper Lvl

BRKCLD-1002 Cloud Onboarding - Jeff Minson; Abhi Sing, Technical Solutions Architects, CMS

Thurs, Jun 11, 8:00-9:30 AM, 30E Upper Lvl

BRKCLD-1828 Designing Hybrid Cloud operations with ServiceGrid and Intercloud Fabric Ben Del Vento

Thurs, Jun 11, 8:00-9:30 AM 25C Upper Lvl

BRKCLD-1003 A Practical Introduction to DevOps Practices and Tools: Christopher Jackson, Vallard Benincosa

Thurs, Jun 11, 1:00-2:30 PM 28C Upper Lvl

LTRCLD-2011 Intercloud Fabric - Configuring and Deploying Hybrid Cloud Solutions: Chris Martin

Page 50: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers

Thank you

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003 50

Page 51: DEVNET-1148Leveraging Cisco OpenStack Private Cloud for Developers