devnet-1148leveraging cisco openstack private cloud for developers
TRANSCRIPT
Developing Applications with Cisco OpenStack
Private Cloud @vallard
DevNet
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003
A New Startup!
© 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
© 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
© 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
© 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
© 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
© 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
© 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
© 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
© 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
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003
Bring up the Dev Env!
12
© 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
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003 14
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003
Make sure our credentials work!
15
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003 16
© 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)
© 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
© 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.”
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003 20
Ansible Playbook to deploy Dev Server
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003
Allow for insecure registries
21
© 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
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003
Web & Load Balancers
23
© 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
© 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
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003 26
Ansible Playbook to deploy Web Servers • No floating IP
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003 27
Install Python
Insecure Registry
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003
Jenkins CI Setup
28
© 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
© 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/
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003
Jenkins Plugins
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003
Manage Jenkins
32
From Manage Jenkins / Configure System
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003 33
Add the slave image
© 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
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003
Create New Project
35
© 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
© 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
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003
Configure New Project
38
4 Tell it to use the slave.
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003 39
5 Build it.
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003
Integration with Gitlab
40
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003
Gitlab Setup
41
https://github.com/jenkinsci/gitlab-plugin
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003
Integration with Slack
42
© 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
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003 44
4 In Jenkins, add Slack to Configuration
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003 45
5 In Jenkins, add Slack to Project
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003 46
© 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
© 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
© 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
Thank you
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public BRKCLD-1003 50