SlideShare a Scribd company logo
devops intro
problems & solutions
goal
shared approach
tasks
• understand problems
• terminology agreement
• structure agreement
• share perspectives
4
problems
• stand interference
• stand starvation
• create new stand - $$$
• reproduce release - ???
5
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
6
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
6
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
6
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
6
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
6
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
6
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
6
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
6
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
6
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
6
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
6
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
6
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
6
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
problems?
7
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
manual
problems?
7
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
manual
dependencies
problems?
7
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
manual
per repo
dependencies
problems?
7
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
manual
per repo
per repo
dependencies
problems?
7
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
manual
per repo
per repohardcoded
dependencies
problems?
7
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
manual
per repo
per repo
none
hardcoded
dependencies
problems?
7
8
Terraform
packer
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
9
manual
per repo
per repo
none
hardcoded
dependencies
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
9
manual
per repo
per repo
none
hardcoded
dependencies
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
9
manual
per repo
per repo
none
hardcoded
dependencies
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
9
manual
per repo
per repo
none
hardcoded
dependencies
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
9
manual
per repo
per repo
none
hardcoded
dependencies
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
9
manual
per repo
per repo
none
hardcoded
dependencies
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
10
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
one repo
10
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
ANSIBLEplaybook
one repo
10
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
ANSIBLEplaybook
one repo
ansible
inventories
10
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
ANSIBLEplaybook
one repo
vagrant
w/ ansible
ansible
inventories
10
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
ansible
vars
ANSIBLEplaybook
one repo
vagrant
w/ ansible
ansible
inventories
10
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
ansible
vars
ANSIBLEplaybook
one repo
vagrant
w/ ansible
ansible
inventories
10
build &
upload
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
ansible
vars
ANSIBLEplaybook
ansibleops role
one repo
vagrant
w/ ansible
ansible
inventories
10
build &
upload
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
manual
ansible
vars
ANSIBLEplaybook
ansibleops role
one repo
vagrant
w/ ansible
ansible
inventories
10
build &
upload
Ansible
• inventories
• playbook
• tasks
• vars
• roles
11
a B
1010
0101
inventory
[stand:vars]
ansible_ssh_user=ubuntu
[stand:children]
webbrokers
backend
[webbrokers]
52.29.4.88 host="ship.truckerpath.com"
[backend]
52.29.56.167 host="test-api-1.vpc"
12
role
• meta /dependencies/
• defaults /vars/
• tasks
• templates
• handlers
B
13
tasks
- name: install s3cmd
sudo: yes
apt: name=s3cmd state=present
- name: Add config for s3cmd
template:
src: s3cfg.j2
dest: ~/.s3cfg
mode: 0600
14
tasks
- name: Cleanup build archive
file:
dest: "{{ frontend_file_local }}"
state: absent
- name: Add deploy event to DataDog
when: stand.monitored
datadog_event:
title: "Deployed {{ microservice.name }}"
text: "to host {{ host }} for {{ stand.name }}"
api_key: "{{ truckloads.datadog_key }}"
15
variables
---
# This role requires `microservice` variable with
# following contend:
# - name: Name of the repo, service, user, artifact folder
# - branch: specifies exact artifact to pull
# - env: specifies sh file that will fill environment
# variables for service
microservice_service_name: "{{ microservice.name }}"
microservice_username: "{{ microservice.name }}"
microservice_file_local: "/opt/{{ microservice.name }}.jar"
16
variables
---
# This structure defines
# deployment stand settings
stand:
name: test
monitored: yes
dns:
api: test-api.truckerpath.com
api_port: 80 # for frontend config
webbrokers: test-ship.truckerpath.com
17
▶ <group>.yml
▶ group_vars
▶ all.yml
▶ <group>.yml
▶ inventories
▶ test
▶ inventory
▶ group_vars
▶ stand.yml
File structure
▶ Vagrantfile
▶ requirements.yml
▶ roles
▶ essential
▶ database
▶ microservice
▶ frontend
▶ ...
18
all.yml
---
# Global variables for entire truckloads product
# and definitions of shared resources
truckloads:
datadog_key: “XXXXXXX"
artifacts:
region: us-west-2
bucket: truckloads-artifacts
backups:
region: us-west-2
bucket: truckloads-backups
19
all.yml
## ...
parse:
test:
app_id: "XXXXX"
javascript_key: “XXX"
dev:
app_id: "XXXXX"
javascript_key: "XXX"
20
stand.yml
---
stand:
name: test
monitored: yes
branch:
backend: latest/production
webbrokers: latest/TB-144
parse: "{{ truckloads.parse.test }}"
21
stand.yml
---
stand:
# ...
db:
provision: yes
user: gilfoyle
pass: XXXXXXXX
host: localhost
22
group_vars/*.yml
---
# This are values for susanin
# required by microservice role
susanin:
name: susanin
branch: "{{ stand.branch.susanin }}"
env: |
export PORT="{{ stand.susanin.port }}"
23
<group>.yml
---
- hosts: susanin
roles:
- essential
- role: microservice
microservice: "{{ susanin }}"
24
usage
ansible-playbook backend.yml -i inventories/prod
25
group
stand
usage
ansible-playbook stand.yml -i inventories/test
ansible-playbook backend.yml -i inventories/vagrant
ansible-playbook rainman.yml -i inventories/otann
ansible-playbook microservices.yml 
-i inventories/otann
-l susanin
26
subgroup
Vagrant/file
config.vm.network :forwarded_port,
guest: 5432,
host: 5432 # postgres
config.vm.network :forwarded_port,
guest: 80,
host: 8080 # backend
27
Vagrant/file
config.vm.provision "ansible" do |ansible|
ansible.playbook = "stand.yml"
ansible.inventory_path = "inventories/vagrant"
ansible.limit = "all"
end
28
subgroup group
Vagrant/file
config.vm.provision "ansible" do |ansible|
ansible.playbook = "microservices.yml"
ansible.inventory_path = "inventories/vagrant"
ansible.limit = "saferwatch"
end
29
subgroup group
Todo
• database migrations
• cache backup reuse
• component dependencies
30
plans
• docker vs. existing
• speed?
• packer vs docker
• AMI building w/ docker
• terraform provisioning
• balancer
• dns
31
Result
• component - deployment unit
• stand - deployed components
• config values outside repo
• stand config vs global config
• declarative & role-based devops
32
33
thanks!
Code & Config Artifacts BackupsResources
Stands
configuration
provision
deploy
restore
or
backup backup
deploy
build
1010
0101
1010
0101
a 1.0
B 2.1
01/10
11/26
a 1.2
B 2.0
a 1.4
B 2.1
a 1.3
B 2.0
configure
34

More Related Content

Similar to DevOpsPDF

Mining Co-Change Information to Understand when Build Changes are Necessary
Mining Co-Change Information to Understand when Build Changes are NecessaryMining Co-Change Information to Understand when Build Changes are Necessary
Mining Co-Change Information to Understand when Build Changes are Necessary
Shane McIntosh
 
Vsphere esxi-vcenter-server-50-installation-setup-guide
Vsphere esxi-vcenter-server-50-installation-setup-guideVsphere esxi-vcenter-server-50-installation-setup-guide
Vsphere esxi-vcenter-server-50-installation-setup-guide
Saroj Singi
 
初めての仮想化
初めての仮想化初めての仮想化
初めての仮想化
Yoko Nakano
 
Setup and configuration for ibm tivoli access manager for enterprise single s...
Setup and configuration for ibm tivoli access manager for enterprise single s...Setup and configuration for ibm tivoli access manager for enterprise single s...
Setup and configuration for ibm tivoli access manager for enterprise single s...
Banking at Ho Chi Minh city
 
Setup and configuration for ibm tivoli access manager for enterprise single s...
Setup and configuration for ibm tivoli access manager for enterprise single s...Setup and configuration for ibm tivoli access manager for enterprise single s...
Setup and configuration for ibm tivoli access manager for enterprise single s...
Banking at Ho Chi Minh city
 
1eu introduction
1eu introduction1eu introduction
1eu introduction
James Wang
 
Upgrade 10204-to-10205 on-2-node_rac_linux_x86_64_detail-steps_v0.1
Upgrade 10204-to-10205 on-2-node_rac_linux_x86_64_detail-steps_v0.1Upgrade 10204-to-10205 on-2-node_rac_linux_x86_64_detail-steps_v0.1
Upgrade 10204-to-10205 on-2-node_rac_linux_x86_64_detail-steps_v0.1
Raheel Syed
 
如何安装Oracle one off临时小补丁及注意事项
如何安装Oracle one off临时小补丁及注意事项如何安装Oracle one off临时小补丁及注意事项
如何安装Oracle one off临时小补丁及注意事项
maclean liu
 

Similar to DevOpsPDF (20)

Mining Co-Change Information to Understand when Build Changes are Necessary
Mining Co-Change Information to Understand when Build Changes are NecessaryMining Co-Change Information to Understand when Build Changes are Necessary
Mining Co-Change Information to Understand when Build Changes are Necessary
 
Continuous Automated Deployment with Apache Ace - Jago de Vreede, Marcel Offe...
Continuous Automated Deployment with Apache Ace - Jago de Vreede, Marcel Offe...Continuous Automated Deployment with Apache Ace - Jago de Vreede, Marcel Offe...
Continuous Automated Deployment with Apache Ace - Jago de Vreede, Marcel Offe...
 
Vsphere esxi-vcenter-server-55-installation-setup-guide
Vsphere esxi-vcenter-server-55-installation-setup-guideVsphere esxi-vcenter-server-55-installation-setup-guide
Vsphere esxi-vcenter-server-55-installation-setup-guide
 
Continuous Automated Deployment with Apache ACE
Continuous Automated Deployment with Apache ACEContinuous Automated Deployment with Apache ACE
Continuous Automated Deployment with Apache ACE
 
371780k
371780k371780k
371780k
 
Vsphere esxi-vcenter-server-50-installation-setup-guide
Vsphere esxi-vcenter-server-50-installation-setup-guideVsphere esxi-vcenter-server-50-installation-setup-guide
Vsphere esxi-vcenter-server-50-installation-setup-guide
 
Advanced Kurento Real Time Media Stream Processing
Advanced Kurento Real Time Media Stream ProcessingAdvanced Kurento Real Time Media Stream Processing
Advanced Kurento Real Time Media Stream Processing
 
Inf bco2891 release candidate v11 copy
Inf bco2891 release candidate v11 copyInf bco2891 release candidate v11 copy
Inf bco2891 release candidate v11 copy
 
Spoto updated new
Spoto updated newSpoto updated new
Spoto updated new
 
Setup guide nos-v3_5
Setup guide nos-v3_5Setup guide nos-v3_5
Setup guide nos-v3_5
 
初めての仮想化
初めての仮想化初めての仮想化
初めての仮想化
 
Kubernetes 1001
Kubernetes 1001Kubernetes 1001
Kubernetes 1001
 
Setup and configuration for ibm tivoli access manager for enterprise single s...
Setup and configuration for ibm tivoli access manager for enterprise single s...Setup and configuration for ibm tivoli access manager for enterprise single s...
Setup and configuration for ibm tivoli access manager for enterprise single s...
 
Setup and configuration for ibm tivoli access manager for enterprise single s...
Setup and configuration for ibm tivoli access manager for enterprise single s...Setup and configuration for ibm tivoli access manager for enterprise single s...
Setup and configuration for ibm tivoli access manager for enterprise single s...
 
1eu introduction
1eu introduction1eu introduction
1eu introduction
 
Corrupt Backup
Corrupt BackupCorrupt Backup
Corrupt Backup
 
Upgrade 10204-to-10205 on-2-node_rac_linux_x86_64_detail-steps_v0.1
Upgrade 10204-to-10205 on-2-node_rac_linux_x86_64_detail-steps_v0.1Upgrade 10204-to-10205 on-2-node_rac_linux_x86_64_detail-steps_v0.1
Upgrade 10204-to-10205 on-2-node_rac_linux_x86_64_detail-steps_v0.1
 
如何安装Oracle one off临时小补丁及注意事项
如何安装Oracle one off临时小补丁及注意事项如何安装Oracle one off临时小补丁及注意事项
如何安装Oracle one off临时小补丁及注意事项
 
PROACT SYNC 2013 - Breakout - Cisco UCS Director Live Demo
PROACT SYNC 2013 - Breakout - Cisco UCS Director Live DemoPROACT SYNC 2013 - Breakout - Cisco UCS Director Live Demo
PROACT SYNC 2013 - Breakout - Cisco UCS Director Live Demo
 
Deploying lync server_2010_enterprise
Deploying lync server_2010_enterpriseDeploying lync server_2010_enterprise
Deploying lync server_2010_enterprise
 

DevOpsPDF

  • 2.
  • 4. tasks • understand problems • terminology agreement • structure agreement • share perspectives 4
  • 5. problems • stand interference • stand starvation • create new stand - $$$ • reproduce release - ??? 5
  • 6. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure 6
  • 7. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure 6
  • 8. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure 6
  • 9. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure 6
  • 10. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure 6
  • 11. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure 6
  • 12. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure 6
  • 13. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure 6
  • 14. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure 6
  • 15. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure 6
  • 16. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure 6
  • 17. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure 6
  • 18. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure 6
  • 19. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure problems? 7
  • 20. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure manual problems? 7
  • 21. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure manual dependencies problems? 7
  • 22. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure manual per repo dependencies problems? 7
  • 23. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure manual per repo per repo dependencies problems? 7
  • 24. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure manual per repo per repohardcoded dependencies problems? 7
  • 25. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure manual per repo per repo none hardcoded dependencies problems? 7
  • 27. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure 9 manual per repo per repo none hardcoded dependencies
  • 28. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure 9 manual per repo per repo none hardcoded dependencies
  • 29. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure 9 manual per repo per repo none hardcoded dependencies
  • 30. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure 9 manual per repo per repo none hardcoded dependencies
  • 31. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure 9 manual per repo per repo none hardcoded dependencies
  • 32. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure 9 manual per repo per repo none hardcoded dependencies
  • 33. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure 10
  • 34. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure one repo 10
  • 35. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure ANSIBLEplaybook one repo 10
  • 36. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure ANSIBLEplaybook one repo ansible inventories 10
  • 37. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure ANSIBLEplaybook one repo vagrant w/ ansible ansible inventories 10
  • 38. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure ansible vars ANSIBLEplaybook one repo vagrant w/ ansible ansible inventories 10
  • 39. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure ansible vars ANSIBLEplaybook one repo vagrant w/ ansible ansible inventories 10 build & upload
  • 40. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure ansible vars ANSIBLEplaybook ansibleops role one repo vagrant w/ ansible ansible inventories 10 build & upload
  • 41. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure manual ansible vars ANSIBLEplaybook ansibleops role one repo vagrant w/ ansible ansible inventories 10 build & upload
  • 42. Ansible • inventories • playbook • tasks • vars • roles 11 a B 1010 0101
  • 44. role • meta /dependencies/ • defaults /vars/ • tasks • templates • handlers B 13
  • 45. tasks - name: install s3cmd sudo: yes apt: name=s3cmd state=present - name: Add config for s3cmd template: src: s3cfg.j2 dest: ~/.s3cfg mode: 0600 14
  • 46. tasks - name: Cleanup build archive file: dest: "{{ frontend_file_local }}" state: absent - name: Add deploy event to DataDog when: stand.monitored datadog_event: title: "Deployed {{ microservice.name }}" text: "to host {{ host }} for {{ stand.name }}" api_key: "{{ truckloads.datadog_key }}" 15
  • 47. variables --- # This role requires `microservice` variable with # following contend: # - name: Name of the repo, service, user, artifact folder # - branch: specifies exact artifact to pull # - env: specifies sh file that will fill environment # variables for service microservice_service_name: "{{ microservice.name }}" microservice_username: "{{ microservice.name }}" microservice_file_local: "/opt/{{ microservice.name }}.jar" 16
  • 48. variables --- # This structure defines # deployment stand settings stand: name: test monitored: yes dns: api: test-api.truckerpath.com api_port: 80 # for frontend config webbrokers: test-ship.truckerpath.com 17
  • 49. ▶ <group>.yml ▶ group_vars ▶ all.yml ▶ <group>.yml ▶ inventories ▶ test ▶ inventory ▶ group_vars ▶ stand.yml File structure ▶ Vagrantfile ▶ requirements.yml ▶ roles ▶ essential ▶ database ▶ microservice ▶ frontend ▶ ... 18
  • 50. all.yml --- # Global variables for entire truckloads product # and definitions of shared resources truckloads: datadog_key: “XXXXXXX" artifacts: region: us-west-2 bucket: truckloads-artifacts backups: region: us-west-2 bucket: truckloads-backups 19
  • 51. all.yml ## ... parse: test: app_id: "XXXXX" javascript_key: “XXX" dev: app_id: "XXXXX" javascript_key: "XXX" 20
  • 52. stand.yml --- stand: name: test monitored: yes branch: backend: latest/production webbrokers: latest/TB-144 parse: "{{ truckloads.parse.test }}" 21
  • 53. stand.yml --- stand: # ... db: provision: yes user: gilfoyle pass: XXXXXXXX host: localhost 22
  • 54. group_vars/*.yml --- # This are values for susanin # required by microservice role susanin: name: susanin branch: "{{ stand.branch.susanin }}" env: | export PORT="{{ stand.susanin.port }}" 23
  • 55. <group>.yml --- - hosts: susanin roles: - essential - role: microservice microservice: "{{ susanin }}" 24
  • 56. usage ansible-playbook backend.yml -i inventories/prod 25 group stand
  • 57. usage ansible-playbook stand.yml -i inventories/test ansible-playbook backend.yml -i inventories/vagrant ansible-playbook rainman.yml -i inventories/otann ansible-playbook microservices.yml -i inventories/otann -l susanin 26 subgroup
  • 58. Vagrant/file config.vm.network :forwarded_port, guest: 5432, host: 5432 # postgres config.vm.network :forwarded_port, guest: 80, host: 8080 # backend 27
  • 59. Vagrant/file config.vm.provision "ansible" do |ansible| ansible.playbook = "stand.yml" ansible.inventory_path = "inventories/vagrant" ansible.limit = "all" end 28 subgroup group
  • 60. Vagrant/file config.vm.provision "ansible" do |ansible| ansible.playbook = "microservices.yml" ansible.inventory_path = "inventories/vagrant" ansible.limit = "saferwatch" end 29 subgroup group
  • 61. Todo • database migrations • cache backup reuse • component dependencies 30
  • 62. plans • docker vs. existing • speed? • packer vs docker • AMI building w/ docker • terraform provisioning • balancer • dns 31
  • 63. Result • component - deployment unit • stand - deployed components • config values outside repo • stand config vs global config • declarative & role-based devops 32
  • 65. Code & Config Artifacts BackupsResources Stands configuration provision deploy restore or backup backup deploy build 1010 0101 1010 0101 a 1.0 B 2.1 01/10 11/26 a 1.2 B 2.0 a 1.4 B 2.1 a 1.3 B 2.0 configure 34