Merge "Adds Support for OpenShift Origin v3.0 on Fedora 19"
This commit is contained in:
commit
fce7851c39
|
@ -1,60 +0,0 @@
|
||||||
<template>
|
|
||||||
<name>F18-x86_64-openshift-origin-broker-cfntools</name>
|
|
||||||
<os>
|
|
||||||
<name>Fedora</name>
|
|
||||||
<version>18</version>
|
|
||||||
<arch>x86_64</arch>
|
|
||||||
<install type='iso'>
|
|
||||||
<iso>file:/var/lib/libvirt/images/Fedora-18-x86_64-netinst.iso</iso>
|
|
||||||
</install>
|
|
||||||
</os>
|
|
||||||
<description>OpenShift Origin Broker</description>
|
|
||||||
<files>
|
|
||||||
<file name='/etc/yum.repos.d/puppetlabs-products.repo'>
|
|
||||||
[puppetlabs-products]
|
|
||||||
name=Puppet Labs Products Fedora 17 - $basearch
|
|
||||||
baseurl=http://yum.puppetlabs.com/fedora/f17/products/$basearch
|
|
||||||
gpgkey=http://yum.puppetlabs.com/RPM-GPG-KEY-puppetlabs
|
|
||||||
enabled=0
|
|
||||||
gpgcheck=1
|
|
||||||
</file>
|
|
||||||
<file name='/etc/yum.repos.d/openshift-origin.repo'>
|
|
||||||
[openshift-origin]
|
|
||||||
name=openshift-origin
|
|
||||||
baseurl="https://mirror.openshift.com/pub/openshift-origin/nightly/fedora-18/latest/x86_64/"
|
|
||||||
enabled=1
|
|
||||||
gpgcheck=0
|
|
||||||
</file>
|
|
||||||
<file name='/etc/yum.repos.d/openshift-origin-deps.repo'>
|
|
||||||
[openshift-origin]
|
|
||||||
name=openshift-origin-deps
|
|
||||||
baseurl="https://mirror.openshift.com/pub/openshift-origin/fedora-18/x86_64/"
|
|
||||||
enabled=1
|
|
||||||
gpgcheck=0
|
|
||||||
</file>
|
|
||||||
</files>
|
|
||||||
<commands>
|
|
||||||
<command name='lockroot'>
|
|
||||||
passwd -l root
|
|
||||||
</command>
|
|
||||||
<command name='user'>
|
|
||||||
/usr/sbin/useradd ec2-user
|
|
||||||
echo -e 'ec2-user\tALL=(ALL)\tNOPASSWD: ALL' >> /etc/sudoers
|
|
||||||
</command>
|
|
||||||
<command name='packages'>
|
|
||||||
yum -y update fedora-release;
|
|
||||||
yum -y install yum-plugin-fastestmirror cloud-init python-psutil python-pip;
|
|
||||||
yum install -y --enablerepo puppetlabs-products facter;
|
|
||||||
yum install -y openshift-origin-broker rubygem-openshift-origin-msg-broker-mcollective rubygem-openshift-origin-dns-nsupdate;
|
|
||||||
yum install -y rubygem-openshift-origin-dns-bind rubygem-openshift-origin-controller openshift-origin-broker-util;
|
|
||||||
yum install -y rubygem-passenger mod_passenger openssh rubygem-openshift-origin-auth-mongo rubygem-openshift-origin-remote-user ;
|
|
||||||
yum install -y rubygem-openshift-origin-console openshift-origin-console mongodb mongodb-server bind bind-utils ntpdate ;
|
|
||||||
yum install -y policycoreutils mcollective httpd openssh-server rhc activemq activemq-client git puppet ruby ruby-devel ;
|
|
||||||
yum install -y ruby-irb ruby-libs tar bind yum-plugin-priorities mysql-devel mongodb-devel;
|
|
||||||
yum -y update;
|
|
||||||
sed --in-place -e s/Type=oneshot/"Type=oneshot\nTimeoutSec=0"/ /lib/systemd/system/cloud-final.service;
|
|
||||||
pip-python install heat-cfntools;
|
|
||||||
cfn-create-aws-symlinks --source /usr/bin;
|
|
||||||
</command>
|
|
||||||
</commands>
|
|
||||||
</template>
|
|
|
@ -1,67 +0,0 @@
|
||||||
<template>
|
|
||||||
<name>F18-x86_64-openshift-origin-node-cfntools</name>
|
|
||||||
<os>
|
|
||||||
<name>Fedora</name>
|
|
||||||
<version>18</version>
|
|
||||||
<arch>x86_64</arch>
|
|
||||||
<install type='iso'>
|
|
||||||
<iso>file:/var/lib/libvirt/images/Fedora-18-x86_64-netinst.iso</iso>
|
|
||||||
</install>
|
|
||||||
</os>
|
|
||||||
<description>OpenShift Origin Node</description>
|
|
||||||
<files>
|
|
||||||
<file name='/etc/yum.repos.d/puppetlabs-products.repo'>
|
|
||||||
[puppetlabs-products]
|
|
||||||
name=Puppet Labs Products Fedora 17 - $basearch
|
|
||||||
baseurl=http://yum.puppetlabs.com/fedora/f17/products/$basearch
|
|
||||||
gpgkey=http://yum.puppetlabs.com/RPM-GPG-KEY-puppetlabs
|
|
||||||
enabled=0
|
|
||||||
gpgcheck=1
|
|
||||||
</file>
|
|
||||||
<file name='/etc/yum.repos.d/openshift-origin.repo'>
|
|
||||||
[openshift-origin]
|
|
||||||
name=openshift-origin
|
|
||||||
baseurl="https://mirror.openshift.com/pub/openshift-origin/nightly/fedora-18/latest/x86_64/"
|
|
||||||
enabled=1
|
|
||||||
gpgcheck=0
|
|
||||||
</file>
|
|
||||||
<file name='/etc/yum.repos.d/openshift-origin-deps.repo'>
|
|
||||||
[openshift-origin-deps]
|
|
||||||
name=openshift-origin-deps
|
|
||||||
baseurl="https://mirror.openshift.com/pub/openshift-origin/fedora-18/x86_64/"
|
|
||||||
enabled=1
|
|
||||||
gpgcheck=0
|
|
||||||
</file>
|
|
||||||
</files>
|
|
||||||
<commands>
|
|
||||||
<command name='lockroot'>
|
|
||||||
passwd -l root
|
|
||||||
</command>
|
|
||||||
<command name='user'>
|
|
||||||
/usr/sbin/useradd ec2-user
|
|
||||||
echo -e 'ec2-user\tALL=(ALL)\tNOPASSWD: ALL' >> /etc/sudoers
|
|
||||||
</command>
|
|
||||||
<command name='packages'>
|
|
||||||
yum -y update fedora-release;
|
|
||||||
yum -y install yum-plugin-fastestmirror cloud-init python-psutil python-pip;
|
|
||||||
yum -y update;
|
|
||||||
yum install -y --enablerepo puppetlabs-products facter;
|
|
||||||
yum install -y policycoreutils mcollective httpd openssh-server rhc ntpdate rubygem-openshift-origin-node;
|
|
||||||
yum install -y openshift-origin-node-util pam_openshift openshift-origin-node-proxy openshift-origin-port-proxy;
|
|
||||||
yum install -y openshift-origin-msg-node-mcollective git make cronie openshift-origin-cartridge-abstract;
|
|
||||||
yum install -y openshift-origin-cartridge-10gen-mms-agent-0.1 openshift-origin-cartridge-cron-1.4;
|
|
||||||
yum install -y openshift-origin-cartridge-diy-0.1 openshift-origin-cartridge-haproxy-1.4;
|
|
||||||
yum install -y openshift-origin-cartridge-mongodb-2.2 openshift-origin-cartridge-mysql-5.1;
|
|
||||||
yum install -y openshift-origin-cartridge-nodejs-0.6 openshift-origin-cartridge-jenkins-1.4;
|
|
||||||
yum install -y openshift-origin-cartridge-jenkins-client-1.4 openshift-origin-cartridge-community-python-2.7;
|
|
||||||
yum install -y openshift-origin-cartridge-community-python-3.3 openshift-origin-cartridge-postgresql-9.2;
|
|
||||||
yum install -y openshift-origin-cartridge-ruby-1.9 openshift-origin-cartridge-php-5.4;
|
|
||||||
yum install -y openshift-origin-cartridge-perl-5.16 openshift-origin-cartridge-phpmyadmin-3.5;
|
|
||||||
|
|
||||||
sed --in-place -e s/Type=oneshot/"Type=oneshot\nTimeoutSec=0"/ /lib/systemd/system/cloud-final.service;
|
|
||||||
pip-python install heat-cfntools;
|
|
||||||
cfn-create-aws-symlinks --source /usr/bin;
|
|
||||||
|
|
||||||
</command>
|
|
||||||
</commands>
|
|
||||||
</template>
|
|
|
@ -1,323 +0,0 @@
|
||||||
{
|
|
||||||
"AWSTemplateFormatVersion": "2010-09-09",
|
|
||||||
"Description": "Template for setting up an OpenShift Origin environment",
|
|
||||||
"Parameters": {
|
|
||||||
"KeyName": {
|
|
||||||
"Description": "Name of an existing EC2 KeyPair to enable SSH access to the instances",
|
|
||||||
"Type": "String",
|
|
||||||
"MinLength": "1",
|
|
||||||
"MaxLength": "64",
|
|
||||||
"AllowedPattern": "[-_ a-zA-Z0-9]*"
|
|
||||||
},
|
|
||||||
"Prefix": {
|
|
||||||
"Description": "Your DNS Prefix",
|
|
||||||
"Type": "String",
|
|
||||||
"Default": "example.com"
|
|
||||||
},
|
|
||||||
"UpstreamDNS": {
|
|
||||||
"Description": "Upstream DNS server",
|
|
||||||
"Type": "String",
|
|
||||||
"Default": "8.8.8.8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Mappings": {
|
|
||||||
"JeosImages": {
|
|
||||||
"Broker": {
|
|
||||||
"Image": "F18-x86_64-openshift-origin-broker-cfntools"
|
|
||||||
},
|
|
||||||
"Node": {
|
|
||||||
"Image": "F18-x86_64-openshift-origin-node-cfntools"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Resources": {
|
|
||||||
"OpenShiftOriginSecurityGroup": {
|
|
||||||
"Type": "AWS::EC2::SecurityGroup",
|
|
||||||
"Properties": {
|
|
||||||
"GroupDescription": "Standard firewall rules",
|
|
||||||
"SecurityGroupIngress": [
|
|
||||||
{
|
|
||||||
"IpProtocol": "udp",
|
|
||||||
"FromPort": "53",
|
|
||||||
"ToPort": "53",
|
|
||||||
"CidrIp": "0.0.0.0/0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"IpProtocol": "tcp",
|
|
||||||
"FromPort": "53",
|
|
||||||
"ToPort": "53",
|
|
||||||
"CidrIp": "0.0.0.0/0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"IpProtocol": "tcp",
|
|
||||||
"FromPort": "22",
|
|
||||||
"ToPort": "22",
|
|
||||||
"CidrIp": "0.0.0.0/0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"IpProtocol": "tcp",
|
|
||||||
"FromPort": "80",
|
|
||||||
"ToPort": "80",
|
|
||||||
"CidrIp": "0.0.0.0/0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"IpProtocol": "tcp",
|
|
||||||
"FromPort": "443",
|
|
||||||
"ToPort": "443",
|
|
||||||
"CidrIp": "0.0.0.0/0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"IpProtocol": "tcp",
|
|
||||||
"FromPort": "8000",
|
|
||||||
"ToPort": "8000",
|
|
||||||
"CidrIp": "0.0.0.0/0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"IpProtocol": "tcp",
|
|
||||||
"FromPort": "8443",
|
|
||||||
"ToPort": "8443",
|
|
||||||
"CidrIp": "0.0.0.0/0"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"brokerWaitHandle": {
|
|
||||||
"Type": "AWS::CloudFormation::WaitConditionHandle"
|
|
||||||
},
|
|
||||||
"brokerWaitCondition": {
|
|
||||||
"Type": "AWS::CloudFormation::WaitCondition",
|
|
||||||
"DependsOn": "BrokerInstance",
|
|
||||||
"Properties": {
|
|
||||||
"Handle": {
|
|
||||||
"Ref": "brokerWaitHandle"
|
|
||||||
},
|
|
||||||
"Timeout": "6000"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"BrokerInstance": {
|
|
||||||
"Type": "AWS::EC2::Instance",
|
|
||||||
"Properties": {
|
|
||||||
"ImageId": {
|
|
||||||
"Fn::FindInMap": [ "JeosImages", "Broker", "Image" ]
|
|
||||||
},
|
|
||||||
"InstanceType": "m1.small",
|
|
||||||
"KeyName": {
|
|
||||||
"Ref": "KeyName"
|
|
||||||
},
|
|
||||||
"SecurityGroups": [
|
|
||||||
{
|
|
||||||
"Ref": "OpenShiftOriginSecurityGroup"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"Tags": [
|
|
||||||
{
|
|
||||||
"Key": "Name",
|
|
||||||
"Value": {
|
|
||||||
"Fn::Join": [ "-", [ "openshift", { "Ref": "Prefix" }, "broker" ] ]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"UserData": {
|
|
||||||
"Fn::Base64": {
|
|
||||||
"Fn::Join": [
|
|
||||||
"",
|
|
||||||
[
|
|
||||||
"#!/bin/bash -x\n",
|
|
||||||
"export PREFIX=", { "Ref": "Prefix" }, "\n",
|
|
||||||
"export UPSTREAM_DNS=", { "Ref": "UpstreamDNS" }, "\n",
|
|
||||||
"export BROKER_WAIT_HANDLE=\"", { "Ref": "brokerWaitHandle" }, "\"\n",
|
|
||||||
"/usr/sbin/dnssec-keygen -a HMAC-MD5 -b 512 -n USER -r /dev/urandom -K /var/named ${PREFIX}\n",
|
|
||||||
"export DNS_SEC_KEY=\"`cat /var/named/K${PREFIX}.*.key | awk '{print $8}'`\"\n",
|
|
||||||
"export EC2_INSTANCE_ID=\"`facter ec2_instance_id`\"\n",
|
|
||||||
"export IP_ADDRESS=\"`facter ipaddress`\"\n",
|
|
||||||
"cat << EOF > /root/configure.pp\n",
|
|
||||||
"\\$my_hostname=\"\\${ec2_instance_id}.${PREFIX}\"\n",
|
|
||||||
"file { \"update network settings - hostname\":", "\n",
|
|
||||||
" path => \"/etc/sysconfig/network\",\n",
|
|
||||||
" content => \"NETWORKING=yes\\nNETWORKING_IPV6=no\\nHOSTNAME=\\${my_hostname}\"\n",
|
|
||||||
"}\n",
|
|
||||||
"exec { \"set hostname\":\n",
|
|
||||||
" command => \"/bin/hostname \\${my_hostname} ; echo \\${my_hostname} > /etc/hostname\"\n",
|
|
||||||
"}\n",
|
|
||||||
"augeas{ \"etc hosts setup\" :\n",
|
|
||||||
" context => \"/files/etc/hosts\",\n",
|
|
||||||
" changes => [\n",
|
|
||||||
" \"set 01/ipaddr \\${ipaddress}\",\n",
|
|
||||||
" \"set 01/canonical \\${my_hostname}\",\n",
|
|
||||||
" ],\n",
|
|
||||||
"}\n",
|
|
||||||
"augeas{ \"network peerdns setup\" :\n",
|
|
||||||
" context => \"/files/etc/sysconfig/network-scripts/ifcfg-eth0\",\n",
|
|
||||||
" changes => [\n",
|
|
||||||
" \"set PEERDNS no\",\n",
|
|
||||||
" ],\n",
|
|
||||||
"}\n",
|
|
||||||
"class { 'openshift_origin' :\n",
|
|
||||||
" node_fqdn => \\$my_hostname,\n",
|
|
||||||
" cloud_domain => '${PREFIX}',\n",
|
|
||||||
" named_tsig_priv_key => '${DNS_SEC_KEY}',\n",
|
|
||||||
" dns_servers => ['${UPSTREAM_DNS}'],\n",
|
|
||||||
" os_unmanaged_users => ['ec2-user'],\n",
|
|
||||||
" enable_network_services => true,\n",
|
|
||||||
" configure_firewall => true,\n",
|
|
||||||
" configure_ntp => true,\n",
|
|
||||||
" configure_activemq => true,\n",
|
|
||||||
" configure_qpid => false,\n",
|
|
||||||
" configure_mongodb => true,\n",
|
|
||||||
" configure_named => true,\n",
|
|
||||||
" configure_broker => true,\n",
|
|
||||||
" configure_console => true,\n",
|
|
||||||
" configure_node => false,\n",
|
|
||||||
" development_mode => true,\n",
|
|
||||||
" named_ipaddress => \\$ipaddress,\n",
|
|
||||||
" mongodb_fqdn => \\$my_hostname,\n",
|
|
||||||
" mq_fqdn => \\$my_hostname,\n",
|
|
||||||
" broker_fqdn => \\$my_hostname,\n",
|
|
||||||
"}\n",
|
|
||||||
"EOF\n",
|
|
||||||
"mkdir -p /etc/puppet/modules\n",
|
|
||||||
"puppet module install openshift/openshift_origin", "\n",
|
|
||||||
"puppet apply --verbose /root/configure.pp | tee /var/log/configure_openshift.log", "\n",
|
|
||||||
"setsebool -P httpd_unified=on\n",
|
|
||||||
"service network restart | tee /var/log/configure_openshift.log;\n",
|
|
||||||
"service mongod restart | tee /var/log/configure_openshift.log;\n",
|
|
||||||
"service activemq restart | tee /var/log/configure_openshift.log;\n",
|
|
||||||
"service httpd restart | tee /var/log/configure_openshift.log;\n",
|
|
||||||
"service openshift-broker restart | tee /var/log/configure_openshift.log;\n",
|
|
||||||
"service openshift-console restart | tee /var/log/configure_openshift.log;\n",
|
|
||||||
"service named restart | tee /var/log/configure_openshift.log;\n",
|
|
||||||
"cat << EOF > /etc/resolv.conf\n",
|
|
||||||
"; generated by heat\n",
|
|
||||||
"search ${PREFIX}\n",
|
|
||||||
"nameserver 127.0.0.1\n",
|
|
||||||
"EOF\n",
|
|
||||||
"cat << _EOF > /root/nsupdate.cmd\n",
|
|
||||||
"key ${PREFIX} ${DNS_SEC_KEY}\n",
|
|
||||||
"server ${IP_ADDRESS} 53\n",
|
|
||||||
"update delete ${EC2_INSTANCE_ID}.${PREFIX} A\n",
|
|
||||||
"update add ${EC2_INSTANCE_ID}.${PREFIX} 180 A ${IP_ADDRESS}\n",
|
|
||||||
"send\n",
|
|
||||||
"_EOF\n",
|
|
||||||
"cat /root/nsupdate.cmd | nsupdate\n",
|
|
||||||
"setenforce 1\n",
|
|
||||||
"# All is well so signal success\n",
|
|
||||||
"/opt/aws/bin/cfn-signal -e 0 --data \"${DNS_SEC_KEY}\" -r \"Broker setup complete\" \"${BROKER_WAIT_HANDLE}\"\n"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"NodeInstance": {
|
|
||||||
"Type": "AWS::EC2::Instance",
|
|
||||||
"DependsOn": "brokerWaitCondition",
|
|
||||||
"Properties": {
|
|
||||||
"ImageId": {
|
|
||||||
"Fn::FindInMap": [ "JeosImages", "Node", "Image" ]
|
|
||||||
},
|
|
||||||
"InstanceType": "m1.small",
|
|
||||||
"KeyName": { "Ref": "KeyName" },
|
|
||||||
"SecurityGroups": [ { "Ref": "OpenShiftOriginSecurityGroup" } ],
|
|
||||||
"Tags": [ { "Key": "Name", "Value": { "Fn::Join": [ "-", [ "openshift", { "Ref": "Prefix" }, "node" ] ] } } ],
|
|
||||||
"UserData": {
|
|
||||||
"Fn::Base64": {
|
|
||||||
"Fn::Join": [
|
|
||||||
"",
|
|
||||||
[
|
|
||||||
"#!/bin/bash -x", "\n",
|
|
||||||
"export DNS_SEC_KEY=\"`python -c 'print ",{ "Fn::GetAtt": [ "brokerWaitCondition", "Data" ] },"[\"00000\"]'`\"\n",
|
|
||||||
"export BROKER_IP=", { "Fn::GetAtt": [ "BrokerInstance", "PublicIp" ] }, "\n",
|
|
||||||
"export PREFIX=", { "Ref": "Prefix" }, "\n",
|
|
||||||
"export EC2_INSTANCE_ID=\"`facter ec2_instance_id`\"\n",
|
|
||||||
"export IP_ADDRESS=\"`facter ipaddress`\"\n",
|
|
||||||
"cat << EOF > /root/configure.pp\n",
|
|
||||||
"\\$my_hostname=\"\\${ec2_instance_id}.${PREFIX}\"\n",
|
|
||||||
"file { \"update network settings - hostname\":", "\n",
|
|
||||||
" path => \"/etc/sysconfig/network\",\n",
|
|
||||||
" content => \"NETWORKING=yes\\nNETWORKING_IPV6=no\\nHOSTNAME=\\${my_hostname}\"\n",
|
|
||||||
"}\n",
|
|
||||||
"exec { \"set hostname\":\n",
|
|
||||||
" command => \"/bin/hostname \\${my_hostname} ; echo \\${my_hostname} > /etc/hostname\"\n",
|
|
||||||
"}\n",
|
|
||||||
"augeas{ \"etc hosts setup\" :\n",
|
|
||||||
" context => \"/files/etc/hosts\",\n",
|
|
||||||
" changes => [\n",
|
|
||||||
" \"set 01/ipaddr \\${ipaddress}\",\n",
|
|
||||||
" \"set 01/canonical \\${my_hostname}\",\n",
|
|
||||||
" ],\n",
|
|
||||||
"}\n",
|
|
||||||
"augeas{ \"network peerdns setup\" :\n",
|
|
||||||
" context => \"/files/etc/sysconfig/network-scripts/ifcfg-eth0\",\n",
|
|
||||||
" changes => [\n",
|
|
||||||
" \"set PEERDNS no\",\n",
|
|
||||||
" ],\n",
|
|
||||||
"}\n",
|
|
||||||
"class { \"openshift_origin\" :\n",
|
|
||||||
" node_fqdn => \\$my_hostname,\n",
|
|
||||||
" cloud_domain => '${PREFIX}',\n",
|
|
||||||
" named_tsig_priv_key => '${DNS_SEC_KEY}',\n",
|
|
||||||
" dns_servers => ['${BROKER_IP}'],\n",
|
|
||||||
" os_unmanaged_users => ['ec2-user'],\n",
|
|
||||||
" enable_network_services => true,\n",
|
|
||||||
" configure_firewall => true,\n",
|
|
||||||
" configure_ntp => true,\n",
|
|
||||||
" configure_activemq => false,\n",
|
|
||||||
" configure_qpid => false,\n",
|
|
||||||
" configure_mongodb => false,\n",
|
|
||||||
" configure_named => false,\n",
|
|
||||||
" configure_broker => false,\n",
|
|
||||||
" configure_console => false,\n",
|
|
||||||
" configure_node => true,\n",
|
|
||||||
" development_mode => true,\n",
|
|
||||||
" named_ipaddress => '${BROKER_IP}',\n",
|
|
||||||
" mongodb_fqdn => '${BROKER_IP}',\n",
|
|
||||||
" mq_fqdn => '${BROKER_IP}',\n",
|
|
||||||
" broker_fqdn => '${BROKER_IP}',\n",
|
|
||||||
"}\n",
|
|
||||||
"EOF\n",
|
|
||||||
"mkdir -p /etc/puppet/modules\n",
|
|
||||||
"puppet module install openshift/openshift_origin", "\n",
|
|
||||||
"puppet apply --verbose /root/configure.pp | tee /var/log/configure_openshift.log;", "\n",
|
|
||||||
"service network restart | tee /var/log/configure_openshift.log;\n",
|
|
||||||
"service cgconfig restart | tee /var/log/configure_openshift.log;\n",
|
|
||||||
"service cgred restart | tee /var/log/configure_openshift.log;\n",
|
|
||||||
"service openshift-cgroups restart | tee /var/log/configure_openshift.log;\n",
|
|
||||||
"service openshift-node-web-proxy restart | tee /var/log/configure_openshift.log;\n",
|
|
||||||
"service openshift-gears restart | tee /var/log/configure_openshift.log;\n",
|
|
||||||
"service openshift-port-proxy restart | tee /var/log/configure_openshift.log;\n",
|
|
||||||
"service mcollective restart | tee /var/log/configure_openshift.log;\n",
|
|
||||||
"service httpd restart | tee /var/log/configure_openshift.log;\n",
|
|
||||||
"service sshd restart | tee /var/log/configure_openshift.log;\n",
|
|
||||||
"cat << EOF > /etc/resolv.conf\n",
|
|
||||||
"; generated by heat\n",
|
|
||||||
"search ${PREFIX}\n",
|
|
||||||
"nameserver ${BROKER_IP}\n",
|
|
||||||
"EOF\n",
|
|
||||||
"cat << _EOF > /root/nsupdate.cmd\n",
|
|
||||||
"key ${PREFIX} ${DNS_SEC_KEY}\n",
|
|
||||||
"server ${BROKER_IP} 53\n",
|
|
||||||
"update delete ${EC2_INSTANCE_ID}.${PREFIX} A\n",
|
|
||||||
"update add ${EC2_INSTANCE_ID}.${PREFIX} 180 A ${IP_ADDRESS}\n",
|
|
||||||
"send\n",
|
|
||||||
"_EOF\n",
|
|
||||||
"cat /root/nsupdate.cmd | nsupdate\n",
|
|
||||||
"setenforce 1\n"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
"Outputs" : {
|
|
||||||
"OpenShiftConsole" : {
|
|
||||||
"Value" : { "Fn::Join" : ["", ["https://", { "Fn::GetAtt" : [ "BrokerInstance", "PublicIp" ]}, "/console"]] },
|
|
||||||
"Description" : "URL for OpenShift Origins console"
|
|
||||||
},
|
|
||||||
"NameServerEntry" : {
|
|
||||||
"Value" : { "Fn::Join" : ["", ["nameserver ", { "Fn::GetAtt" : [ "BrokerInstance", "PublicIp" ]}]] },
|
|
||||||
"Description" : "Entry to insert into /etc/resolv.conf for application host names to resolve"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,390 +0,0 @@
|
||||||
HeatTemplateFormatVersion: '2012-12-12'
|
|
||||||
Description: Template for setting up an AutoScaled OpenShift Origin environment
|
|
||||||
Parameters:
|
|
||||||
KeyName:
|
|
||||||
Description: Name of an existing keypair to enable SSH access to the instances
|
|
||||||
Type: String
|
|
||||||
MinLength: '1'
|
|
||||||
MaxLength: '64'
|
|
||||||
AllowedPattern: '[-_ a-zA-Z0-9]*'
|
|
||||||
Prefix:
|
|
||||||
Description: Your DNS Prefix
|
|
||||||
Type: String
|
|
||||||
Default: example.com
|
|
||||||
UpstreamDNS:
|
|
||||||
Description: Upstream DNS server
|
|
||||||
Type: String
|
|
||||||
Default: 8.8.8.8
|
|
||||||
BrokerServerFlavor:
|
|
||||||
Description: Flavor of broker server
|
|
||||||
Type: String
|
|
||||||
Default: m1.small
|
|
||||||
AllowedValues: [m1.small, m1.medium, m1.large, m1.xlarge]
|
|
||||||
ConstraintDescription: Must be a valid server flavor
|
|
||||||
NodeServerFlavor:
|
|
||||||
Description: Flavor of node servers
|
|
||||||
Type: String
|
|
||||||
Default: m1.small
|
|
||||||
AllowedValues: [m1.small, m1.medium, m1.large, m1.xlarge]
|
|
||||||
ConstraintDescription: Must be a valid server flavor
|
|
||||||
NodeCountMinimum:
|
|
||||||
Description: Minimum number of nodes to scale down to
|
|
||||||
Type: String
|
|
||||||
Default: '1'
|
|
||||||
AllowedPattern: '[0-9]*'
|
|
||||||
NodeCountMaximum:
|
|
||||||
Description: Maximum number of nodes to scale up to
|
|
||||||
Type: String
|
|
||||||
Default: '3'
|
|
||||||
AllowedPattern: '[0-9]*'
|
|
||||||
Mappings:
|
|
||||||
JeosImages:
|
|
||||||
Broker:
|
|
||||||
Image: F18-x86_64-openshift-origin-broker-cfntools
|
|
||||||
Node:
|
|
||||||
Image: F18-x86_64-openshift-origin-node-cfntools
|
|
||||||
Resources:
|
|
||||||
OpenshiftUser:
|
|
||||||
Type: AWS::IAM::User
|
|
||||||
OpenshiftOriginKeys:
|
|
||||||
Type: AWS::IAM::AccessKey
|
|
||||||
Properties:
|
|
||||||
UserName:
|
|
||||||
Ref: OpenshiftUser
|
|
||||||
OpenshiftOriginNodeGroup:
|
|
||||||
Type: AWS::AutoScaling::AutoScalingGroup
|
|
||||||
DependsOn: BrokerWaitCondition
|
|
||||||
Properties:
|
|
||||||
AvailabilityZones: []
|
|
||||||
LaunchConfigurationName:
|
|
||||||
Ref: NodeLaunchConfig
|
|
||||||
MinSize:
|
|
||||||
Ref: NodeCountMinimum
|
|
||||||
MaxSize:
|
|
||||||
Ref: NodeCountMaximum
|
|
||||||
LoadBalancerNames: []
|
|
||||||
OpenshiftOriginScaleUpPolicy:
|
|
||||||
Type: AWS::AutoScaling::ScalingPolicy
|
|
||||||
Properties:
|
|
||||||
AdjustmentType: ChangeInCapacity
|
|
||||||
AutoScalingGroupName:
|
|
||||||
Ref: OpenshiftOriginNodeGroup
|
|
||||||
Cooldown: '120'
|
|
||||||
ScalingAdjustment: '1'
|
|
||||||
OpenshiftOriginScaleDownPolicy:
|
|
||||||
Type: AWS::AutoScaling::ScalingPolicy
|
|
||||||
Properties:
|
|
||||||
AdjustmentType: ChangeInCapacity
|
|
||||||
AutoScalingGroupName:
|
|
||||||
Ref: OpenshiftOriginNodeGroup
|
|
||||||
Cooldown: '60'
|
|
||||||
ScalingAdjustment: '-1'
|
|
||||||
NodeScaleUp:
|
|
||||||
Type: AWS::CloudWatch::Alarm
|
|
||||||
Properties:
|
|
||||||
AlarmDescription: Scale-up if event received from broker
|
|
||||||
MetricName: Heartbeat
|
|
||||||
Namespace: system/linux
|
|
||||||
Statistic: SampleCount
|
|
||||||
Period: '60'
|
|
||||||
EvaluationPeriods: '1'
|
|
||||||
Threshold: '0'
|
|
||||||
AlarmActions: [{Ref: OpenshiftOriginScaleUpPolicy}]
|
|
||||||
Dimensions:
|
|
||||||
- Name: AutoScalingGroupName
|
|
||||||
Value:
|
|
||||||
Ref: OpenshiftOriginNodeGroup
|
|
||||||
ComparisonOperator: GreaterThanThreshold
|
|
||||||
NodeScaleDown:
|
|
||||||
Type: AWS::CloudWatch::Alarm
|
|
||||||
Properties:
|
|
||||||
AlarmDescription: Scale-down if event received from broker
|
|
||||||
MetricName: Heartbeat
|
|
||||||
Namespace: system/linux
|
|
||||||
Statistic: SampleCount
|
|
||||||
Period: '60'
|
|
||||||
EvaluationPeriods: '1'
|
|
||||||
Threshold: '0'
|
|
||||||
AlarmActions: [{Ref: OpenshiftOriginScaleDownPolicy}]
|
|
||||||
Dimensions:
|
|
||||||
- Name: AutoScalingGroupName
|
|
||||||
Value:
|
|
||||||
Ref: OpenshiftOriginNodeGroup
|
|
||||||
ComparisonOperator: GreaterThanThreshold
|
|
||||||
OpenShiftOriginSecurityGroup:
|
|
||||||
Type: AWS::EC2::SecurityGroup
|
|
||||||
Properties:
|
|
||||||
GroupDescription: Standard firewall rules
|
|
||||||
SecurityGroupIngress:
|
|
||||||
- {IpProtocol: udp, FromPort: '53', ToPort: '53', CidrIp: 0.0.0.0/0}
|
|
||||||
- {IpProtocol: tcp, FromPort: '53', ToPort: '53', CidrIp: 0.0.0.0/0}
|
|
||||||
- {IpProtocol: tcp, FromPort: '22', ToPort: '22', CidrIp: 0.0.0.0/0}
|
|
||||||
- {IpProtocol: tcp, FromPort: '80', ToPort: '80', CidrIp: 0.0.0.0/0}
|
|
||||||
- {IpProtocol: tcp, FromPort: '443', ToPort: '443', CidrIp: 0.0.0.0/0}
|
|
||||||
- {IpProtocol: tcp, FromPort: '8000', ToPort: '8000', CidrIp: 0.0.0.0/0}
|
|
||||||
- {IpProtocol: tcp, FromPort: '8443', ToPort: '8443', CidrIp: 0.0.0.0/0}
|
|
||||||
BrokerWaitHandle:
|
|
||||||
Type: AWS::CloudFormation::WaitConditionHandle
|
|
||||||
BrokerWaitCondition:
|
|
||||||
Type: AWS::CloudFormation::WaitCondition
|
|
||||||
DependsOn: BrokerInstance
|
|
||||||
Properties:
|
|
||||||
Handle:
|
|
||||||
Ref: BrokerWaitHandle
|
|
||||||
Timeout: '6000'
|
|
||||||
BrokerInstance:
|
|
||||||
Type: AWS::EC2::Instance
|
|
||||||
Properties:
|
|
||||||
ImageId:
|
|
||||||
Fn::FindInMap: [JeosImages, Broker, Image]
|
|
||||||
InstanceType:
|
|
||||||
Ref: BrokerServerFlavor
|
|
||||||
KeyName:
|
|
||||||
Ref: KeyName
|
|
||||||
SecurityGroups: [{Ref: OpenShiftOriginSecurityGroup}]
|
|
||||||
Tags:
|
|
||||||
- Key: Name
|
|
||||||
Value:
|
|
||||||
Fn::Join:
|
|
||||||
- '-'
|
|
||||||
- ['openshift', {Ref: Prefix}, 'broker']
|
|
||||||
UserData:
|
|
||||||
Fn::Base64:
|
|
||||||
Fn::Join:
|
|
||||||
- ''
|
|
||||||
- - |-
|
|
||||||
#!/bin/bash -x
|
|
||||||
export PREFIX=
|
|
||||||
- {Ref: Prefix}
|
|
||||||
- |-
|
|
||||||
|
|
||||||
export UPSTREAM_DNS=
|
|
||||||
- {Ref: UpstreamDNS}
|
|
||||||
- |-
|
|
||||||
|
|
||||||
export BROKER_WAIT_HANDLE="
|
|
||||||
- {Ref: BrokerWaitHandle}
|
|
||||||
- |-
|
|
||||||
"
|
|
||||||
/usr/sbin/dnssec-keygen -a HMAC-MD5 -b 512 -n USER -r /dev/urandom -K /var/named ${PREFIX}
|
|
||||||
export DNS_SEC_KEY="`cat /var/named/K${PREFIX}.*.key | awk '{print $8}'`"
|
|
||||||
export EC2_INSTANCE_ID="`facter ec2_instance_id`"
|
|
||||||
export IP_ADDRESS="`facter ipaddress`"
|
|
||||||
mkdir -p /etc/heat
|
|
||||||
cat << EOF > /etc/heat/heat-credentials
|
|
||||||
AWSAccessKeyId=
|
|
||||||
- {Ref: OpenshiftOriginKeys}
|
|
||||||
- |-
|
|
||||||
|
|
||||||
AWSSecretKey=
|
|
||||||
- Fn::GetAtt: [OpenshiftOriginKeys, SecretAccessKey]
|
|
||||||
- |-
|
|
||||||
|
|
||||||
EOF
|
|
||||||
chmod 0400 /etc/heat/heat-credentials
|
|
||||||
|
|
||||||
cat << EOF > /etc/heat/notify-scale-up
|
|
||||||
#!/bin/bash
|
|
||||||
/opt/aws/bin/cfn-push-stats --credential-file /etc/heat/heat-credentials --heartbeat --watch
|
|
||||||
- {Ref: NodeScaleUp}
|
|
||||||
- |-
|
|
||||||
|
|
||||||
EOF
|
|
||||||
chmod 0700 /etc/heat/notify-scale-up
|
|
||||||
|
|
||||||
cat << EOF > /etc/heat/notify-scale-down
|
|
||||||
#!/bin/bash
|
|
||||||
/opt/aws/bin/cfn-push-stats --credential-file /etc/heat/heat-credentials --heartbeat --watch
|
|
||||||
- {Ref: NodeScaleDown}
|
|
||||||
- |-
|
|
||||||
|
|
||||||
EOF
|
|
||||||
chmod 0700 /etc/heat/notify-scale-down
|
|
||||||
|
|
||||||
cat << EOF > /root/configure.pp
|
|
||||||
\$my_hostname="\${ec2_instance_id}.${PREFIX}"
|
|
||||||
file { "update network settings - hostname":
|
|
||||||
path => "/etc/sysconfig/network",
|
|
||||||
content => "NETWORKING=yes\nNETWORKING_IPV6=no\nHOSTNAME=\${my_hostname}"
|
|
||||||
}
|
|
||||||
exec { "set hostname":
|
|
||||||
command => "/bin/hostname \${my_hostname} ; echo \${my_hostname} > /etc/hostname"
|
|
||||||
}
|
|
||||||
augeas{ "etc hosts setup" :
|
|
||||||
context => "/files/etc/hosts",
|
|
||||||
changes => [
|
|
||||||
"set 01/ipaddr \${ipaddress}",
|
|
||||||
"set 01/canonical \${my_hostname}",
|
|
||||||
],
|
|
||||||
}
|
|
||||||
augeas{ "network peerdns setup" :
|
|
||||||
context => "/files/etc/sysconfig/network-scripts/ifcfg-eth0",
|
|
||||||
changes => [
|
|
||||||
"set PEERDNS no",
|
|
||||||
],
|
|
||||||
}
|
|
||||||
class { 'openshift_origin' :
|
|
||||||
node_fqdn => \$my_hostname,
|
|
||||||
cloud_domain => '${PREFIX}',
|
|
||||||
named_tsig_priv_key => '${DNS_SEC_KEY}',
|
|
||||||
dns_servers => ['${UPSTREAM_DNS}'],
|
|
||||||
os_unmanaged_users => ['ec2-user'],
|
|
||||||
enable_network_services => true,
|
|
||||||
configure_firewall => true,
|
|
||||||
configure_ntp => true,
|
|
||||||
configure_activemq => true,
|
|
||||||
configure_qpid => false,
|
|
||||||
configure_mongodb => true,
|
|
||||||
configure_named => true,
|
|
||||||
configure_broker => true,
|
|
||||||
configure_console => true,
|
|
||||||
configure_node => false,
|
|
||||||
development_mode => true,
|
|
||||||
named_ipaddress => \$ipaddress,
|
|
||||||
mongodb_fqdn => \$my_hostname,
|
|
||||||
mq_fqdn => \$my_hostname,
|
|
||||||
broker_fqdn => \$my_hostname,
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
mkdir -p /etc/puppet/modules
|
|
||||||
puppet module install openshift/openshift_origin
|
|
||||||
puppet apply --verbose /root/configure.pp | tee /var/log/configure_openshift.log
|
|
||||||
setsebool -P httpd_unified=on
|
|
||||||
service network restart | tee /var/log/configure_openshift.log;
|
|
||||||
service mongod restart | tee /var/log/configure_openshift.log;
|
|
||||||
service activemq restart | tee /var/log/configure_openshift.log;
|
|
||||||
service httpd restart | tee /var/log/configure_openshift.log;
|
|
||||||
service openshift-broker restart | tee /var/log/configure_openshift.log;
|
|
||||||
service openshift-console restart | tee /var/log/configure_openshift.log;
|
|
||||||
service named restart | tee /var/log/configure_openshift.log;
|
|
||||||
cat << EOF > /etc/resolv.conf
|
|
||||||
; generated by heat
|
|
||||||
search ${PREFIX}
|
|
||||||
nameserver 127.0.0.1
|
|
||||||
EOF
|
|
||||||
cat << _EOF > /root/nsupdate.cmd
|
|
||||||
key ${PREFIX} ${DNS_SEC_KEY}
|
|
||||||
server ${IP_ADDRESS} 53
|
|
||||||
update delete ${EC2_INSTANCE_ID}.${PREFIX} A
|
|
||||||
update add ${EC2_INSTANCE_ID}.${PREFIX} 180 A ${IP_ADDRESS}
|
|
||||||
send
|
|
||||||
_EOF
|
|
||||||
cat /root/nsupdate.cmd | nsupdate
|
|
||||||
setenforce 1
|
|
||||||
# All is well so signal success
|
|
||||||
/opt/aws/bin/cfn-signal -e 0 --data "${DNS_SEC_KEY}" -r "Broker setup complete" "${BROKER_WAIT_HANDLE}"
|
|
||||||
NodeLaunchConfig:
|
|
||||||
Type: AWS::AutoScaling::LaunchConfiguration
|
|
||||||
Properties:
|
|
||||||
ImageId:
|
|
||||||
Fn::FindInMap: [JeosImages, Node, Image]
|
|
||||||
InstanceType:
|
|
||||||
Ref: NodeServerFlavor
|
|
||||||
KeyName:
|
|
||||||
Ref: KeyName
|
|
||||||
SecurityGroups: [{Ref: OpenShiftOriginSecurityGroup}]
|
|
||||||
UserData:
|
|
||||||
Fn::Base64:
|
|
||||||
Fn::Join:
|
|
||||||
- ''
|
|
||||||
- - |-
|
|
||||||
#!/bin/bash -x
|
|
||||||
export DNS_SEC_KEY="`python -c 'print
|
|
||||||
- Fn::GetAtt: [BrokerWaitCondition, Data]
|
|
||||||
- |-
|
|
||||||
["00000"]'`"
|
|
||||||
export BROKER_IP=
|
|
||||||
- Fn::GetAtt: [BrokerInstance, PublicIp]
|
|
||||||
- |-
|
|
||||||
|
|
||||||
export PREFIX=
|
|
||||||
- {Ref: Prefix}
|
|
||||||
- |-
|
|
||||||
|
|
||||||
export EC2_INSTANCE_ID="`facter ec2_instance_id`"
|
|
||||||
export IP_ADDRESS="`facter ipaddress`"
|
|
||||||
cat << EOF > /root/configure.pp
|
|
||||||
\$my_hostname="\${ec2_instance_id}.${PREFIX}"
|
|
||||||
file { "update network settings - hostname":
|
|
||||||
path => "/etc/sysconfig/network",
|
|
||||||
content => "NETWORKING=yes\nNETWORKING_IPV6=no\nHOSTNAME=\${my_hostname}"
|
|
||||||
}
|
|
||||||
exec { "set hostname":
|
|
||||||
command => "/bin/hostname \${my_hostname} ; echo \${my_hostname} > /etc/hostname"
|
|
||||||
}
|
|
||||||
augeas{ "etc hosts setup" :
|
|
||||||
context => "/files/etc/hosts",
|
|
||||||
changes => [
|
|
||||||
"set 01/ipaddr \${ipaddress}",
|
|
||||||
"set 01/canonical \${my_hostname}",
|
|
||||||
],
|
|
||||||
}
|
|
||||||
augeas{ "network peerdns setup" :
|
|
||||||
context => "/files/etc/sysconfig/network-scripts/ifcfg-eth0",
|
|
||||||
changes => [
|
|
||||||
"set PEERDNS no",
|
|
||||||
],
|
|
||||||
}
|
|
||||||
class { "openshift_origin" :
|
|
||||||
node_fqdn => \$my_hostname,
|
|
||||||
cloud_domain => '${PREFIX}',
|
|
||||||
named_tsig_priv_key => '${DNS_SEC_KEY}',
|
|
||||||
dns_servers => ['${BROKER_IP}'],
|
|
||||||
os_unmanaged_users => ['ec2-user'],
|
|
||||||
enable_network_services => true,
|
|
||||||
configure_firewall => true,
|
|
||||||
configure_ntp => true,
|
|
||||||
configure_activemq => false,
|
|
||||||
configure_qpid => false,
|
|
||||||
configure_mongodb => false,
|
|
||||||
configure_named => false,
|
|
||||||
configure_broker => false,
|
|
||||||
configure_console => false,
|
|
||||||
configure_node => true,
|
|
||||||
development_mode => true,
|
|
||||||
named_ipaddress => '${BROKER_IP}',
|
|
||||||
mongodb_fqdn => '${BROKER_IP}',
|
|
||||||
mq_fqdn => '${BROKER_IP}',
|
|
||||||
broker_fqdn => '${BROKER_IP}',
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
mkdir -p /etc/puppet/modules
|
|
||||||
puppet module install openshift/openshift_origin
|
|
||||||
puppet apply --verbose /root/configure.pp | tee /var/log/configure_openshift.log;
|
|
||||||
service network restart | tee /var/log/configure_openshift.log;
|
|
||||||
service cgconfig restart | tee /var/log/configure_openshift.log;
|
|
||||||
service cgred restart | tee /var/log/configure_openshift.log;
|
|
||||||
service openshift-cgroups restart | tee /var/log/configure_openshift.log;
|
|
||||||
service openshift-node-web-proxy restart | tee /var/log/configure_openshift.log;
|
|
||||||
service openshift-gears restart | tee /var/log/configure_openshift.log;
|
|
||||||
service openshift-port-proxy restart | tee /var/log/configure_openshift.log;
|
|
||||||
service mcollective restart | tee /var/log/configure_openshift.log;
|
|
||||||
service httpd restart | tee /var/log/configure_openshift.log;
|
|
||||||
service sshd restart | tee /var/log/configure_openshift.log;
|
|
||||||
cat << EOF > /etc/resolv.conf
|
|
||||||
; generated by heat
|
|
||||||
search ${PREFIX}
|
|
||||||
nameserver ${BROKER_IP}
|
|
||||||
EOF
|
|
||||||
cat << _EOF > /root/nsupdate.cmd
|
|
||||||
key ${PREFIX} ${DNS_SEC_KEY}
|
|
||||||
server ${BROKER_IP} 53
|
|
||||||
update delete ${EC2_INSTANCE_ID}.${PREFIX} A
|
|
||||||
update add ${EC2_INSTANCE_ID}.${PREFIX} 180 A ${IP_ADDRESS}
|
|
||||||
send
|
|
||||||
_EOF
|
|
||||||
cat /root/nsupdate.cmd | nsupdate
|
|
||||||
setenforce 1
|
|
||||||
Outputs:
|
|
||||||
OpenShiftConsole:
|
|
||||||
Value:
|
|
||||||
Fn::Join:
|
|
||||||
- ''
|
|
||||||
- ['https://', 'Fn::GetAtt': [BrokerInstance, PublicIp], '/console']
|
|
||||||
Description: URL for OpenShift Origins console
|
|
||||||
NameServerEntry:
|
|
||||||
Value:
|
|
||||||
Fn::Join:
|
|
||||||
- ''
|
|
||||||
- ['nameserver ', 'Fn::GetAtt': [BrokerInstance, PublicIp]]
|
|
||||||
Description: Entry to insert into /etc/resolv.conf for application host names to resolve
|
|
|
@ -1,22 +0,0 @@
|
||||||
==========================
|
|
||||||
OpenShift Origin templates
|
|
||||||
==========================
|
|
||||||
|
|
||||||
This directory contains files for deploying OpenShift Origin to an OpenStack environment via heat.
|
|
||||||
|
|
||||||
It includes the following files:
|
|
||||||
|
|
||||||
* `F18-x86_64-openshift-origin-broker-cfntools.tdl` - oz template for building a broker image
|
|
||||||
* `F18-x86_64-openshift-origin-node-cfntools.tdl` - oz template for building a node image
|
|
||||||
* `OpenShift.template` - heat template for launching OpenShift Origin with a single broker server and a single node server
|
|
||||||
* `openshift-origin` - diskimage-builder elements to build images, as an alternative to oz
|
|
||||||
|
|
||||||
To build with diskimage-builder, do the following in the parent directory of heat-templates::
|
|
||||||
|
|
||||||
git clone https://github.com/stackforge/diskimage-builder.git
|
|
||||||
git clone https://github.com/stackforge/tripleo-image-elements.git
|
|
||||||
mkdir $HOME/tmp
|
|
||||||
export ELEMENTS_PATH=tripleo-image-elements/elements:heat-templates/openshift-origin/elements
|
|
||||||
TMP_DIR=$HOME/tmp DIB_IMAGE_SIZE=5 diskimage-builder/bin/disk-image-create --no-tmpfs -a amd64 vm fedora openshift-origin-broker -o F18-x86_64-openshift-origin-broker-cfntools
|
|
||||||
TMP_DIR=$HOME/tmp DIB_IMAGE_SIZE=20 diskimage-builder/bin/disk-image-create --no-tmpfs -a amd64 vm fedora openshift-origin-node -o F18-x86_64-openshift-origin-node-cfntools
|
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
This element installs packages required by a typical OpenShift Origins broker.
|
|
||||||
|
|
||||||
The objective of including these packages on the instance is to speed the boot time of a broker.
|
|
|
@ -1,2 +0,0 @@
|
||||||
openshift-origin-repos
|
|
||||||
heat-cfntools
|
|
|
@ -1,70 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -uex
|
|
||||||
|
|
||||||
install-packages \
|
|
||||||
openshift-origin-broker \
|
|
||||||
rubygem-openshift-origin-msg-broker-mcollective \
|
|
||||||
rubygem-openshift-origin-dns-nsupdate \
|
|
||||||
rubygem-openshift-origin-dns-bind \
|
|
||||||
rubygem-openshift-origin-controller \
|
|
||||||
openshift-origin-broker-util \
|
|
||||||
rubygem-passenger \
|
|
||||||
mod_passenger \
|
|
||||||
openssh \
|
|
||||||
rubygem-openshift-origin-auth-mongo \
|
|
||||||
rubygem-openshift-origin-remote-user \
|
|
||||||
rubygem-openshift-origin-console \
|
|
||||||
openshift-origin-console \
|
|
||||||
mongodb \
|
|
||||||
mongodb-server \
|
|
||||||
bind \
|
|
||||||
bind-utils \
|
|
||||||
ntpdate \
|
|
||||||
policycoreutils \
|
|
||||||
mcollective \
|
|
||||||
httpd \
|
|
||||||
openssh-server \
|
|
||||||
rhc \
|
|
||||||
activemq \
|
|
||||||
activemq-client \
|
|
||||||
git \
|
|
||||||
puppet \
|
|
||||||
ruby \
|
|
||||||
ruby-devel \
|
|
||||||
ruby-irb \
|
|
||||||
ruby-libs \
|
|
||||||
tar \
|
|
||||||
yum-plugin-priorities \
|
|
||||||
mysql-devel \
|
|
||||||
mongodb-devel \
|
|
||||||
system-config-firewall-base \
|
|
||||||
rubygem-execjs \
|
|
||||||
rubygem-uglifier \
|
|
||||||
rubygem-listen \
|
|
||||||
rubygem-sass \
|
|
||||||
rubygem-sass-rails \
|
|
||||||
autogen-libopts \
|
|
||||||
ntp \
|
|
||||||
rubygem-coffee-script-source \
|
|
||||||
rubygem-coffee-script \
|
|
||||||
rubygem-coffee-rails \
|
|
||||||
rubygem-idn \
|
|
||||||
rubygem-addressable \
|
|
||||||
rubygem-crack \
|
|
||||||
rubygem-webmock \
|
|
||||||
rubygem-fakefs \
|
|
||||||
rubygem-chunky_png \
|
|
||||||
rubygem-hpricot \
|
|
||||||
rubygem-haml \
|
|
||||||
rubygem-fssm \
|
|
||||||
rubygem-compass \
|
|
||||||
rubygem-compass-rails \
|
|
||||||
rubygem-mongo \
|
|
||||||
rubygem-jquery-rails \
|
|
||||||
rubygem-openshift-origin-dns-avahi \
|
|
||||||
rubygem-ref \
|
|
||||||
rubygem-therubyracer
|
|
||||||
|
|
||||||
sed --in-place -e s/Type=oneshot/"Type=oneshot\nTimeoutSec=0"/ /lib/systemd/system/cloud-final.service
|
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
This element installs packages required by a typical OpenShift Origins node.
|
|
||||||
|
|
||||||
The objective of including these packages on the instance is to speed the boot time of a node.
|
|
|
@ -1,2 +0,0 @@
|
||||||
openshift-origin-repos
|
|
||||||
heat-cfntools
|
|
|
@ -1,60 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -uex
|
|
||||||
|
|
||||||
install-packages \
|
|
||||||
policycoreutils \
|
|
||||||
mcollective \
|
|
||||||
httpd \
|
|
||||||
openssh-server \
|
|
||||||
rhc \
|
|
||||||
ntpdate \
|
|
||||||
rubygem-openshift-origin-node \
|
|
||||||
openshift-origin-node-util \
|
|
||||||
pam_openshift \
|
|
||||||
openshift-origin-node-proxy \
|
|
||||||
openshift-origin-port-proxy \
|
|
||||||
openshift-origin-msg-node-mcollective \
|
|
||||||
git \
|
|
||||||
make \
|
|
||||||
cronie \
|
|
||||||
openshift-origin-cartridge-abstract \
|
|
||||||
openshift-origin-cartridge-10gen-mms-agent-0.1 \
|
|
||||||
openshift-origin-cartridge-cron-1.4 \
|
|
||||||
openshift-origin-cartridge-diy-0.1 \
|
|
||||||
openshift-origin-cartridge-haproxy-1.4 \
|
|
||||||
openshift-origin-cartridge-mongodb-2.2 \
|
|
||||||
openshift-origin-cartridge-mysql-5.1 \
|
|
||||||
openshift-origin-cartridge-nodejs-0.6 \
|
|
||||||
openshift-origin-cartridge-community-python-2.7 \
|
|
||||||
openshift-origin-cartridge-community-python-3.3 \
|
|
||||||
openshift-origin-cartridge-postgresql-9.2 \
|
|
||||||
openshift-origin-cartridge-ruby-1.9 \
|
|
||||||
openshift-origin-cartridge-php-5.4 \
|
|
||||||
openshift-origin-cartridge-perl-5.16 \
|
|
||||||
openshift-origin-cartridge-phpmyadmin-3.5 \
|
|
||||||
puppet \
|
|
||||||
system-config-firewall-base \
|
|
||||||
autogen-libopts \
|
|
||||||
ntp \
|
|
||||||
libogg \
|
|
||||||
libvorbis \
|
|
||||||
flac \
|
|
||||||
tzdata-java \
|
|
||||||
wget \
|
|
||||||
libasyncns \
|
|
||||||
gsm \
|
|
||||||
libsndfile \
|
|
||||||
pulseaudio-libs \
|
|
||||||
jline \
|
|
||||||
rhino \
|
|
||||||
ttmkfdir \
|
|
||||||
xorg-x11-fonts-Type1 \
|
|
||||||
1java-1.7.0-openjdk \
|
|
||||||
openshift-origin-cartridge-jenkins-client-1.4 \
|
|
||||||
jenkins \
|
|
||||||
jenkins-plugin-openshift \
|
|
||||||
openshift-origin-cartridge-jenkins-1.4
|
|
||||||
|
|
||||||
sed --in-place -e s/Type=oneshot/"Type=oneshot\nTimeoutSec=0"/ /lib/systemd/system/cloud-final.service
|
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
This element adds the following yum repositories which are known to work together:
|
|
||||||
|
|
||||||
- OpenShift Origin Release 1
|
|
||||||
- OpenShift Origin dependencies
|
|
||||||
- Jenkins
|
|
||||||
- PuppetLabs Products
|
|
|
@ -1 +0,0 @@
|
||||||
openshift-origin-repos
|
|
|
@ -1,12 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -uex
|
|
||||||
|
|
||||||
cat << EOF > /etc/yum.repos.d/puppetlabs-products.repo
|
|
||||||
[puppetlabs-products]
|
|
||||||
name=Puppet Labs Products Fedora 17 - x86_64
|
|
||||||
baseurl=http://yum.puppetlabs.com/fedora/f17/products/x86_64
|
|
||||||
gpgkey=http://yum.puppetlabs.com/RPM-GPG-KEY-puppetlabs
|
|
||||||
enabled=0
|
|
||||||
gpgcheck=1
|
|
||||||
EOF
|
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -uex
|
|
||||||
|
|
||||||
cat << EOF > /etc/yum.repos.d/openshift-origin.repo
|
|
||||||
[openshift-origin]
|
|
||||||
name=openshift-origin
|
|
||||||
baseurl="https://mirror.openshift.com/pub/openshift-origin/release/1/fedora-18/packages/x86_64/"
|
|
||||||
enabled=1
|
|
||||||
gpgcheck=0
|
|
||||||
EOF
|
|
||||||
|
|
||||||
cat << EOF > /etc/yum.repos.d/openshift-origin-deps.repo
|
|
||||||
[openshift-origin-deps]
|
|
||||||
name=openshift-origin-deps
|
|
||||||
baseurl="https://mirror.openshift.com/pub/openshift-origin/fedora-18/x86_64/"
|
|
||||||
enabled=1
|
|
||||||
gpgcheck=0
|
|
||||||
EOF
|
|
||||||
|
|
||||||
cat << EOF > /etc/yum.repos.d/jenkins.repo
|
|
||||||
[jenkins]
|
|
||||||
name=jenkins
|
|
||||||
baseurl=http://pkg.jenkins-ci.org/redhat
|
|
||||||
enabled=1
|
|
||||||
gpgcheck=1
|
|
||||||
EOF
|
|
||||||
|
|
||||||
rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key
|
|
|
@ -0,0 +1,326 @@
|
||||||
|
{
|
||||||
|
"AWSTemplateFormatVersion": "2010-09-09",
|
||||||
|
|
||||||
|
"Description": "Template for setting up an OpenShift Origin environment",
|
||||||
|
|
||||||
|
"Parameters": {
|
||||||
|
"KeyName": {
|
||||||
|
"Description": "Name of an existing EC2 KeyPair to enable SSH access to the instances",
|
||||||
|
"Type": "String",
|
||||||
|
"MinLength": "1",
|
||||||
|
"MaxLength": "64",
|
||||||
|
"AllowedPattern": "[-_ a-zA-Z0-9]*"
|
||||||
|
},
|
||||||
|
"Prefix": {
|
||||||
|
"Description": "Your DNS Prefix",
|
||||||
|
"Type": "String",
|
||||||
|
"Default": "example.com"
|
||||||
|
},
|
||||||
|
"UpstreamDNS": {
|
||||||
|
"Description": "Upstream DNS server",
|
||||||
|
"Type": "String",
|
||||||
|
"Default": "8.8.8.8"
|
||||||
|
},
|
||||||
|
"UpstreamNTP": {
|
||||||
|
"Description": "Upstream NTP server",
|
||||||
|
"Type": "String",
|
||||||
|
"Default": "'clock.redhat.com iburst'"
|
||||||
|
},
|
||||||
|
"BrokerFlavor": {
|
||||||
|
"Description": "Flavor of Broker instance",
|
||||||
|
"Type": "String",
|
||||||
|
"Default": "m1.small",
|
||||||
|
"AllowedValues": ["m1.small","m1.medium", "m1.large", "m1.xlarge"]
|
||||||
|
},
|
||||||
|
"NodeFlavor": {
|
||||||
|
"Description": "Flavor of Node instance",
|
||||||
|
"Type": "String",
|
||||||
|
"Default": "m1.small",
|
||||||
|
"AllowedValues": ["m1.small","m1.medium", "m1.large", "m1.xlarge"]
|
||||||
|
},
|
||||||
|
"Username": {
|
||||||
|
"Description": "Username for accessing OpenShift Origin",
|
||||||
|
"Type": "String",
|
||||||
|
"Default": "openshift"
|
||||||
|
},
|
||||||
|
"Password": {
|
||||||
|
"Description": "Password for accessing OpenShift Origin",
|
||||||
|
"Type": "String",
|
||||||
|
"Default": "password"
|
||||||
|
},
|
||||||
|
"NetID": {
|
||||||
|
"Description": "ID of Neutron network into which servers get deployed",
|
||||||
|
"Type": "String"
|
||||||
|
},
|
||||||
|
"SubnetID": {
|
||||||
|
"Description": "ID of Neutron subnet into which servers get deployed",
|
||||||
|
"Type": "String"
|
||||||
|
},
|
||||||
|
"DevMode": {
|
||||||
|
"Description": "Sets development mode and extra logging.",
|
||||||
|
"Type": "String",
|
||||||
|
"AllowedValues": [ "True", "False", "true", "false" ],
|
||||||
|
"Default": "false"
|
||||||
|
},
|
||||||
|
"PuppetModuleURL": {
|
||||||
|
"Description": "Sets the URL to pull the OpenShift Origin Puppet module from.",
|
||||||
|
"Type": "String",
|
||||||
|
"Default": "https://github.com/openshift/puppet-openshift_origin.git"
|
||||||
|
},
|
||||||
|
"PuppetModuleBranch": {
|
||||||
|
"Description": "Sets the repo branch to pull the OpenShift Origin Puppet module from.",
|
||||||
|
"Type": "String",
|
||||||
|
"Default": "master"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"Resources": {
|
||||||
|
"OpenShiftOriginSecurityGroup": {
|
||||||
|
"Type": "OS::Neutron::SecurityGroup",
|
||||||
|
"Properties": {
|
||||||
|
"description": "OpenShift Origin Firewall Rules",
|
||||||
|
"rules": [
|
||||||
|
{
|
||||||
|
"remote_ip_prefix": "0.0.0.0/0",
|
||||||
|
"protocol": "icmp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"remote_ip_prefix": "0.0.0.0/0",
|
||||||
|
"protocol": "tcp",
|
||||||
|
"port_range_min": "22",
|
||||||
|
"port_range_max": "22"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"remote_ip_prefix": "0.0.0.0/0",
|
||||||
|
"protocol": "udp",
|
||||||
|
"port_range_min": "53",
|
||||||
|
"port_range_max": "53"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"remote_ip_prefix": "0.0.0.0/0",
|
||||||
|
"protocol": "tcp",
|
||||||
|
"port_range_min": "80",
|
||||||
|
"port_range_max": "80"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"remote_ip_prefix": "0.0.0.0/0",
|
||||||
|
"protocol": "tcp",
|
||||||
|
"port_range_min": "443",
|
||||||
|
"port_range_max": "443"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"remote_ip_prefix": "0.0.0.0/0",
|
||||||
|
"protocol": "tcp",
|
||||||
|
"port_range_min": "8443",
|
||||||
|
"port_range_max": "8443"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"remote_ip_prefix": "0.0.0.0/0",
|
||||||
|
"protocol": "tcp",
|
||||||
|
"port_range_min": "8000",
|
||||||
|
"port_range_max": "8000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"remote_ip_prefix": "0.0.0.0/0",
|
||||||
|
"protocol": "tcp",
|
||||||
|
"port_range_min": "8161",
|
||||||
|
"port_range_max": "8161"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"remote_ip_prefix": "0.0.0.0/0",
|
||||||
|
"protocol": "tcp",
|
||||||
|
"port_range_min": "8080",
|
||||||
|
"port_range_max": "8080"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"remote_ip_prefix": "0.0.0.0/0",
|
||||||
|
"protocol": "tcp",
|
||||||
|
"port_range_min": "8161",
|
||||||
|
"port_range_max": "8161"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"BrokerPort": {
|
||||||
|
"Type": "OS::Neutron::Port",
|
||||||
|
"Properties": {
|
||||||
|
"network_id": { "Ref": "NetID" },
|
||||||
|
"fixed_ips": [{
|
||||||
|
"subnet_id": { "Ref": "SubnetID" }
|
||||||
|
}],
|
||||||
|
"security_groups": [{ "Ref": "OpenShiftOriginSecurityGroup" }]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"BrokerWaitHandle": {
|
||||||
|
"Type": "AWS::CloudFormation::WaitConditionHandle"
|
||||||
|
},
|
||||||
|
|
||||||
|
"BrokerWaitCondition": {
|
||||||
|
"Type": "AWS::CloudFormation::WaitCondition",
|
||||||
|
"DependsOn": "BrokerInstance",
|
||||||
|
"Properties": {
|
||||||
|
"Handle": { "Ref": "BrokerWaitHandle" },
|
||||||
|
"Timeout": "1800"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"BrokerInstance": {
|
||||||
|
"Type": "OS::Nova::Server",
|
||||||
|
"Properties": {
|
||||||
|
"image": "F19-x86_64-openshift-origin-broker",
|
||||||
|
"flavor": { "Ref": "BrokerFlavor" },
|
||||||
|
"key_name": { "Ref": "KeyName" },
|
||||||
|
"networks": [{
|
||||||
|
"port": { "Ref": "BrokerPort" }
|
||||||
|
}],
|
||||||
|
"user_data": {
|
||||||
|
"Fn::Base64": {
|
||||||
|
"Fn::Join": [
|
||||||
|
"",
|
||||||
|
[
|
||||||
|
"#!/bin/bash -x\n",
|
||||||
|
"export PREFIX=", { "Ref": "Prefix" }, "\n",
|
||||||
|
"export UPSTREAM_DNS=", { "Ref": "UpstreamDNS" }, "\n",
|
||||||
|
"export UPSTREAM_NTP=", { "Ref": "UpstreamNTP" }, "\n",
|
||||||
|
"export BROKER_WAIT_HANDLE=\"", { "Ref": "BrokerWaitHandle" }, "\"\n",
|
||||||
|
"/usr/sbin/dnssec-keygen -a HMAC-MD5 -b 512 -n USER -r /dev/urandom -K /var/named ${PREFIX}\n",
|
||||||
|
"export DNS_SEC_KEY=\"`cat /var/named/K${PREFIX}.*.key | awk '{print $8}'`\"\n",
|
||||||
|
"export HOSTNAME=\"`facter hostname`\"\n",
|
||||||
|
"export USERNAME=", { "Ref": "Username" }, "\n",
|
||||||
|
"export PASSWORD=", { "Ref": "Password" }, "\n",
|
||||||
|
"export DEV_MODE=", { "Ref": "DevMode" }, "\n",
|
||||||
|
"export PUPPET_MODULE_URL=", { "Ref": "PuppetModuleURL" }, "\n",
|
||||||
|
"export PUPPET_MODULE_BRANCH=", { "Ref": "PuppetModuleBranch" }, "\n",
|
||||||
|
"cat << EOF > /root/configure.pp\n",
|
||||||
|
"\\$my_hostname='${HOSTNAME}.${PREFIX}'\n",
|
||||||
|
"exec { \"set hostname\":\n",
|
||||||
|
" command => \"/bin/hostname \\${my_hostname} ; echo \\${my_hostname} > /etc/hostname\"\n",
|
||||||
|
"}\n",
|
||||||
|
"class { 'openshift_origin' :\n",
|
||||||
|
" roles => ['broker','named','activemq','datastore'],\n",
|
||||||
|
" bind_key => '${DNS_SEC_KEY}',\n",
|
||||||
|
" domain => '${PREFIX}',\n",
|
||||||
|
" register_host_with_named => true,\n",
|
||||||
|
" conf_named_upstream_dns => ['${UPSTREAM_DNS}'],\n",
|
||||||
|
" ntp_servers => ['${UPSTREAM_NTP}'],\n",
|
||||||
|
" broker_hostname => \\$my_hostname,\n",
|
||||||
|
" named_hostname => \\$my_hostname,\n",
|
||||||
|
" datastore_hostname => \\$my_hostname,\n",
|
||||||
|
" activemq_hostname => \\$my_hostname,\n",
|
||||||
|
" broker_auth_plugin => 'htpasswd',\n",
|
||||||
|
" openshift_user1 => '${USERNAME}',\n",
|
||||||
|
" openshift_password1 => '${PASSWORD}',\n",
|
||||||
|
" development_mode => ${DEV_MODE},\n",
|
||||||
|
"}\n",
|
||||||
|
"EOF\n",
|
||||||
|
"mkdir -p /etc/puppet/modules\n",
|
||||||
|
"git clone -b ${PUPPET_MODULE_BRANCH} ${PUPPET_MODULE_URL} /etc/puppet/modules/openshift_origin", "\n",
|
||||||
|
"puppet module install puppetlabs/stdlib", "\n",
|
||||||
|
"puppet module install puppetlabs/ntp", "\n",
|
||||||
|
"puppet apply --verbose /root/configure.pp | tee /var/log/configure_openshift.log", "\n",
|
||||||
|
"/opt/aws/bin/cfn-signal -e 0 --data \"${DNS_SEC_KEY}\" -r \"Broker setup complete\" \"${BROKER_WAIT_HANDLE}\"\n"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"NodePort": {
|
||||||
|
"Type": "OS::Neutron::Port",
|
||||||
|
"Properties": {
|
||||||
|
"network_id": { "Ref": "NetID" },
|
||||||
|
"fixed_ips": [{
|
||||||
|
"subnet_id": { "Ref": "SubnetID" }
|
||||||
|
}],
|
||||||
|
"security_groups": [{ "Ref": "OpenShiftOriginSecurityGroup" }]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"NodeWaitHandle": {
|
||||||
|
"Type": "AWS::CloudFormation::WaitConditionHandle"
|
||||||
|
},
|
||||||
|
|
||||||
|
"NodeWaitCondition": {
|
||||||
|
"Type": "AWS::CloudFormation::WaitCondition",
|
||||||
|
"DependsOn": "BrokerInstance",
|
||||||
|
"Properties": {
|
||||||
|
"Handle": { "Ref": "BrokerWaitHandle" },
|
||||||
|
"Timeout": "1800"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"NodeInstance": {
|
||||||
|
"Type": "OS::Nova::Server",
|
||||||
|
"DependsOn": "BrokerWaitCondition",
|
||||||
|
"Properties": {
|
||||||
|
"image": "F19-x86_64-openshift-origin-node",
|
||||||
|
"flavor": { "Ref": "NodeFlavor" },
|
||||||
|
"key_name": { "Ref": "KeyName" },
|
||||||
|
"networks": [{
|
||||||
|
"port": { "Ref": "NodePort" }
|
||||||
|
}],
|
||||||
|
"user_data": {
|
||||||
|
"Fn::Base64": {
|
||||||
|
"Fn::Join": [
|
||||||
|
"",
|
||||||
|
[
|
||||||
|
"#!/bin/bash -x\n",
|
||||||
|
"export DNS_SEC_KEY=\"`python -c 'print ",{ "Fn::GetAtt": [ "BrokerWaitCondition", "Data" ] },"[\"00000\"]'`\"\n",
|
||||||
|
"export BROKER_IP=", { "Fn::GetAtt": [ "BrokerInstance", "first_address" ] }, "\n",
|
||||||
|
"export PREFIX=", { "Ref": "Prefix" }, "\n",
|
||||||
|
"export UPSTREAM_DNS=", { "Ref": "UpstreamDNS" }, "\n",
|
||||||
|
"export UPSTREAM_NTP=", { "Ref": "UpstreamNTP" }, "\n",
|
||||||
|
"export NODE_WAIT_HANDLE=\"", { "Ref": "NodeWaitHandle" }, "\"\n",
|
||||||
|
"export HOSTNAME=\"`facter hostname`\"\n",
|
||||||
|
"export DEV_MODE=", { "Ref": "DevMode" }, "\n",
|
||||||
|
"export PUPPET_MODULE_URL=", { "Ref": "PuppetModuleURL" }, "\n",
|
||||||
|
"export PUPPET_MODULE_BRANCH=", { "Ref": "PuppetModuleBranch" }, "\n",
|
||||||
|
"cat << EOF > /root/configure.pp\n",
|
||||||
|
"\\$my_hostname=\"${HOSTNAME}.${PREFIX}\"\n",
|
||||||
|
"exec { \"set hostname\":\n",
|
||||||
|
" command => \"/bin/hostname \\${my_hostname} ; echo \\${my_hostname} > /etc/hostname\"\n",
|
||||||
|
"}\n",
|
||||||
|
"class { 'openshift_origin' :\n",
|
||||||
|
" roles => ['node'],\n",
|
||||||
|
" bind_key => '${DNS_SEC_KEY}',\n",
|
||||||
|
" named_ip_addr => '${BROKER_IP}',\n",
|
||||||
|
" domain => '${PREFIX}',\n",
|
||||||
|
" register_host_with_named => true,\n",
|
||||||
|
" broker_hostname => '${BROKER_IP}',\n",
|
||||||
|
" activemq_hostname => '${BROKER_IP}',\n",
|
||||||
|
" ntp_servers => ['${UPSTREAM_NTP}'],\n",
|
||||||
|
" node_hostname => \\$my_hostname,\n",
|
||||||
|
" install_method => 'yum',\n",
|
||||||
|
" jenkins_repo_base => 'http://pkg.jenkins-ci.org/redhat',\n",
|
||||||
|
" install_cartridges => ['php', 'mysql'],\n",
|
||||||
|
" development_mode => ${DEV_MODE},\n",
|
||||||
|
"}\n",
|
||||||
|
"EOF\n",
|
||||||
|
"mkdir -p /etc/puppet/modules\n",
|
||||||
|
"git clone -b ${PUPPET_MODULE_BRANCH} ${PUPPET_MODULE_URL} /etc/puppet/modules/openshift_origin", "\n",
|
||||||
|
"puppet module install puppetlabs/stdlib", "\n",
|
||||||
|
"puppet module install puppetlabs/ntp", "\n",
|
||||||
|
"puppet apply --verbose /root/configure.pp | tee /var/log/configure_openshift.log", "\n",
|
||||||
|
"/opt/aws/bin/cfn-signal -e 0 -r \"Node setup complete\" \"${NODE_WAIT_HANDLE}\"\n"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"Outputs" : {
|
||||||
|
"OpenShiftConsole" : {
|
||||||
|
"Value" : { "Fn::Join" : ["", ["https://", { "Fn::GetAtt" : [ "BrokerInstance", "first_address" ]}, "/console"]] },
|
||||||
|
"Description" : "URL for OpenShift Origin cConsole"
|
||||||
|
},
|
||||||
|
"NameServerEntry" : {
|
||||||
|
"Value" : { "Fn::Join" : ["", ["nameserver ", { "Fn::GetAtt" : [ "BrokerInstance", "first_address" ]}]] },
|
||||||
|
"Description" : "Entry to insert into /etc/resolv.conf for application host names to resolve"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
==========================
|
||||||
|
OpenShift Origin Templates
|
||||||
|
==========================
|
||||||
|
|
||||||
|
This directory contains files for deploying OpenShift Origin to an OpenStack environment via Heat.
|
||||||
|
The template has been tested with the OpenStack Icehouse-2 release.
|
||||||
|
|
||||||
|
It includes the following files:
|
||||||
|
|
||||||
|
* `OpenShift.template` - heat template for launching OpenShift Origin with a single broker instance and a single node instance
|
||||||
|
* `elements` - diskimage-builder elements to build images
|
||||||
|
|
||||||
|
To build with diskimage-builder, do the following in the parent directory of heat-templates::
|
||||||
|
|
||||||
|
git clone https://github.com/openstack/diskimage-builder.git
|
||||||
|
apt-get install -y qemu-utils kpartx
|
||||||
|
mkdir $HOME/tmp
|
||||||
|
export DIB_RELEASE=19
|
||||||
|
export ELEMENTS_PATH=heat-templates/openshift-origin/F19/elements
|
||||||
|
export TMP_DIR=$HOME/tmp
|
||||||
|
export DIB_IMAGE_SIZE=5
|
||||||
|
diskimage-builder/bin/disk-image-create --no-tmpfs -a amd64 vm fedora openshift-origin-broker -o F19-x86_64-openshift-origin-broker
|
||||||
|
glance image-create --name F19-x86_64-openshift-origin-broker --is-public true --disk-format qcow2 --container-format bare < F19-x86_64-openshift-origin-broker.qcow2
|
||||||
|
export DIB_IMAGE_SIZE=20
|
||||||
|
diskimage-builder/bin/disk-image-create --no-tmpfs -a amd64 vm fedora openshift-origin-node -o F19-x86_64-openshift-origin-node
|
||||||
|
glance image-create --name F19-x86_64-openshift-origin-node --is-public true --disk-format qcow2 --container-format bare < F19-x86_64-openshift-origin-node.qcow2
|
|
@ -0,0 +1,4 @@
|
||||||
|
Minimal packages required for Heat to successfully
|
||||||
|
deploy an OpenShift Origin Broker instance.
|
||||||
|
|
||||||
|
Note: All other packages are managed by Puppet.
|
|
@ -0,0 +1 @@
|
||||||
|
heat-cfntools
|
|
@ -0,0 +1,18 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -uex
|
||||||
|
|
||||||
|
install-packages \
|
||||||
|
openssh \
|
||||||
|
ntpdate \
|
||||||
|
bind \
|
||||||
|
bind-utils \
|
||||||
|
openssh-server \
|
||||||
|
git \
|
||||||
|
puppet \
|
||||||
|
facter \
|
||||||
|
tar \
|
||||||
|
ntp \
|
||||||
|
|
||||||
|
sed --in-place -e s/Type=oneshot/"Type=oneshot\nTimeoutSec=0"/ /lib/systemd/system/cloud-final.service
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
Minimal packages required for Heat to successfully
|
||||||
|
deploy an OpenShift Origin Node instance.
|
||||||
|
|
||||||
|
Note: All other packages are managed by Puppet.
|
|
@ -0,0 +1 @@
|
||||||
|
heat-cfntools
|
|
@ -0,0 +1,16 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -uex
|
||||||
|
|
||||||
|
install-packages \
|
||||||
|
openssh \
|
||||||
|
ntpdate \
|
||||||
|
openssh-server \
|
||||||
|
git \
|
||||||
|
puppet \
|
||||||
|
facter \
|
||||||
|
tar \
|
||||||
|
ntp \
|
||||||
|
|
||||||
|
sed --in-place -e s/Type=oneshot/"Type=oneshot\nTimeoutSec=0"/ /lib/systemd/system/cloud-final.service
|
||||||
|
|
Loading…
Reference in New Issue