These scripts use the AWS command line client, so that needs to be installed and configured before you get started.
pip install awscli
aws configure #Will propmt you to enter your AWS access credentials
If you can run aws ec2 describe-regions --output text
and get a list of
regions back then you are good to go.
See the AWS cli docs if you run into any problems.
Clone the repository and then run the scripts from within the repo folder.
git clone https://github.com/bigblue/coreos_on_ec2.git
cd coreos_on_ec2
See this accompanying blog post for a background on the commands and to see the process of launching a new cluster.
$ ./launchInstances.sh -h
launchInstances.sh [OPTION]...
Launch instances to create new coreos cluster
Options:
-n, --number Number of instances to launch [default: 1]
-g, --group Security group name for new instances [default: coreosgroup]
-r, --region Region to launch instance(s) in, comma seperate multiple regions
e.g. 'us-east-1, us-west-1' [default: us-west-1]
-k, --key Path to public key of keypair to use
[default: ~/.ssh/CoreOSKey_rsa.pub]
A new keypair will be generated if file does not exist
-t, --token Discovery token to use (will be inserted into userdata)
[default: New token will be autogenerated from
https://discovery.etcd.io/new ]
-u, --userdata Path to userdata file to boot instances with
[default: ./single_region_userdata.yml]
-s, --skip-aws-checks Skip checking if aws cli is installed
-w, --weave-rules Include weave security group
-h, --help Display this help and exit
--version Output version information and exit
~
$ ./listinstances.sh -h
listInstances.sh [OPTION]...
List currently running instances in coreos cluster
Options:
-g, --group Filter by cluster security group [default: coreosgroup]
-r, --region Filter by region, comma seperate multiple regions
e.g. 'us-east-1, us-west-1' [default: all regions]
-s, --skip-aws-checks Skip checking if aws cli is installed
-h, --help Display this help and exit
--version Output version information and exit
$ ./connectToInstance.sh -h
connectToInstance.sh [OPTION]...
Quickly connect to one of the instances listed by listInstances.sh
Options:
-i, --index Which instance in list to connect to [default: 1]
-k, --key Path to private key to authenticate with [default: ~/.ssh/CoreOSKey_rsa]
-g, --group Security group to filter listInstances.sh with [default: coreosgroup]
-h, --help Display this help and exit
--version Output version information and exit
$ ./terminateInstances.sh -h
terminateInstances.sh [OPTION]...
Terminate currently running instances in coreos cluster
Options:
-g, --group Filter by cluster security group [default: coreosgroup]
-r, --region Filter by region, comma seperate multiple regions
e.g. 'us-east-1, us-west-1' [default: all regions]
-s, --skip-aws-checks Skip checking if aws cli is installed
-h, --help Display this help and exit
--version Output version information and exit
Used oxyc's bash boilerplate script as a starting point.
- Create an issue to discuss about your idea
- [Fork it] (https://github.com/bigblue/coreos_on_ec2/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
- Profit! โ
Released under the MIT License. See LICENSE.