-
Notifications
You must be signed in to change notification settings - Fork 9
/
etcd-cluster.yaml
107 lines (107 loc) · 2.73 KB
/
etcd-cluster.yaml
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
SenzaComponents:
- Configuration:
Type: Senza::StupsAutoConfiguration
- AppServer:
IamRoles:
- Ref: EtcdRole
InstanceType: t2.small
SecurityGroups:
- Fn::GetAtt:
- EtcdSecurityGroup
- GroupId
TaupageConfig:
ports:
2379: 2379
2380: 2380
runtime: Docker
source: '{{Arguments.DockerImage}}'
environment:
HOSTED_ZONE: '{{Arguments.HostedZone}}'
mounts:
/home/etcd:
partition: none
filesystem: tmpfs
erase_on_boot: false
options: size=1024m
scalyr_region: '{{Arguments.ScalyrRegion}}'
scalyr_account_key: '{{Arguments.ScalyrAccountKey}}'
Type: Senza::TaupageAutoScalingGroup
AutoScaling:
Minimum: 5
Maximum: 5
MetricType: CPU
SenzaInfo:
Parameters:
- HostedZone:
Description: AWS Hosted Zone to work with
- DockerImage:
Description: Docker image of etcd-cluster.
- ScalyrAccountKey:
Description: Key for writing logs to scalyr
Default: ''
- ScalyrRegion:
Description: Scalyr region
Default: 'eu'
StackName: etcd-cluster
Resources:
EtcdSecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: Etcd Appliance Security Group
SecurityGroupIngress:
- IpProtocol: tcp
FromPort: 22
ToPort: 22
CidrIp: 0.0.0.0/0
- IpProtocol: tcp
FromPort: 2379
ToPort: 2380
CidrIp: 0.0.0.0/0
EtcdIngressMembers:
Type: "AWS::EC2::SecurityGroupIngress"
Properties:
GroupId:
Fn::GetAtt:
- EtcdSecurityGroup
- GroupId
IpProtocol: tcp
FromPort: 0
ToPort: 65535
SourceSecurityGroupId:
Fn::GetAtt:
- EtcdSecurityGroup
- GroupId
EtcdRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Principal:
Service: ec2.amazonaws.com
Action: sts:AssumeRole
Path: /
Policies:
- PolicyName: AmazonEC2ReadOnlyAccess
PolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Action: ec2:Describe*
Resource: "*"
- Effect: Allow
Action: autoscaling:Describe*
Resource: "*"
- PolicyName: AmazonRoute53Access
PolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Action:
- route53:ListHostedZonesByName
- route53:ChangeResourceRecordSets
- route53:GetHostedZone
- route53:ListResourceRecordSets
- route53:GetChange
Resource: [ "*" ]