cluster.yaml 4.43 KB
Newer Older
Balazs's avatar
Balazs committed
1 2 3
heat_template_version: 2014-10-16

parameters:
4
  master_image:
Balazs's avatar
Balazs committed
5
    type: string
6 7 8 9 10 11 12
    description: Which image should be the master's os setup with?
    default: "$master_image$"

  slave_image:
    type: string
    description: Which image should be the slave's os setup with?
    default: "$slave_image$"
Balazs's avatar
Balazs committed
13 14 15 16

  master_flavor:
    type: string
    description: Flavor of the master's instance
17
    default: $master_flavor$
Balazs's avatar
Balazs committed
18 19 20 21

  slave_flavor:
    type: string
    description: Flavor of the master's instance
22
    default: $slave_flavor$
Balazs's avatar
Balazs committed
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64

  master_name:
    type: string
    description: master's name
    default: $masternode$

  slave_name:
    type: string
    description: slave's name (the index will be appended at the end)
    default: $slavenode$

  master_ssh_key:
    type: string
    description: name of public key of openstack user for master node
    default: "$ssh_key$"

  cluster_subnet_cidr:
    type: string
    description: CIDR of subnet that cluster is going to use
    default: "$subnet_cidr$"

  subnet_gateway_ip:
    type: string
    description: subnet's gateway's IP
    default: "$subnet_gw_ip$"

  allocation_pool_start:
    type: string
    description: allocation pool's starting IP address
    default: "$subnet_allocation_pool_start$"

  allocation_pool_end:
    type: string
    description: allocation pool's last IP address
    default: "$subnet_allocation_pool_end$"

  subnet_dns_nameservers:
    type: comma_delimited_list
    description: nameservers for the used subnet
    default: $subnet_dns_servers$

resources:
65 66 67 68 69
  sshpublickey:
    properties:
      name: ssh_cluster_pub_key
      public_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDkbCR95uSaiAmspMoSPTKGSk3+5Vd6paKmdZQmdbHJd0a9HKLN87mYgc8qOURvxkjCEKMNYws2d2IQO0e7WELSfmMuQn/tUrLAiFTBfGsNxbarRO+UMvDvQwqQgRZ94wrjF/ELz4rQTe87MTuxpR79rbiGxHrHmJFxGAgS2evczwfmCKyyS15brWsNXaxDLyiBN3mWWz/O+4b3IEN/FKHYQcgy+SytGfHQBFkuOI5ETrRgeBy4ohGZzrn44TYjK4L2tLJJPT0rUffl81huVWoqcgwmkHETszDZm7OYkeLvX9g02JzeiKrqAFEvaWxjyreDkLEqKNF9oxi3SfdX72Yr mesz@CLT-MOB-T-6253-2
    type: OS::Nova::KeyPair
Balazs's avatar
Balazs committed
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87

  hadoop_sec_group:
    type: OS::Neutron::SecurityGroup
    properties:
      name: hadoop_security_group
      rules: [
      {"direction":"ingress","protocol":"tcp","port_range_min":"22","port_range_max":"22"},
      {"direction":"ingress","protocol":"tcp","port_range_min":"8025","port_range_max":"8088"},
      {"direction":"ingress","protocol":"tcp","port_range_min":"34342","port_range_max":"34342"},
      {"direction":"ingress","protocol":"tcp","port_range_min":"50010","port_range_max":"50105"},
      {"direction":"ingress","protocol":"tcp","port_range_min":"54310","port_range_max":"54310"}
      ]

  hadoop_network:
    type: OS::Neutron::Net
    properties:
      name: "hadoopNet"

88 89 90 91 92 93 94 95 96 97
  hadoop_subnet:
    type: OS::Neutron::Subnet
    properties:
      network: { get_resource: hadoop_network }
      cidr: { get_param: cluster_subnet_cidr }
      gateway_ip: { get_param: subnet_gateway_ip }
      dns_nameservers: { get_param: subnet_dns_nameservers }
      allocation_pools:
        - start: { get_param: allocation_pool_start }
          end: { get_param: allocation_pool_end }
Balazs's avatar
Balazs committed
98 99 100 101 102 103 104 105 106 107 108 109 110

  hadoop_port:
    type: OS::Neutron::Port
    properties:
      network: { get_resource: hadoop_network }
      fixed_ips:
        - subnet_id: { get_resource: hadoop_subnet }
      security_groups: [{ get_resource: hadoop_sec_group }]

  hadoop_master:
    type: OS::Nova::Server
    properties:
      name: { get_param: master_name }
111
      image: { get_param: master_image }
Balazs's avatar
Balazs committed
112
      flavor: { get_param: master_flavor }
113
      key_name: { get_resource: sshpublickey }
Balazs's avatar
Balazs committed
114 115 116 117 118 119 120 121 122 123 124 125 126 127
      networks:
        - port: { get_resource: hadoop_port }
      user_data:
        str_replace:
          template: |
$master_bash.sh$
          params:
$paramsslave$

$slaves$

  hadoop_ip:
    type: OS::Neutron::FloatingIP
    properties:
128
      floating_network: "external-net"
Balazs's avatar
Balazs committed
129 130 131 132 133

  hadoop_router:
    type: OS::Neutron::Router
    properties:
      external_gateway_info:
134
        network: "external-net"
Balazs's avatar
Balazs committed
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151

  router_interface:
    type: OS::Neutron::RouterInterface
    properties:
      router_id: { get_resource: hadoop_router }
      subnet_id: { get_resource: hadoop_subnet }

  floating_ip_assoc:
    type: OS::Neutron::FloatingIPAssociation
    properties:
      floatingip_id: { get_resource: hadoop_ip }
      port_id: { get_resource: hadoop_port }

outputs:
  external_ip:
    description: The IP address of the deployed master node
    value: { get_attr: [ hadoop_ip, floating_ip_address ] }