Rancher on AWS - GunSik2/rancher GitHub Wiki
Amazon Linux Image Docker
sudo yum update -y
sudo yum install -y docker
sudo service docker start
sudo usermod -a -G docker ec2-user
Rancher Server
docker run -d --restart=always -p 8080:8080 rancher/server
Rancher agent /w Rancher server
- go to Infrastructure > Hosts, and click Add Host.
sudo docker run -d --privileged -v /var/run/docker.sock:/var/run/docker.sock rancher/agent:v0.8.2 http://<rancher_ip>:8080/v1/scripts/hashkey
Rancher agent on other VM
sudo docker run -e CATTLE_AGENT_IP=<host_ip> -d --privileged -v /var/run/docker.sock:/var/run/docker.sock rancher/agent:v0.8.2 http://<rancher_ip>:8080/v1/scripts/hashkey
AWS Route53
- Create a hosted zone following the aws guide
- Launch Route53 service following the rancher guide
Create a Multi-Container Application through UI detail steps
- Structure: LB -> WordPress -> MySQL
- UI > Applications > Get Started page
- Add Service -> name=database, image=mysql -> Advanced option -> MYSQL_ROOT_PASSWORD=pass1
- Add Service -> name=wordpress, image=wordpress -> Addd database service in Service Links
- Add Service -> Add Load Balancer -> Set target port
- Open web browser and check "host_IP:public_port"