Advertisement
Guest User

Untitled

a guest
Sep 20th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.80 KB | None | 0 0
  1. tosca_definitions_version: tosca_simple_yaml_1_0
  2.  
  3. imports:
  4. - indigo_custom_types: https://raw.githubusercontent.com/indigo-dc/tosca-types/dodas_roll/custom_types.yaml
  5.  
  6. description: TOSCA template for a complete CMS Site over Mesos orchestrator
  7.  
  8. topology_template:
  9.  
  10. inputs:
  11.  
  12. marathon_username:
  13. type: string
  14. default: "Marathon-user"
  15.  
  16. marathon_password:
  17. type: string
  18. default: "Marathon-passwd"
  19.  
  20. mesos_username:
  21. type: string
  22. default: "Mesos-user"
  23.  
  24. mesos_password:
  25. type: string
  26. default: "Mesos-passwd"
  27.  
  28. number_of_masters:
  29. type: integer
  30. default: 1
  31.  
  32. num_cpus_master:
  33. type: integer
  34. default: 2
  35.  
  36. mem_size_master:
  37. type: string
  38. default: "2 GB"
  39.  
  40. number_of_slaves:
  41. type: integer
  42. default: 1
  43.  
  44. num_cpus_slave:
  45. type: integer
  46. default: 2
  47.  
  48. mem_size_slave:
  49. type: string
  50. default: "2 GB"
  51.  
  52. number_of_lbs:
  53. type: integer
  54. default: 1
  55.  
  56. num_cpus_lb:
  57. type: integer
  58. default: 2
  59.  
  60. mem_size_lb:
  61. type: string
  62. default: "2 GB"
  63.  
  64. server_image:
  65. type: string
  66. #default: "ost://horizon.cloud.cnaf.infn.it/0b18691b-2c67-4800-876e-60802024c64f"
  67. default: "ost://cloud.recas.ba.infn.it/1113d7e8-fc5d-43b9-8d26-61906d89d479"
  68.  
  69.  
  70. node_templates:
  71.  
  72. mesos_master:
  73. type: tosca.nodes.indigo.MesosMaster
  74. properties:
  75. mesos_username: { get_input: mesos_username }
  76. mesos_password: { get_input: mesos_password }
  77. marathon_username: { get_input: marathon_username }
  78. marathon_password: { get_input: marathon_password }
  79. mesos_masters_list: { get_attribute: [ mesos-master-server, private_address ] }
  80. requirements:
  81. - host: mesos-master-server
  82.  
  83. mesos_slave:
  84. type: tosca.nodes.indigo.MesosSlave
  85. properties:
  86. master_ips: { get_attribute: [ mesos-master-server, private_address ] }
  87. front_end_ip: { get_attribute: [ mesos-master-server, private_address, 0 ] }
  88. requirements:
  89. - host: mesos-slave-server
  90.  
  91. mesos_load_balancer:
  92. type: tosca.nodes.indigo.MesosLoadBalancer
  93. properties:
  94. master_ips: { get_attribute: [ mesos-master-server, private_address ] }
  95. marathon_username: { get_input: marathon_username }
  96. marathon_password: { get_input: marathon_password }
  97. requirements:
  98. - host: mesos-lb-server
  99. - dependency: mesos_master
  100.  
  101. mesos-master-server:
  102. type: tosca.nodes.indigo.Compute
  103. capabilities:
  104. endpoint:
  105. properties:
  106. network_name: PUBLIC
  107. dns_name: mesosserverpublic
  108. ports:
  109. mesos_port:
  110. protocol: tcp
  111. source: 5050
  112. marathon_port:
  113. protocol: tcp
  114. source: 8080
  115. scalable:
  116. properties:
  117. count: { get_input: number_of_masters }
  118. host:
  119. properties:
  120. num_cpus: { get_input: num_cpus_master }
  121. mem_size: { get_input: mem_size_master }
  122. os:
  123. properties:
  124. image: { get_input: server_image }
  125.  
  126. mesos-slave-server:
  127. type: tosca.nodes.indigo.Compute
  128. capabilities:
  129. scalable:
  130. properties:
  131. count: { get_input: number_of_slaves }
  132. host:
  133. properties:
  134. num_cpus: { get_input: num_cpus_slave }
  135. mem_size: { get_input: mem_size_slave }
  136. os:
  137. properties:
  138. image: { get_input: server_image }
  139.  
  140.  
  141. mesos-lb-server:
  142. type: tosca.nodes.indigo.Compute
  143. capabilities:
  144. endpoint:
  145. properties:
  146. network_name: PUBLIC
  147. dns_name: mesoslb
  148. ports:
  149. webserver_port:
  150. protocol: tcp
  151. source: 4880
  152. myapp_port:
  153. protocol: tcp
  154. source: 4882
  155. scalable:
  156. properties:
  157. count: { get_input: number_of_lbs }
  158. host:
  159. properties:
  160. num_cpus: { get_input: num_cpus_lb }
  161. mem_size: { get_input: mem_size_lb }
  162. os:
  163. properties:
  164. image: { get_input: server_image }
  165.  
  166. outputs:
  167. webserver_endpoint:
  168. value: { concat: [ 'http://', get_attribute: [ mesos-lb-server, public_address, 0 ], ':4880' ] }
  169. myapp_endpoint:
  170. value: { concat: [ 'http://', get_attribute: [ mesos-lb-server, public_address, 0 ], ':4882' ] }
  171. marathon_endpoint:
  172. value: { concat: [ 'http://', get_attribute: [ mesos-master-server, public_address, 0 ], ':8080' ] }
  173. cluster_credentials:
  174. value: { get_attribute: [ mesos-master-server, endpoint, credential, 0 ] }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement