-
RAM >= 8Gb
-
HDD free space >= 1Gb
Latest versions of installed packages:
-
Docker
-
Docker-compose
-
Curl
-
OpenVPN client
Latest versions of installed packages:
-
Vagrant
-
Curl
-
OpenVPN client
-
aws_access_key_id
-
aws_secret_access_key
These keys should have full access to EC2 operations
-
clone this repo
-
execute
./run.sh
-
clone this repo
-
execute
vagrant up
-
ssh [email protected] -p 2222; password - vagrant
-
(In vagrant) execute
cd /vagrant
-
(In vagrant) execute
./run
Create ssh key pair in AWS and name it “example_key”
Save private path of this key to ~/.ssh/example_key.pem
and set correct access
rights to it (chmod 400
~/.ssh/example_key.pem
)
grid_name="example"
aws_access_key_id="<your_aws_access_key>"
aws_secret_access_key="<your_aws_secret_key>"
aws_region="us-west-2"
aws_ssh_key="example_key"
group_name="infra"
curl -X POST -d "name=${grid_name}" -d "provider=aws" -d "type=mesos" http://localhost:5555/api/v2.0/grids
curl -X PUT -d "master_type=m3.medium" -d "masters=3" -d region="${aws_region}" -d "sshkey=${aws_ssh_key}" --data-urlencode "sshkeydata=`cat ~/.ssh/example_key.pem`" http://localhost:5555/api/v2.0/grids/${grid_name}/config
curl -X POST -d "name=${group_name}" -d "role=infra" -d "attributes={\"type\":\" infra\"}" -d "vars={\"foo\":\"bar\"}" -d "cpus=1" -d "ram=4" -d "disk_size=20" http://localhost:5555/api/v2.0/grids/${grid_name}/groups
curl -X PUT --data-urlencode aws_access_key_id=${aws_access_key_id} --data-urlencode "aws_secret_access_key=${aws_secret_access_key}" http://localhost:5555/api/v2.0/grids/${grid_name}/deployment/infrastructure
Wait for infrastructure deployment finish.
Status of
curl -X GET http://localhost:5555/api/v2.0/grids/${grid_name}/deployment
Should be infrastructure_deployed
curl -X PUT --data-urlencode aws_access_key_id=${aws_access_key_id} --data-urlencode "aws_secret_access_key=${aws_secret_access_key}" http://localhost:5555/api/v2.0/grids/${grid_name}/deployment/provision
Wait for provision finish.
Status of
curl -X GET http://localhost:5555/api/v2.0/grids/${grid_name}/deployment
Should be provision_finished
Execute
echo -e `curl -qs http://localhost:5555/api/v2.0/grids/${grid_name}/deployment/vpn | tr -d '"'` > vpn.ovpn
Execute
curl -X GET http://localhost:5555/api/v2.0/grids/${grid_name}/deployment/infrastructure
And save ip-address from accessip
field.
Ssh to accessip
:
ssh -i ~/.ssh/example_key.pem centos@<accessip>
Create user and passwd it:
sudo adduser exampleuser
sudo passwd exampleuser
Get ca.crt file at the <accessip> server and save it as ca.crt near the vpn.ovpn file
sudo cat /etc/openvpn/keys/ca.crt
Import VPN.ovpn file in your OpenVPN client
Set up vpn connection to use this connection for routes that are getting only
from the connection itself(something like local routes
).
Activate newly created VPN connection. Use exampleuser
and its password for
authentication.
Ensure, that 192.168.164.1
is primary dns server.
Mesos interface could be accessed by visiting next URL:
http://leader.mesos.service.example:5050/
Marathon interface could be accessed by visiting next URL:
http://leader.mesos.service.example:18080/