This repository has been archived by the owner on Dec 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 372
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
1,353 additions
and
59 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
229 changes: 229 additions & 0 deletions
229
playbooks/provisioning/aws/cloudformation/files/nested/control-plane/default.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,229 @@ | ||
AWSTemplateFormatVersion: '2010-09-09' | ||
Description: OpenShift Integrated Control Plane | ||
Parameters: | ||
MasterSGs: | ||
Type: 'List<AWS::EC2::SecurityGroup::Id>' | ||
MasterExtElbSGs: | ||
Type: 'List<AWS::EC2::SecurityGroup::Id>' | ||
MasterIntElbSGs: | ||
Type: 'List<AWS::EC2::SecurityGroup::Id>' | ||
MasterInstanceType: | ||
Type: String | ||
Default: t2.medium | ||
MasterImageId: | ||
Type: 'AWS::EC2::Image::Id' | ||
Default: ami-10251c7a | ||
MasterInstanceProfile: | ||
Type: String | ||
KeyName: | ||
Type: 'AWS::EC2::KeyPair::KeyName' | ||
Master01Subnet: | ||
Type: 'AWS::EC2::Subnet::Id' | ||
Master02Subnet: | ||
Type: 'AWS::EC2::Subnet::Id' | ||
Master03Subnet: | ||
Type: 'AWS::EC2::Subnet::Id' | ||
MasterApiPort: | ||
Type: Number | ||
Default: 443 | ||
MasterRootVolSize: | ||
Type: String | ||
Default: 10 | ||
MasterDockerVolSize: | ||
Type: String | ||
Default: 25 | ||
MasterEtcdVolSize: | ||
Type: String | ||
Default: 25 | ||
MasterUserData: | ||
Type: String | ||
|
||
Conditions: | ||
SetMasterInstanceProfile: | ||
'Fn::Not': | ||
- 'Fn::Equals': | ||
- '' | ||
- Ref: MasterInstanceProfile | ||
|
||
Resources: | ||
Master01: | ||
Type: 'AWS::EC2::Instance' | ||
Properties: | ||
ImageId: | ||
Ref: MasterImageId | ||
KeyName: | ||
Ref: KeyName | ||
InstanceType: | ||
Ref: MasterInstanceType | ||
SecurityGroupIds: | ||
Ref: MasterSGs | ||
SubnetId: | ||
Ref: Master01Subnet | ||
IamInstanceProfile: | ||
Ref: MasterInstanceProfile | ||
BlockDeviceMappings: | ||
- DeviceName: /dev/sda1 | ||
Ebs: | ||
DeleteOnTermination: True | ||
VolumeSize: | ||
Ref: MasterRootVolSize | ||
VolumeType: gp2 | ||
- DeviceName: /dev/xvdb | ||
Ebs: | ||
DeleteOnTermination: True | ||
VolumeSize: | ||
Ref: MasterDockerVolSize | ||
VolumeType: gp2 | ||
- DeviceName: /dev/xvdc | ||
Ebs: | ||
DeleteOnTermination: True | ||
VolumeSize: | ||
Ref: MasterEtcdVolSize | ||
VolumeType: gp2 | ||
UserData: | ||
Ref: MasterUserData | ||
Master02: | ||
Type: 'AWS::EC2::Instance' | ||
Properties: | ||
ImageId: | ||
Ref: MasterImageId | ||
KeyName: | ||
Ref: KeyName | ||
InstanceType: | ||
Ref: MasterInstanceType | ||
SecurityGroupIds: | ||
Ref: MasterSGs | ||
SubnetId: | ||
Ref: Master02Subnet | ||
IamInstanceProfile: | ||
Ref: MasterInstanceProfile | ||
BlockDeviceMappings: | ||
- DeviceName: /dev/sda1 | ||
Ebs: | ||
DeleteOnTermination: True | ||
VolumeSize: | ||
Ref: MasterRootVolSize | ||
VolumeType: gp2 | ||
- DeviceName: /dev/xvdb | ||
Ebs: | ||
DeleteOnTermination: True | ||
VolumeSize: | ||
Ref: MasterDockerVolSize | ||
VolumeType: gp2 | ||
- DeviceName: /dev/xvdc | ||
Ebs: | ||
DeleteOnTermination: True | ||
VolumeSize: | ||
Ref: MasterEtcdVolSize | ||
VolumeType: gp2 | ||
UserData: | ||
Ref: MasterUserData | ||
Master03: | ||
Type: 'AWS::EC2::Instance' | ||
Properties: | ||
ImageId: | ||
Ref: MasterImageId | ||
KeyName: | ||
Ref: KeyName | ||
InstanceType: | ||
Ref: MasterInstanceType | ||
SecurityGroupIds: | ||
Ref: MasterSGs | ||
SubnetId: | ||
Ref: Master03Subnet | ||
IamInstanceProfile: | ||
Ref: MasterInstanceProfile | ||
BlockDeviceMappings: | ||
- DeviceName: /dev/sda1 | ||
Ebs: | ||
DeleteOnTermination: True | ||
VolumeSize: | ||
Ref: MasterRootVolSize | ||
VolumeType: gp2 | ||
- DeviceName: /dev/xvdb | ||
Ebs: | ||
DeleteOnTermination: True | ||
VolumeSize: | ||
Ref: MasterDockerVolSize | ||
VolumeType: gp2 | ||
- DeviceName: /dev/xvdc | ||
Ebs: | ||
DeleteOnTermination: True | ||
VolumeSize: | ||
Ref: MasterEtcdVolSize | ||
VolumeType: gp2 | ||
UserData: | ||
Ref: MasterUserData | ||
MasterIntElb: | ||
Type: 'AWS::ElasticLoadBalancing::LoadBalancer' | ||
Properties: | ||
CrossZone: True | ||
ConnectionSettings: | ||
IdleTimeout: 3600 | ||
Listeners: | ||
- InstancePort: | ||
Ref: MasterApiPort | ||
InstanceProtocol: TCP | ||
LoadBalancerPort: | ||
Ref: MasterApiPort | ||
Protocol: TCP | ||
Scheme: internal | ||
SecurityGroups: | ||
Ref: MasterIntElbSGs | ||
Subnets: | ||
- Ref: Master01Subnet | ||
- Ref: Master02Subnet | ||
- Ref: Master03Subnet | ||
Instances: | ||
- Ref: Master01 | ||
- Ref: Master02 | ||
- Ref: Master03 | ||
HealthCheck: | ||
HealthyThreshold: 2 | ||
Interval: 5 | ||
Timeout: 2 | ||
UnhealthyThreshold: 2 | ||
Target: | ||
'Fn::Join': | ||
- '' | ||
- - 'Fn::Join': | ||
- ':' | ||
- - 'HTTPS' | ||
- Ref: MasterApiPort | ||
- /healthz/ready | ||
MasterExtElb: | ||
Type: 'AWS::ElasticLoadBalancing::LoadBalancer' | ||
Properties: | ||
CrossZone: True | ||
ConnectionSettings: | ||
IdleTimeout: 3600 | ||
Listeners: | ||
- InstancePort: | ||
Ref: MasterApiPort | ||
InstanceProtocol: TCP | ||
LoadBalancerPort: | ||
Ref: MasterApiPort | ||
Protocol: TCP | ||
SecurityGroups: | ||
Ref: MasterExtElbSGs | ||
Subnets: | ||
- Ref: Master01Subnet | ||
- Ref: Master02Subnet | ||
- Ref: Master03Subnet | ||
Instances: | ||
- Ref: Master01 | ||
- Ref: Master02 | ||
- Ref: Master03 | ||
HealthCheck: | ||
HealthyThreshold: 2 | ||
Interval: 5 | ||
Timeout: 2 | ||
UnhealthyThreshold: 2 | ||
Target: | ||
'Fn::Join': | ||
- '' | ||
- - 'Fn::Join': | ||
- ':' | ||
- - 'HTTPS' | ||
- Ref: MasterApiPort | ||
- /healthz/ready |
65 changes: 65 additions & 0 deletions
65
playbooks/provisioning/aws/cloudformation/files/nested/iam-profiles/default.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
AWSTemplateFormatVersion: '2010-09-09' | ||
Description: OpenShift IAM Profiles | ||
Outputs: | ||
MasterInstanceProfile: | ||
Description: Master Instance Profile | ||
Value: | ||
Ref: MasterInstanceProfile | ||
NodeInstanceProfile: | ||
Description: Node Instance Profile | ||
Value: | ||
Ref: NodeInstanceProfile | ||
Resources: | ||
MasterPolicy: | ||
Type: 'AWS::IAM::Role' | ||
Properties: | ||
AssumeRolePolicyDocument: | ||
Version: '2012-10-17' | ||
Statement: | ||
- Effect: Allow | ||
Principal: | ||
Service: | ||
- ec2.amazonaws.com | ||
Action: | ||
- 'sts:AssumeRole' | ||
Policies: | ||
- PolicyName: openshift-master | ||
PolicyDocument: | ||
Version: '2012-10-17' | ||
Statement: | ||
- Effect: Allow | ||
Action: 'ec2:*' | ||
Resource: '*' | ||
- Effect: Allow | ||
Action: 'elasticloadbalancing:*' | ||
Resource: '*' | ||
NodePolicy: | ||
Type: 'AWS::IAM::Role' | ||
Properties: | ||
AssumeRolePolicyDocument: | ||
Version: '2012-10-17' | ||
Statement: | ||
- Effect: Allow | ||
Principal: | ||
Service: | ||
- ec2.amazonaws.com | ||
Action: | ||
- 'sts:AssumeRole' | ||
Policies: | ||
- PolicyName: openshift-node | ||
PolicyDocument: | ||
Version: '2012-10-17' | ||
Statement: | ||
- Effect: Allow | ||
Action: 'ec2:Describe*' | ||
Resource: '*' | ||
MasterInstanceProfile: | ||
Type: 'AWS::IAM::InstanceProfile' | ||
Properties: | ||
Roles: | ||
- Ref: MasterPolicy | ||
NodeInstanceProfile: | ||
Type: 'AWS::IAM::InstanceProfile' | ||
Properties: | ||
Roles: | ||
- Ref: NodePolicy |
25 changes: 25 additions & 0 deletions
25
playbooks/provisioning/aws/cloudformation/files/nested/master-user-data.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#cloud-config | ||
cloud_config_modules: | ||
- disk_setup | ||
- mounts | ||
|
||
fs_setup: | ||
- label: etcd_storage | ||
filesystem: xfs | ||
device: /dev/xdc | ||
partition: auto | ||
|
||
runcmd: | ||
- mkdir -p /var/lib/etcd | ||
|
||
mounts: | ||
- [ /dev/xvdc, /var/lib/etcd, xfs, 'defaults' ] | ||
|
||
write_files: | ||
- content: | | ||
DEVS='/dev/xvdb' | ||
VG=docker_vol | ||
DATA_SIZE=95%VG | ||
EXTRA_DOCKER_STORAGE_OPTIONS="--storage-opt dm.basesize=3G" | ||
path: /etc/sysconfig/docker-storage-setup | ||
owner: root:root |
Oops, something went wrong.