forked from mbabineau/cloudformation-mesos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mesos.json
269 lines (255 loc) · 10.2 KB
/
mesos.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "Launches a Mesos cluster",
"Parameters" : {
"ClusterId" : {
"Description" : "Mesos cluster ID",
"Type" : "String",
"Default" : "mesos"
},
"KeyName" : {
"Description" : "Existing EC2 KeyPair to be associated with all cluster instances for SSH access. For default AMIs, log in as the 'ubuntu' user.",
"Type" : "String"
},
"Subnets" : {
"Description" : "List of VPC subnet IDs in which to launch the cluster. Must match the passed AvailabilityZones.",
"Type" : "String"
},
"VpcId" : {
"Description" : "VPC associated with the provided subnets",
"Type" : "String"
},
"AvailabilityZones": {
"Description" : "(Optional) If passed, only launch nodes in these AZs (e.g., 'us-east-1a,us-east-1b'). Must match the passed Subnets.",
"Type" : "String",
"Default" : ""
},
"AdminSecurityGroup" : {
"Description" : "Existing security group that should be granted administrative access to Mesos (e.g., 'sg-123456')",
"Type": "String"
},
"ZkClientSecurityGroup" : {
"Description" : "Existing security group that should be used by ZooKeeper clients to access ZooKeeper",
"Type" : "String"
},
"ExhibitorDiscoveryUrl" : {
"Description" : "Exhibitor URL that returns active ZooKeeper nodes ('getCluster') (e.g., http://<exhibitor_node>/exhibitor/v1/cluster/list)",
"Type" : "String"
},
"MasterInstanceAmi" : {
"Description" : "(optional) AMI to use for Mesos Masters",
"Type" : "String",
"Default" : ""
},
"MasterInstanceType" : {
"Description" : "EC2 instance type",
"Type" : "String",
"Default" : "t2.micro",
"AllowedValues" : [
"t2.micro", "t2.small", "t2.medium",
"m3.medium", "m3.large", "m3.xlarge", "m3.2xlarge",
"c4.large", "c4.xlarge", "c4.2xlarge", "c4.4xlarge", "c4.8xlarge",
"c3.large", "c3.xlarge", "c3.2xlarge", "c3.4xlarge", "c3.8xlarge",
"r3.large", "r3.xlarge", "r3.2xlarge", "r3.4xlarge", "r3.8xlarge",
"i2.xlarge", "i2.2xlarge", "i2.4xlarge", "i2.8xlarge",
"hs1.8xlarge", "g2.2xlarge"
],
"ConstraintDescription" : "must be a valid, HVM-compatible EC2 instance type."
},
"MasterInstanceCount" : {
"Description" : "Number of master nodes to launch",
"Type" : "Number",
"Default" : "1"
},
"MasterQuorumCount" : {
"Description" : "Number of masters needed for Mesos replicated log registry quorum (should be ceiling(<MasterInstanceCount>/2))",
"Type" : "Number",
"Default" : "1"
},
"MasterLogstashConfig" : {
"Description" : "(optional) Config string for Logstash on the Mesos Masters",
"Type" : "String",
"Default" : ""
},
"MasterConfigScriptS3Bucket" : {
"Description" : "(optional) S3 bucket of an executable to download and run after other boot-time provisioning (e.g., \"my-bucket\").",
"Type" : "String",
"Default" : ""
},
"MasterConfigScriptS3Path" : {
"Description" : "(optional) Path within ConfigScriptS3Bucket of an executable to download and run after other boot-time provisioning (e.g., \"/path/to/script\").",
"Type" : "String",
"Default" : ""
},
"SlaveInstanceAmi" : {
"Description" : "(optional) AMI to use for Mesos Slaves",
"Type" : "String",
"Default" : ""
},
"SlaveInstanceType" : {
"Description" : "EC2 instance type",
"Type" : "String",
"Default" : "t2.micro",
"AllowedValues" : [
"t2.micro", "t2.small", "t2.medium",
"m3.medium", "m3.large", "m3.xlarge", "m3.2xlarge",
"c3.large", "c3.xlarge", "c3.2xlarge", "c3.4xlarge", "c3.8xlarge",
"c4.large", "c4.xlarge", "c4.2xlarge", "c4.4xlarge", "c4.8xlarge",
"r3.large", "r3.xlarge", "r3.2xlarge", "r3.4xlarge", "r3.8xlarge",
"i2.xlarge", "i2.2xlarge", "i2.4xlarge", "i2.8xlarge",
"hs1.8xlarge", "g2.2xlarge"
],
"ConstraintDescription" : "must be a valid, HVM-compatible EC2 instance type."
},
"SlaveInstanceCount" : {
"Description" : "Number of slave nodes to launch",
"Type" : "Number",
"Default" : "1"
},
"SlaveLogstashConfig" : {
"Description" : "(optional) Config string for Logstash on the Mesos Slaves (to read task logs, you can use 'input { file { path => \"/tmp/mesos/slaves/*/frameworks/*/executors/*/runs/latest/stdout\" }')",
"Type" : "String",
"Default" : ""
},
"SlaveConfigScriptS3Bucket" : {
"Description" : "(optional) S3 bucket of an executable to download and run after other boot-time provisioning (e.g., \"my-bucket\").",
"Type" : "String",
"Default" : ""
},
"SlaveConfigScriptS3Path" : {
"Description" : "(optional) Path within ConfigScriptS3Bucket of an executable to download and run after other boot-time provisioning (e.g., \"/path/to/script\").",
"Type" : "String",
"Default" : ""
},
"SlaveResources" : {
"Description" : "(optional) Resources to allocate to Mesos (as passed to --resources). To expose ports 8000-9000, for instance, you can use 'ports(*):[8000-9000, 31000-32000]'",
"Type" : "String",
"Default" : ""
},
"DockerCredentials" : {
"Description" : "JSON string to be saved as .dockercfg",
"Type" : "String",
"Default" : "{}"
},
"MarathonDockerImage" : {
"Description" : "The Marathon Docker image (format: 'registry:port/repository:version')",
"Type" : "String",
"Default" : "mesosphere/marathon:latest"
},
"MarathonLoggerDockerImage" : {
"Description" : "The marathon-logger Docker image (format: 'registry:port/repository:version')",
"Type" : "String",
"Default" : "thefactory/marathon-logger:latest"
},
"MarathonLoggerEventStore" : {
"Description" : "The marathon-logger event store connection string",
"Type" : "String",
"Default" : "in-memory://localhost/?max_length=100"
},
"MesosMasterTemplateUrl" : {
"Description" : "URL of the Mesos Master CloudFormation template on S3 (must be \"https://s3.amazonaws.com/<bucket>/<key>\")",
"Type" : "String"
},
"MesosSlaveTemplateUrl" : {
"Description" : "URL of the Mesos Slave CloudFormation template on S3 (must be \"https://s3.amazonaws.com/<bucket>/<key>\")",
"Type" : "String"
}
},
"Conditions" : {
"UseCustomMasterAmi" : { "Fn::Not" : [{ "Fn::Equals" : [{ "Ref" : "MasterInstanceAmi" }, ""] }] },
"UseCustomSlaveAmi" : { "Fn::Not" : [{ "Fn::Equals" : [{ "Ref" : "SlaveInstanceAmi" }, ""] }] }
},
"Mappings" : {
"RegionMap" : {
"us-east-1" : {
"AMI" : "ami-1c517276"
},
"us-west-1" : {
"AMI" : "ami-494eac0d"
},
"us-west-2" : {
"AMI" : "ami-734a7f43"
},
"eu-west-1" : {
"AMI" : "ami-99fc9cee"
},
"ap-southeast-1" : {
"AMI" : "ami-50467b02"
},
"ap-southeast-2" : {
"AMI" : "ami-79542943"
},
"ap-northeast-1" : {
"AMI" : "ami-f26ca9f2"
},
"sa-east-1" : {
"AMI" : "ami-3944c124"
}
}
},
"Resources" : {
"MesosMasterStack" : {
"Type" : "AWS::CloudFormation::Stack",
"Properties" : {
"TemplateURL" : { "Ref" : "MesosMasterTemplateUrl" },
"TimeoutInMinutes" : "15",
"Parameters" : {
"InstanceAmi" : { "Fn::If" : [
"UseCustomMasterAmi",
{ "Ref" : "MasterInstanceAmi" },
{ "Fn::FindInMap" : [ "RegionMap", { "Ref" : "AWS::Region" }, "AMI"] }
]},
"InstanceType" : { "Ref" : "MasterInstanceType" },
"KeyName" : { "Ref" : "KeyName" },
"ClusterId" : { "Ref" : "ClusterId" },
"ClusterSize" : { "Ref" : "MasterInstanceCount" },
"QuorumSize" : { "Ref" : "MasterQuorumCount" },
"DockerCredentials" : { "Ref" : "DockerCredentials" },
"LogstashConfig" : { "Ref" : "MasterLogstashConfig" },
"ConfigScriptS3Bucket" : { "Ref" : "MasterConfigScriptS3Bucket" },
"ConfigScriptS3Path" : { "Ref" : "MasterConfigScriptS3Path" },
"MarathonDockerImage" : { "Ref" : "MarathonDockerImage" },
"MarathonLoggerDockerImage" : { "Ref" : "MarathonLoggerDockerImage" },
"MarathonLoggerEventStore" : { "Ref" : "MarathonLoggerEventStore" },
"ExhibitorDiscoveryUrl" : { "Ref" : "ExhibitorDiscoveryUrl" },
"ZkClientSecurityGroup" : { "Ref" : "ZkClientSecurityGroup" },
"AdminSecurityGroup" : { "Ref" : "AdminSecurityGroup" },
"Subnets" : { "Ref" : "Subnets" },
"VpcId" : { "Ref" : "VpcId" },
"AvailabilityZones" : { "Ref" : "AvailabilityZones" }
}
}
},
"MesosSlaveStack" : {
"Type" : "AWS::CloudFormation::Stack",
"DependsOn" : "MesosMasterStack",
"Properties" : {
"TemplateURL" : { "Ref" : "MesosSlaveTemplateUrl" },
"TimeoutInMinutes" : "15",
"Parameters" : {
"InstanceAmi" : { "Fn::If" : [
"UseCustomSlaveAmi",
{ "Ref" : "SlaveInstanceAmi" },
{ "Fn::FindInMap" : [ "RegionMap", { "Ref" : "AWS::Region" }, "AMI"] }
]},
"InstanceType" : { "Ref" : "SlaveInstanceType" },
"KeyName" : { "Ref" : "KeyName" },
"ClusterId" : { "Ref" : "ClusterId" },
"ClusterSize" : { "Ref" : "SlaveInstanceCount" },
"DockerCredentials" : { "Ref" : "DockerCredentials" },
"LogstashConfig" : { "Ref" : "SlaveLogstashConfig" },
"ConfigScriptS3Bucket" : { "Ref" : "SlaveConfigScriptS3Bucket" },
"ConfigScriptS3Path" : { "Ref" : "SlaveConfigScriptS3Path" },
"MesosResources" : { "Ref" : "SlaveResources" },
"ExhibitorDiscoveryUrl" : { "Ref" : "ExhibitorDiscoveryUrl" },
"ZkClientSecurityGroup" : { "Ref" : "ZkClientSecurityGroup" },
"MesosMasterSecurityGroup" : { "Fn::GetAtt" : [ "MesosMasterStack", "Outputs.MesosMasterSecurityGroup" ] },
"AdminSecurityGroup" : { "Ref" : "AdminSecurityGroup" },
"Subnets" : { "Ref" : "Subnets" },
"VpcId" : { "Ref" : "VpcId" },
"AvailabilityZones" : { "Ref" : "AvailabilityZones" }
}
}
}
}
}