Orchestra)on ¡Tool ¡Roundup ¡-‑ ¡ ¡
Docker ¡Swarm ¡vs. ¡Kubernetes, ¡TerraForm ¡vs. ¡ TOSCA/Cloudify ¡vs. ¡Heat ¡
Orchestra)on Tool Roundup - Docker Swarm vs. Kubernetes, - - PowerPoint PPT Presentation
Orchestra)on Tool Roundup - Docker Swarm vs. Kubernetes, TerraForm vs. TOSCA/Cloudify vs. Heat Agenda Orchestra)on 101.. Different approaches for
Orchestra)on ¡Tool ¡Roundup ¡-‑ ¡ ¡
Docker ¡Swarm ¡vs. ¡Kubernetes, ¡TerraForm ¡vs. ¡ TOSCA/Cloudify ¡vs. ¡Heat ¡
Agenda ¡
Orchestra)on ¡101 ¡
Orchestra)on ¡is ¡a ¡means ¡to ¡Automate ¡Manual ¡Processes ¡ ¡
Orchestra)on ¡101 ¡
– Use ¡DSL ¡to ¡define ¡a ¡model ¡ – Execute ¡processes ¡based ¡on ¡the ¡model ¡ – Pass ¡context ¡informa)on ¡between ¡the ¡deployed ¡
en))es ¡
– Plugin ¡oriented ¡architecture ¡
¡
approaches ¡ ¡
– Applica)on ¡Architecture ¡ – PlaRorm ¡bias ¡ – Infrastructure ¡ ¡ – Scope ¡of ¡automa)on ¡ ¡
Goals ¡of ¡this ¡Exercise ¡
Explore ¡the ¡ different ¡ approaches ¡to ¡
¡
Infrastructure ¡ Centric ¡ Pure ¡Play ¡ Container ¡ Centric ¡
Method ¡of ¡Comparison ¡
– Container ¡Centric ¡– ¡Kubernetes, ¡Docker/Swarm ¡ – Pure ¡Play ¡–Cloudify/TOSCA, ¡Terraform, ¡ – Infrastructure ¡Centric ¡-‑ ¡Heat ¡ ¡
– PaaS, ¡Configura)on ¡Management ¡(e.g ¡Chef, ¡Puppet, ¡Ansible,..) ¡ – Covering ¡all ¡orchestra)ons ¡solu)ons ¡ ¡ – Deep ¡Dive ¡into ¡each ¡orchestra)on ¡technology ¡ ¡
¡ ¡
The ¡Test ¡Applica)on ¡ ¡
VM ¡ mongod ¡ VM ¡ NodeJS ¡ mongos ¡ VM ¡ NodeJS ¡ mongos ¡ VM ¡ Mongo-‑cfg ¡ VM ¡ Mongo-‑cfg ¡ VM ¡ Mongo-‑cfg ¡ Load ¡Balancer ¡ VM ¡ NodeJS ¡ mongos ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡
Orchestra)on ¡Process ¡-‑ ¡Setup ¡
VM ¡ VM ¡ VM ¡ VM ¡ VM ¡ VM ¡ Load ¡Balancer ¡ VM ¡ VM ¡ VM ¡ VM ¡ VM ¡ VM ¡ VM ¡ VM ¡ VM ¡
Create ¡network ¡and ¡ compute ¡resources: ¡ VMs, ¡security ¡group, ¡ network, ¡subnet, ¡ routers, ¡LB ¡pool ¡
1
Orchestra)on ¡Process ¡-‑ ¡Setup ¡
VM ¡ mongod ¡ VM ¡ NodeJS ¡ mongos ¡ VM ¡ NodeJS ¡ mongos ¡ VM ¡ Mongo-‑cfg ¡ VM ¡ Mongo-‑cfg ¡ VM ¡ Mongo-‑cfg ¡ Load ¡Balancer ¡ VM ¡ NodeJS ¡ mongos ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡
Install ¡Mongo ¡and ¡ Node ¡Binaries ¡
2
Orchestra)on ¡Process ¡-‑ ¡Setup ¡
VM ¡ mongod ¡ VM ¡ NodeJS ¡ mongos ¡ VM ¡ NodeJS ¡ mongos ¡ VM ¡ Mongo-‑cfg ¡ VM ¡ Mongo-‑cfg ¡ VM ¡ Mongo-‑cfg ¡ Load ¡Balancer ¡ VM ¡ NodeJS ¡ mongos ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡
Start ¡mongod ¡ processes ¡ Start ¡mongod ¡ processes ¡ Start ¡mongod ¡ processes ¡
3
Orchestra)on ¡Process ¡-‑ ¡Setup ¡
VM ¡ mongod ¡ VM ¡ NodeJS ¡ mongos ¡ VM ¡ NodeJS ¡ mongos ¡ VM ¡ Mongo-‑cfg ¡ VM ¡ Mongo-‑cfg ¡ VM ¡ Mongo-‑cfg ¡ Load ¡Balancer ¡ VM ¡ NodeJS ¡ mongos ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡
Start ¡mongo-‑cfg ¡ proecesses ¡ Start ¡mongo-‑cfg ¡ proecesses ¡ Start ¡mongo-‑cfg ¡ processes ¡
4
Orchestra)on ¡Process ¡-‑ ¡Setup ¡
VM ¡ mongod ¡ VM ¡ NodeJS ¡ mongos ¡ VM ¡ NodeJS ¡ mongos ¡ VM ¡ Mongo-‑cfg ¡ VM ¡ Mongo-‑cfg ¡ VM ¡ Mongo-‑cfg ¡ Load ¡Balancer ¡ VM ¡ NodeJS ¡ mongos ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡
Start ¡mongos ¡ processes, ¡ poin)ng ¡to ¡config ¡ servers ¡ ¡ Start ¡mongos ¡ processes, ¡ poin)ng ¡to ¡config ¡ servers ¡ ¡ Start ¡mongos ¡ processes, ¡poin)ng ¡ to ¡mongo-‑cfg ¡ servers ¡ ¡
5
Orchestra)on ¡Process ¡-‑ ¡Setup ¡
VM ¡ mongod ¡ VM ¡ NodeJS ¡ mongos ¡ VM ¡ NodeJS ¡ mongos ¡ VM ¡ Mongo-‑cfg ¡ VM ¡ Mongo-‑cfg ¡ VM ¡ Mongo-‑cfg ¡ Load ¡Balancer ¡ VM ¡ NodeJS ¡ mongos ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡
Pick ¡one ¡mongos ¡and ¡ ini)alize ¡replica ¡set ¡ Pick ¡one ¡mongos ¡and ¡ ini)alize ¡replica ¡set ¡ Pick ¡one ¡VM ¡per ¡shard ¡ and ¡ini)alize ¡replica ¡set ¡
6
Orchestra)on ¡Process ¡-‑ ¡Setup ¡
VM ¡ mongod ¡ VM ¡ NodeJS ¡ mongos ¡ VM ¡ NodeJS ¡ mongos ¡ VM ¡ Mongo-‑cfg ¡ VM ¡ Mongo-‑cfg ¡ VM ¡ Mongo-‑cfg ¡ Load ¡Balancer ¡ VM ¡ NodeJS ¡ mongos ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡
Pick ¡one ¡mongos ¡and ¡add ¡ shards, ¡one ¡at ¡a ¡)me ¡ ¡
7
Orchestra)on ¡Process ¡-‑ ¡Setup ¡
VM ¡ mongod ¡ VM ¡ NodeJS ¡ mongos ¡ VM ¡ NodeJS ¡ mongos ¡ VM ¡ Mongo-‑cfg ¡ VM ¡ Mongo-‑cfg ¡ VM ¡ Mongo-‑cfg ¡ Load ¡Balancer ¡ VM ¡ NodeJS ¡ mongos ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡
Pick ¡one ¡mongos ¡and ¡ ini)alize ¡data ¡in ¡mongodb ¡
8
Orchestra)on ¡Process ¡-‑ ¡Setup ¡
VM ¡ mongod ¡ VM ¡ NodeJS ¡ mongos ¡ VM ¡ NodeJS ¡ mongos ¡ VM ¡ Mongo-‑cfg ¡ VM ¡ Mongo-‑cfg ¡ VM ¡ Mongo-‑cfg ¡ Load ¡Balancer ¡ VM ¡ NodeJS ¡ mongos ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡
Start ¡nodejs ¡ processes ¡ Start ¡nodejs ¡ processes ¡ Start ¡nodejs ¡ processes ¡
9
Orchestra)on ¡Process ¡-‑ ¡Setup ¡
VM ¡ mongod ¡ VM ¡ NodeJS ¡ mongos ¡ VM ¡ NodeJS ¡ mongos ¡ VM ¡ Mongo-‑cfg ¡ VM ¡ Mongo-‑cfg ¡ VM ¡ Mongo-‑cfg ¡ Load ¡Balancer ¡ VM ¡ NodeJS ¡ mongos ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡ VM ¡ mongod ¡
Add ¡nodejs ¡VMs ¡to ¡ LB ¡pool ¡
10
Orchestra)ng ¡in ¡Produc)on ¡ ¡
– Backup ¡and ¡restore ¡ ¡ – Con)nuous ¡deployment ¡ – Infrastructure ¡upgrades ¡and ¡patches ¡ ¡
Common ¡Requirements ¡
¡
Series ¡1: ¡Container ¡Centric ¡
The ¡Container ¡Difference ¡
“machines” ¡
configure ¡run)me ¡
¡ ¡ ¡
scale ¡the ¡cluster ¡itself? ¡ ¡ ¡
Quick ¡Overview ¡of ¡Docker ¡Swarm ¡
A ¡Docker-‑na)ve ¡clustering ¡system ¡
¡ ¡ ¡
Swarm ¡Architecture ¡
Quick ¡Overview ¡of ¡Docker ¡Compose ¡
A ¡Docker-‑na,ve ¡command ¡line ¡tool ¡for ¡defining ¡ mul,-‑container ¡applica,ons ¡
¡ ¡
Solu4on ¡Overview ¡-‑ ¡Deploy ¡-‑ ¡Create ¡ Cfg ¡Servers ¡
version: ¡"2" ¡ services: ¡ ¡ ¡mongocfg: ¡ ¡ ¡ ¡ ¡build: ¡./mongodb ¡ ¡ ¡ ¡ ¡command: ¡mongod ¡-‑-‑dbpath ¡/data/db ¡-‑-‑configsvr ¡-‑-‑port ¡27019 ¡ ¡ ¡ ¡ ¡labels: ¡ ¡ ¡ ¡ ¡ ¡ ¡node-‑type: ¡config ¡ ¡ ¡ ¡ ¡ports: ¡ ¡ ¡ ¡ ¡ ¡ ¡-‑ ¡"27019:27019“ ¡ environment: ¡ ¡ ¡ ¡ ¡ ¡ ¡“affinity:node-‑type!=config” ¡ ¡ ¡ ¡ ¡ ¡ ¡MONGODB_PORT: ¡27018 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡MONGODB_REPL_SET: ¡rs0 ¡ ¡ ¡
Solu4on ¡Overview ¡-‑ ¡Deploy ¡-‑ ¡Create ¡ Replica ¡Sets ¡ ¡
version: ¡"2" ¡ services: ¡ ¡ ¡mongodb: ¡ ¡ ¡ ¡ ¡build: ¡./mongodb ¡ ¡ ¡ ¡ ¡ ¡command: ¡-‑-‑shardsvr ¡-‑-‑dbpath ¡/data/db ¡–replSet ¡ rs0 ¡ ¡ ¡ ¡ ¡labels: ¡ ¡ ¡ ¡ ¡ ¡ ¡node-‑type: ¡shard ¡ ¡ ¡ ¡ ¡ports: ¡ ¡ ¡ ¡ ¡ ¡ ¡-‑ ¡"27018:27018“ ¡ ¡ ¡ ¡ ¡links: ¡ ¡ ¡ ¡ ¡ ¡ ¡mongoc ¡ ¡ ¡ ¡ ¡environment: ¡ ¡ ¡ ¡ ¡ ¡ ¡“affinity:node-‑type!=shard” ¡ ¡ ¡ ¡ ¡ ¡ ¡MONGODB_PORT: ¡27018 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡MONGODB_REPL_SET: ¡rs0 ¡
Solu4on ¡Overview ¡-‑ ¡Deploy ¡-‑ ¡Create ¡ Mongo ¡Proxies ¡ ¡
version: ¡"2" ¡ services: ¡ ¡ ¡mongodb: ¡ ¡ ¡ ¡ ¡build: ¡./mongodb ¡ ¡ ¡ ¡ ¡ ¡command: ¡mongos ¡–configdb ¡mongoc:27017 ¡ ¡ ¡ ¡ ¡labels: ¡ ¡ ¡ ¡ ¡ ¡ ¡node-‑type: ¡proxy ¡ ¡ ¡ ¡ ¡ports: ¡ ¡ ¡ ¡ ¡ ¡ ¡-‑ ¡"27017:27017“ ¡ ¡ ¡ ¡ ¡links: ¡ ¡ ¡ ¡ ¡ ¡ ¡mongoc ¡ ¡ ¡ ¡ ¡environment: ¡ ¡ ¡ ¡ ¡ ¡ ¡“affinity:node-‑type!=shard” ¡
Solu4on ¡Overview ¡-‑ ¡Deploy ¡-‑ ¡Create ¡ Nodejs ¡containers ¡
version: ¡"2" ¡ services: ¡ ¡ ¡nodejs: ¡ ¡ ¡ ¡ ¡build: ¡./nodejs ¡ ¡ ¡labels: ¡ ¡ ¡ ¡ ¡ ¡ ¡node-‑type: ¡nodejs ¡ ¡ ¡ ¡ ¡ports: ¡ ¡ ¡ ¡ ¡ ¡ ¡-‑ ¡"27017:27017“ ¡ ¡ ¡ ¡ ¡links: ¡ ¡ ¡ ¡ ¡ ¡ ¡mongoc ¡ ¡ ¡ ¡ ¡environment: ¡ ¡ ¡ ¡ ¡ ¡ ¡“affinity:node-‑type!=nodejs” ¡ ¡ ¡ ¡ ¡ ¡ ¡“affinity:node-‑type==proxy ¡
Solu4on ¡Overview ¡-‑ ¡Deploy ¡-‑ ¡ Reconfigure ¡HAProxy ¡
Extract ¡Node.js ¡container ¡IPs ¡using ¡docker ¡ inspect ¡and ¡then: ¡
¡
for ¡i ¡in ¡1..{number_of_nodejs_servers} ¡ ¡ ¡docker ¡exec ¡haproxy1 ¡\ ¡ ¡ ¡ ¡ ¡reconfigure.sh ¡\ ¡ ¡ ¡ ¡ ¡ ¡ ¡-‑-‑add=<IP_of_nodejs{i}:port> ¡ ¡
Solu4on ¡Overview ¡-‑ ¡Mongodb ¡scale ¡out ¡ ¡ ¡
Manual ¡Only ¡– ¡external ¡to ¡orchestra)on: ¡
shard: ¡“sh.addShard(“rs0/mongod_2:27017") ¡ ¡
Compose ¡Solu4on ¡Overview ¡– ¡Review ¡
cluster ¡up. ¡
complex ¡cases, ¡but ¡then ¡DSL ¡is ¡lost. ¡ ¡
Docker ¡Swarm ¡-‑ ¡Pros ¡and ¡Cons ¡
Pros
scaling
Cons
handling
autohealing (e.g. no autoscaling)
Kubernetes ¡
Quick ¡Overview ¡to ¡Kubernetes ¡
Container ¡cluster ¡manager ¡ ¡
number ¡of ¡pod ¡"replicas" ¡are ¡running ¡at ¡any ¡
pods ¡
Kubernetes ¡Architecture ¡
Sample Replication Controller
apiVersion: ¡v1beta3 ¡ kind: ¡ReplicationController ¡ spec: ¡ ¡ ¡replicas: ¡3 ¡ ¡ ¡selector: ¡ ¡ ¡ ¡ ¡name: ¡mongod-‑rs1 ¡ ¡ ¡template: ¡ ¡ ¡ ¡ ¡metadata: ¡ ¡ ¡ ¡ ¡ ¡ ¡labels: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡name: ¡mongod-‑rs1 ¡ ¡ ¡ ¡ ¡spec: ¡ ¡ ¡ ¡ ¡ ¡ ¡containers: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡-‑ ¡command: ¡[mongod, ¡-‑-‑port, ¡27017, ¡-‑-‑replSet, ¡rs1] ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡image: ¡example/mongod ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡name: ¡mongod-‑rs1 ¡ ¡ ¡
Sample Service Configuration
apiVersion: ¡v1beta3 ¡ kind: ¡Service ¡ metadata: ¡ ¡ ¡labels: ¡ ¡ ¡ ¡ ¡type: ¡nodejs ¡ ¡ ¡name: ¡nodejs ¡ spec: ¡ ¡ ¡ports: ¡ ¡ ¡ ¡ ¡-‑ ¡port: ¡80 ¡ ¡ ¡ ¡ ¡ ¡ ¡targetPort: ¡8080 ¡ ¡ ¡selector: ¡ ¡ ¡ ¡ ¡type: ¡nodejs ¡ ¡ ¡createExternalLoadBalancer: ¡true ¡
¡
Solu4on ¡Overview ¡-‑ ¡Deploy ¡ ¡
for ¡i ¡in ¡1..3 ¡ ¡ ¡kubectl ¡create ¡-‑f ¡mongod-‑configsvr{i}-‑controller.yaml ¡ ¡ ¡kubectl ¡create ¡-‑f ¡mongod-‑configsvr{i}-‑service.yaml ¡
¡
kubectl ¡create ¡-‑f ¡mongos-‑controller.yaml ¡ kubectl ¡create ¡-‑f ¡mongos-‑service.yaml ¡
¡
Solu4on ¡Overview ¡-‑ ¡Deploy ¡-‑ ¡Create ¡ Data ¡nodes ¡ ¡
for ¡i ¡in ¡1..{number_of_replica_sets} ¡ ¡ ¡kubectl ¡create ¡-‑f ¡\ ¡ ¡ ¡ ¡ ¡mongod-‑rs{i}-‑controller.yaml ¡ ¡ ¡ ¡ ¡ ¡# ¡Now ¡configure ¡each ¡replicate ¡set ¡ ¡ ¡# ¡by ¡picking ¡pod ¡to ¡be ¡the ¡initial ¡“master” ¡ ¡ ¡# ¡of ¡each ¡replica ¡set ¡and ¡extract ¡all ¡ ¡ ¡# ¡containers ¡IPs ¡using ¡“kubectl ¡get ¡-‑l ¡...” ¡ ¡ ¡ ¡# ¡dynamically ¡update ¡replica ¡set ¡ ¡ ¡# ¡members ¡(this ¡will ¡kick ¡of ¡this ¡process) ¡ ¡ ¡kubectl ¡create ¡-‑f ¡mongod-‑rs{i}-‑service.yaml ¡
Kubernetes ¡-‑ ¡Pros ¡and ¡Cons ¡ ¡
Pros
configuration autoheal
balancer
scaling
rollbacks
Cons
Swarm)
scale, rolling update).
Series ¡2: ¡Pure ¡Play ¡Orchestra)on ¡
Introduction to Terraform
line tool
– Resources – Providers and provisioners – Modules – Variables and outputs
Sample Configuration
resource ¡"openstack_compute_secgroup_v2" ¡"nodejs_security_group" ¡{ ¡ ¡ ¡ ¡ ¡name ¡= ¡"nodejs_security_group" ¡ ¡ ¡ ¡ ¡description ¡= ¡"security ¡group ¡for ¡mongodb" ¡ ¡ ¡ ¡ ¡rule ¡{ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡from_port ¡= ¡22 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡to_port ¡= ¡22 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ip_protocol ¡= ¡"tcp" ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡cidr ¡= ¡"0.0.0.0/0" ¡ ¡ ¡ ¡ ¡} ¡ ¡ ¡ ¡ ¡rule ¡{ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡from_port ¡= ¡"${var.nodejs_port}" ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡to_port ¡= ¡"${var.nodejs_port}" ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ip_protocol ¡= ¡"tcp" ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡cidr ¡= ¡"0.0.0.0/0" ¡ ¡ ¡ ¡ ¡} ¡ } ¡
Sample Configuration
¡ ¡# ¡ # ¡Create ¡a ¡Network ¡ # ¡ resource ¡"openstack_networking_network_v2" ¡"tf_network" ¡{ ¡ ¡ ¡ ¡ ¡region ¡= ¡"" ¡ ¡ ¡ ¡ ¡name ¡= ¡"tf_network" ¡ ¡ ¡ ¡ ¡admin_state_up ¡= ¡"true" ¡ } ¡ # ¡ # ¡Create ¡a ¡subnet ¡in ¡our ¡new ¡network ¡ # ¡Notice ¡here ¡we ¡use ¡a ¡TF ¡variable ¡for ¡the ¡name ¡of ¡our ¡network ¡above. ¡ # ¡ resource ¡"openstack_networking_subnet_v2" ¡"tf_net_sub1" ¡{ ¡ ¡ ¡ ¡ ¡region ¡= ¡"" ¡ ¡ ¡ ¡ ¡network_id ¡= ¡"${openstack_networking_network_v2.tf_network.id}" ¡ ¡ ¡ ¡ ¡cidr ¡= ¡"192.168.1.0/24" ¡ ¡ ¡ ¡ ¡ip_version ¡= ¡4 ¡ } ¡
Sample Configuration (Config Server)
resource ¡"openstack_compute_instance_v2" ¡"mongoc_host" ¡{ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡count ¡= ¡"3" ¡ ¡ ¡ ¡ ¡region ¡= ¡"" ¡ ¡ ¡ ¡ ¡name ¡= ¡"mongoc_host" ¡ ¡ ¡ ¡ ¡image_name ¡= ¡"${var.image_name}" ¡ ¡ ¡ ¡ ¡flavor_name ¡= ¡"${var.flavor_name}" ¡ ¡ ¡ ¡ ¡key_pair ¡= ¡"tf-‑keypair-‑1" ¡ ¡ ¡ ¡ ¡security_groups ¡= ¡["mongo_security_group"] ¡ ¡ ¡ ¡ ¡network ¡{ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡uuid ¡= ¡"${openstack_networking_network_v2.tf_network.id}" ¡ ¡ ¡ ¡ ¡} ¡ ¡ ¡ ¡ ¡... ¡ ¡ ¡ ¡ ¡provisioner ¡"remote-‑exec" ¡{ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡scripts ¡= ¡[ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡"scripts/install_mongo.sh" ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡"start_mongoc.sh" ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡] ¡ ¡ ¡ ¡ ¡} ¡ } ¡
Sample Configuration (Shard)
resource ¡"openstack_compute_instance_v2" ¡"mongod_host" ¡{ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡count ¡= ¡"3" ¡ ¡ ¡ ¡ ¡region ¡= ¡"" ¡ ¡ ¡ ¡ ¡name ¡= ¡"mongod_host" ¡ ¡ ¡ ¡ ¡image_name ¡= ¡"${var.image_name}" ¡ ¡ ¡ ¡ ¡flavor_name ¡= ¡"${var.flavor_name}" ¡ ¡ ¡ ¡ ¡key_pair ¡= ¡"tf-‑keypair-‑1" ¡ ¡ ¡ ¡ ¡security_groups ¡= ¡["mongo_security_group"] ¡ ¡ ¡ ¡ ¡network ¡{ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡uuid ¡= ¡"${openstack_networking_network_v2.tf_network.id}" ¡ ¡ ¡ ¡ ¡} ¡ ¡ ¡ ¡ ¡... ¡ ¡ ¡ ¡ ¡provisioner ¡"remote-‑exec" ¡{ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡scripts ¡= ¡[ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡"scripts/install_mongo.sh" ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡"start_mongod.sh" ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡] ¡ ¡ ¡ ¡ ¡} ¡ } ¡
Solution Overview
security groups, VMs, LBaaS pool
– No easy way to specify "I want X occurrences of this
module"
– Just copy and paste...
Terraform - Pros and Cons
Pros
Framework neutrality
OpenStack
applying
updates
Cons
portable across cloud providers
infrastructure components
context of a single resource instance
TOSCA / Cloudify
What ¡is ¡TOSCA? ¡
TOSCA ¡defines ¡the ¡ interoperable ¡ descrip)on ¡of ¡ applica)ons; ¡including ¡ their ¡components, ¡ rela)onships, ¡ dependencies, ¡ requirements, ¡and ¡ capabili)es…. ¡
¡ ¡
Cloudify ¡– ¡Open ¡Source ¡ Implementa)on ¡of ¡TOSCA ¡ ¡
Provision ¡ Configure ¡ Monitor ¡ Manage ¡
Infrastructure ¡
Can ¡be ¡used ¡as ¡a ¡ command ¡line ¡tool ¡or ¡ as ¡a ¡managed ¡service ¡
Plugins ¡
CM ¡ Monitoring ¡& ¡ Alarming ¡
Cloudify ¡– ¡Open ¡Source ¡ Implementa)on ¡of ¡TOSCA ¡ ¡
Provision ¡ Configure ¡ Monitor ¡ Manage ¡
Monitoring ¡& ¡ Alarming ¡ Infrastructure ¡
Can ¡be ¡used ¡as ¡a ¡ command ¡line ¡tool ¡or ¡ as ¡a ¡managed ¡service ¡
Plugins ¡
CM ¡
So:ware ¡ Component ¡ Container ¡ (Docker ¡Run,me ¡ Capability) ¡
Containee ¡
(Docker ¡Run,me ¡ Requirement) ¡ ¡
Requirements Capabilities # ¡NOT ¡YET ¡IN ¡TOSCA ¡SPEC. ¡TO ¡BE ¡INVENTED… ¡ repositories: ¡ ¡ ¡docker_hub: ¡ ¡ ¡ ¡ ¡url: ¡xxx ¡ ¡ ¡ ¡ ¡credentials: ¡yyy ¡ ¡ node_templates: ¡ ¡ ¡ ¡ ¡ ¡docker_webserver: ¡ ¡ ¡ ¡ ¡type: ¡tosca.nodes.Container ¡ ¡ ¡ ¡ ¡requirements: ¡ ¡ ¡ ¡ ¡ ¡ ¡-‑ ¡host: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡# ¡omitted ¡for ¡brevity ¡ ¡ ¡ ¡ ¡artifacts: ¡ ¡ ¡ ¡ ¡ ¡ ¡-‑ ¡my_image: ¡< ¡URI ¡of ¡Docker ¡Image ¡in ¡Repo. ¡> ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡type: ¡tosca.artifacts.impl.Docker.Image: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡repository: ¡docker_repo ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Container Container Docker Rocket
…
artifact_types: ¡ ¡ ¡tosca.artifacts.impl.Docker.Image: ¡ ¡ ¡ ¡ ¡derived_from: ¡tosca.artifacts.Root ¡ ¡ ¡ ¡ ¡description: ¡Docker ¡Image ¡TAR ¡ ¡ ¡ ¡ ¡mime_type: ¡TBD ¡ ¡ ¡ ¡ ¡file_ext: ¡[ ¡tar ¡] ¡Docker ¡Hub ¡ (Repo.) ¡
Ar4facts ¡
Image ¡
Containers ¡Portability ¡in ¡TOSCA ¡ ¡
Source: ¡Vmware ¡Proposal ¡
Solution Overview
Mongod-‑shard ¡ Mongo ¡replica-‑ set ¡ Output: Mogoconfig hosts Shards endpoint Subsitutable
*Scalable *ScalableInput: #config instances #Shards #Replica set per shard Input: #nodeJS instances mongodb deployment id or MongoConfig Mogo Shards Output: App EndPoint = Load-Balancer IP/path Mongo ¡ cfg ¡
*ScalableIni)aliza)on ¡ Ini)aliza)on ¡
Load ¡Balancer ¡ NodeJS ¡ MongoS ¡
*Scalable *Scalable
Infrastructure setup
node_templates: ¡ ¡ ¡nodecellar_security_group: ¡ ¡ ¡ ¡ ¡type: ¡cloudify.openstack.nodes.SecurityGroup ¡ ¡ ¡ ¡ ¡properties: ¡ ¡ ¡ ¡ ¡ ¡ ¡security_group: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡name: ¡nodecellar_security_group ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡rules: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡-‑ ¡remote_ip_prefix: ¡0.0.0.0/0 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡port: ¡{ ¡get_property: ¡[ ¡nodecellar, ¡port ¡] ¡} ¡
Create Mongo Shards
mongodb: ¡ ¡ ¡type: ¡tosca.nodes.mongodb.Shard ¡ ¡ ¡directives: ¡[substitutable] ¡ ¡ ¡properties: ¡ ¡ ¡ ¡count: ¡{ ¡get_input: ¡servers_count_in_replica_set ¡} ¡ ¡ ¡requirements: ¡ ¡ ¡ ¡-‑ ¡host: ¡ ¡ ¡ ¡ ¡ ¡node: ¡mongo_server ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡capabilities: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡scalable: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡properties: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡min_instances: ¡1 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡max_instances: ¡10 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡default_instances: ¡{ ¡get_input: ¡mongodb_rs_count ¡} ¡ ¡
MongoDB ReplicaSet MongoDB Server
*scalable
Create Compute Instances
¡ ¡mongo_server: ¡
¡ ¡ ¡ ¡type: ¡tosca.nodes.Compute ¡ ¡ ¡ ¡ ¡capabilities: ¡ ¡ ¡ ¡ ¡ ¡ ¡host: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡properties: ¡*host_capabilities ¡ ¡ ¡ ¡ ¡ ¡ ¡os: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡properties: ¡*os_capabilities ¡ ¡ ¡ ¡ ¡ ¡ ¡scalable: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡properties: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡min_instances: ¡1 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡max_instances: ¡10 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡default_instances: ¡5 ¡
Create MongoDB Replica Set
mongo_db_replica_set: ¡ ¡ ¡ ¡type: ¡tosca.nodes.DBMS ¡ ¡ ¡ ¡requirements: ¡ ¡ ¡ ¡ ¡ ¡-‑ ¡host: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡node: ¡mongo_server ¡ ¡ ¡ ¡interfaces: ¡ ¡ ¡ ¡ ¡ ¡Standard: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡create: ¡Scripts/mongodb/create.sh ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡configure: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡implementation: ¡Scripts/mongodb/config.sh ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡inputs: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡mongodb_ip: ¡{ ¡get_attribute: ¡[mongo_server, ¡addr] ¡} ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡start: ¡Scripts/mongodb/start.sh ¡ ¡ ¡ ¡ ¡
Create NodeJS Containers
nodecellar_container: ¡
¡ ¡ ¡ ¡ ¡ ¡type: ¡tosca.nodes.NodeCellarAppContainer ¡ ¡ ¡ ¡ ¡ ¡ ¡properties: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡port: ¡{ ¡get_input: ¡nodejs_app_port ¡} ¡ ¡ ¡ ¡ ¡ ¡ ¡interfaces: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡cloudify.interfaces.lifecycle: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡create: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡inputs: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡.... ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡command: ¡nodejs ¡server.js ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡environment: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡NODECELLAR_PORT: ¡{ ¡get_property: ¡[SELF, ¡port] ¡} ¡
¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡MONGO_PORT: ¡{ ¡get_property: ¡[SELF, ¡database_connection, ¡port] ¡} ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡MONGO_HOST: ¡{ ¡get_attribute: ¡[SELF, ¡database_connection, ¡private_address] ¡} ¡
¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡….. ¡
Create Load Balancer
haproxy: ¡
¡ ¡ ¡ ¡type: ¡tosca.nodes.Proxy ¡ ¡ ¡ ¡ ¡properties: ¡ ¡ ¡ ¡ ¡ ¡ ¡frontend_port: ¡80 ¡ ¡ ¡ ¡ ¡ ¡ ¡statistics_port: ¡9000 ¡ ¡ ¡ ¡ ¡ ¡ ¡backend_app_port: ¡{ ¡get_property: ¡[ ¡nodecellar, ¡port ¡] ¡} ¡ ¡ ¡ ¡ ¡requirements: ¡ ¡ ¡ ¡ ¡ ¡ ¡-‑ ¡host: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡node: ¡haproxy_frontend_host ¡ ¡ ¡ ¡ ¡ ¡ ¡-‑ ¡member: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡node: ¡nodecellar_container ¡
¡
Get the web containers through relationship and update the load balancer accordingly
Handling Post Deployment through Workflow & Policies
Script execution in python with context to the deployment graph cfy ¡executions ¡start ¡-‑w ¡install ¡... ¡
Summary ¡TOSCA/Cloudify ¡
Pros
Framework neutrality
Management – day 0,1,2
log aggregation, healing, scaling, policies)*
infrastructure & software Cons
complaint yet (Aria)
Series ¡3: ¡Infrastructure ¡Centric ¡ ¡
¡
What ¡is ¡Heat? ¡ ¡
Heat ¡provides ¡a ¡ mechanism ¡for ¡
OpenStack ¡resources ¡ through ¡the ¡use ¡of ¡ modular ¡templates. ¡
Heat ¡Architecture ¡
Solution Overview
Mongo ¡replica-‑ set ¡ Output: Replica set node hosts ssh-key, private ip to the init node Input: # of replicas per shard Input: # of nodeJS instances MongoConfig hosts Mongo Shards hosts Output: mongos node hosts App EndPoint = Load-Balancer IP/path mogocfg ¡ Output: mogocfg node hosts Input: # of config instances Ini)alize ¡ replica-‑ set-‑script ¡ Ini)alize ¡ MongoS-‑ Script ¡
Load ¡Balancer ¡ NodeJS ¡ MongoS ¡
Infrastructure ¡setup ¡
resources: ¡ ¡secgroup: ¡ ¡ ¡ ¡type: ¡OS::Neutron::SecurityGroup ¡ ¡ ¡ ¡properties: ¡ ¡ ¡ ¡ ¡ ¡name: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡str_replace: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡template: ¡mongodb-‑$stackstr-‑secgroup ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡params: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡$stackstr: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡get_attr: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡-‑ ¡stack-‑string ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡-‑ ¡value ¡ ¡ ¡ ¡ ¡ ¡rules: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡-‑ ¡protocol: ¡icmp ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡-‑ ¡protocol: ¡tcp ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡port_range_min: ¡22 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡port_range_max: ¡22 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡-‑ ¡protocol: ¡tcp ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡port_range_min: ¡27017 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡port_range_max: ¡27019 ¡ ¡ ¡ ¡ ¡
Create Compute Instances
¡mongo_host: ¡ ¡ ¡ ¡type: ¡OS::Nova::Server ¡ ¡ ¡ ¡properties: ¡ ¡ ¡ ¡ ¡ ¡name: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡str_replace: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡template: ¡$stackprefix-‑$stackstr ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡params: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡$stackprefix: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡get_param: ¡stack-‑prefix ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡$stackstr: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡get_attr: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡-‑ ¡stack-‑string ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡-‑ ¡value ¡ ¡ ¡ ¡ ¡ ¡image: ¡ get_param: ¡image ¡ ¡ ¡ ¡ ¡ ¡flavor: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡get_param: ¡flavor ¡
¡ ¡ ¡ ¡ ¡security_groups: ¡¡ ¡ ¡ ¡ ¡ ¡ ¡-‑ ¡get_param: ¡security_group ¡
¡Create ¡MongoDB ¡Replica ¡Servers ¡
mongodb_peer_servers: ¡ ¡ ¡ ¡type: ¡"OS::Heat::ResourceGroup" ¡ ¡ ¡ ¡properties: ¡ ¡ ¡ ¡ ¡ ¡count: ¡{ ¡get_param: ¡peer_server_count ¡} ¡ ¡ ¡ ¡ ¡ ¡resource_def: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡type: ¡{ ¡get_param: ¡child_template ¡} ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡properties: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡server_hostname: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡str_replace: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡template: ¡'%name%-‑0%index%' ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡params: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡'%name%': ¡{ ¡get_param: ¡server_hostname ¡} ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡image: ¡{ ¡get_param: ¡image ¡} ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡flavor: ¡{ ¡get_param: ¡flavor ¡} ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ssh_key: ¡{ ¡get_resource: ¡ssh_key ¡} ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ssh_private_key: ¡{ ¡get_attr: ¡[ssh_key, ¡private_key] ¡} ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡kitchen: ¡{ ¡get_param: ¡kitchen ¡} ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡chef_version: ¡{ ¡get_param: ¡chef_version ¡} ¡
¡
Configure the Replica Servers
server_setup: ¡ ¡ ¡ ¡type: ¡"OS::Heat::ChefSolo" ¡ ¡ ¡ ¡depends_on: ¡ ¡ ¡ ¡-‑ ¡mongodb_peer_servers ¡ ¡ ¡ ¡properties: ¡ ¡ ¡ ¡ ¡ ¡username: ¡root ¡ ¡ ¡ ¡ ¡ ¡private_key: ¡{ ¡get_attr: ¡[ssh_key, ¡private_key] ¡} ¡ ¡ ¡ ¡ ¡ ¡host: ¡{ ¡get_attr: ¡[mongodb_peer_servers, ¡accessIPv4, ¡0] ¡} ¡ ¡ ¡ ¡ ¡ ¡kitchen: ¡{ ¡get_param: ¡kitchen ¡} ¡ ¡ ¡ ¡ ¡ ¡chef_version: ¡{ ¡get_param: ¡chef_version ¡} ¡ ¡ ¡ ¡ ¡ ¡node: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡mongodb: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ruby_gems: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡mongo: ¡'1.12.0' ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡bson_ext: ¡'1.12.0' ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡bind_ip: ¡{ ¡get_attr: ¡[mongodb_peer_servers, ¡privateIPv4, ¡0] ¡} ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡use_fqdn: ¡false ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡replicaset_members: ¡{ ¡get_attr: ¡[mongodb_peer_servers, ¡privateIPv4] ¡} ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡config: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡replset: ¡myreplset ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡run_list: ¡[ ¡"recipe[config_replset]" ¡] ¡ ¡
Create NodeJS Container
¡nodestack_chef_run: ¡ ¡ ¡ ¡type: ¡'OS::Heat::ChefSolo' ¡ ¡ ¡ ¡depends_on: ¡nodestack_node ¡ ¡ ¡ ¡properties: ¡ ¡... ¡ ¡ ¡ ¡ ¡ ¡node: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡nodejs_app: ¡ ¡... ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡deployment: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡id: ¡{ ¡get_param: ¡stack_id ¡} ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡app_id: ¡nodejs ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡run_list: ¡["recipe[apt]", ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡"recipe[nodejs]", ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡"recipe[ssh_known_hosts]", ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡"recipe[nodejs_app]"] ¡ ¡ ¡ ¡ ¡ ¡data_bags: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡nodejs: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡id: ¡{ ¡get_param: ¡stack_id ¡} ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡nodejs_app: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡password: ¡{ ¡get_attr: ¡[nodejs_user_password, ¡value] ¡} ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡deploy_key: ¡{ ¡get_param: ¡deploy_key ¡} ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡database_url: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡str_replace: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡template: ¡'mongodb://%dbuser%:%dbpasswd%@%dbhostname%' ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡params: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡'%dbuser%': ¡{ ¡get_param: ¡database_username ¡} ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡'%dbpasswd%': ¡{ ¡get_param: ¡database_user_password ¡} ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡'%dbhostname%': ¡{ ¡get_param: ¡db_server_ip ¡} ¡Summary
Pros
the OpenStack infrastructure resource types
Cons
OpenStack
focused
production aspects (monitoring, log aggregation, healing, scaling)
Poten)al ¡Synergies ¡
Kubernetes ¡+ ¡Docker, ¡ Heat ¡
Docker ¡+ ¡? ¡
Heat ¡ ¡ ¡ ¡
Which ¡orchestra)on ¡tool ¡should ¡I ¡ choose? ¡
The ¡Only ¡Constant ¡Is ¡Change! ¡
More ¡Change ¡Ahead.. ¡